Skip to content
Snippets Groups Projects
Commit 305c1d4a authored by Chif Gergő's avatar Chif Gergő
Browse files

Fix crash

parent 263c3728
Branches
No related tags found
3 merge requests!19fix type imports,!10Add theme,!8Refactor structure
import { CircularProgress, Grid } from '@material-ui/core'; import { CircularProgress, Grid } from '@material-ui/core';
import React, { useEffect } from 'react'; import React from 'react';
import useGetNewsList from '../hooks/useGetNewsList';
import News from './News'; import News from './News';
interface Props {} interface Props {}
const NewsContainer: React.FC = () => { const NewsContainer: React.FC = () => {
const [{ data, isLoading }, getNews] = useGetNewsList(); const isLoading = false;
useEffect(() => {
getNews();
}, [getNews]);
return isLoading ? ( return isLoading ? (
<CircularProgress /> <CircularProgress />
) : ( ) : (
<Grid container spacing={2}> <Grid container spacing={2}>
{data && <News title="ASd" author="Anonymus" content="ASDADDD" createDate="2021.01.01" />
data.map((item) => (
<News
title={item.title}
author="Anonymus"
content={item.text}
createDate={item.publishedAt}
/>
))}
</Grid> </Grid>
); );
}; };
......
import { createMuiTheme } from '@material-ui/core'; import { createMuiTheme } from '@material-ui/core';
// eslint-disable-next-line import/prefer-default-export // eslint-disable-next-line import/prefer-default-export
export const theme = createMuiTheme({ export const theme = createMuiTheme(/* {
palette: { palette: {
primary: {}, primary: {},
secondary: {}, secondary: {},
...@@ -16,4 +16,4 @@ export const theme = createMuiTheme({ ...@@ -16,4 +16,4 @@ export const theme = createMuiTheme({
typography: { typography: {
fontFamily: 'Roboto', fontFamily: 'Roboto',
}, },
}); } */);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment