From 97e44284fdce4fafe4abf336f21a2fb91f32a6fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chif=20Gerg=C5=91?= <chif.gergo@cloud.bme.hu> Date: Mon, 8 Feb 2021 22:08:35 +0100 Subject: [PATCH] Refactor layout in NewsContainer and add dummy advertisement --- src/components/NewsContainer.tsx | 21 ++++++++++++++++++--- src/pages/NewsPage.tsx | 5 +---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/NewsContainer.tsx b/src/components/NewsContainer.tsx index 42714e2..bda5476 100644 --- a/src/components/NewsContainer.tsx +++ b/src/components/NewsContainer.tsx @@ -1,4 +1,4 @@ -import { CircularProgress, Grid } from '@material-ui/core'; +import { Box, CircularProgress, Grid, Typography } from '@material-ui/core'; import React from 'react'; import News from './News'; @@ -10,8 +10,23 @@ const NewsContainer: React.FC = () => { return isLoading ? ( <CircularProgress /> ) : ( - <Grid container spacing={2}> - <News title="ASd" author="Anonymus" content="ASDADDD" createDate="2021.01.01" /> + <Grid container> + <Grid item xs={12} sm={3}> + <Box p={2} alignContent="center"> + <img + src="https://i.pinimg.com/474x/13/84/34/138434e6400eb73823192c74ea40bfc2.jpg" + height="auto" + width="80%" + alt="Fitness advertisement" + /> + </Box> + </Grid> + <Grid container item xs={12} sm={6} direction="column"> + <News title="ASd" author="Anonymus" content="ASDADDD" createDate="2021.01.01" /> + </Grid> + <Grid item xs={12} sm={3}> + <Typography>Naptár (?)</Typography> + </Grid> </Grid> ); }; diff --git a/src/pages/NewsPage.tsx b/src/pages/NewsPage.tsx index 45a629d..030618e 100644 --- a/src/pages/NewsPage.tsx +++ b/src/pages/NewsPage.tsx @@ -1,13 +1,10 @@ -import { Container } from '@material-ui/core'; import React from 'react'; import NewsContainer from '../components/NewsContainer'; import Page from './Page'; const NewsPage: React.FC = () => ( <Page> - <Container> - <NewsContainer /> - </Container> + <NewsContainer /> </Page> ); -- GitLab