From a328388cdc754618e5338fa3612f7bf4d7cc63c5 Mon Sep 17 00:00:00 2001 From: Amit Shalev Date: Wed, 16 Aug 2023 13:51:15 +0300 Subject: [PATCH] change crad design --- src/components/StreetCard.tsx | 60 ++++++++++++++++++++++++----------- src/pages/HomePage.tsx | 4 --- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/src/components/StreetCard.tsx b/src/components/StreetCard.tsx index 06f666b..be5ffdc 100644 --- a/src/components/StreetCard.tsx +++ b/src/components/StreetCard.tsx @@ -1,5 +1,15 @@ import React from 'react'; -import { IconButton, Typography, CardMedia, CardContent, CardActions, Card, SvgIconTypeMap } from '@material-ui/core'; +import { + IconButton, + Typography, + CardMedia, + CardContent, + CardActions, + Card, + SvgIconTypeMap, + CardHeader, + Box, +} from '@material-ui/core'; import { ErrorRounded, Chat } from '@material-ui/icons'; import { OverridableComponent } from '@material-ui/core/OverridableComponent'; import { Theme } from '@material-ui/core'; @@ -18,54 +28,66 @@ export interface CardIconProps { const useStyles = makeStyles((theme: Theme) => ({ cardIconButton: { - backgroundColor: theme.palette.secondary.main, + backgroundColor: theme.palette.primary.main, '&:hover': { - backgroundColor: theme.palette.secondary.light, + backgroundColor: theme.palette.primary.light, }, + '& svg': { + fontSize: '2rem', + color: 'white', + }, + margin: 8, + borderRadius: '20%', }, streetCard: { height: 'fit-content', - width: 345, + width: '600px', marginRight: '12px', marginBottom: '24px', position: 'relative', - borderRadius: '20px', + borderRadius: '16px', }, streetCardActions: { - bottom: 50, - position: 'absolute', - width: '90%', + width: '100%', + display: 'flex', justifyContent: 'flex-end', + alignItems: 'center', + position: 'absolute', + bottom: 10, + left: 10, + }, + cardHeader: { + '& span': { + fontSize: '2vh', + fontWeight: 'bold', + }, }, })); const CardIcon: React.FC = ({ ariaLabel, Icon, className }) => { return ( - + ); }; const StreetCard: React.FC = ({ streetName, city }) => { const classes = useStyles(); + return ( + - - - - - - - {city}, {streetName} - - + + + + ); }; diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index 5a1d2ca..4e6457d 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -6,11 +6,7 @@ import { observer } from 'mobx-react-lite'; const useStyles = makeStyles((theme: Theme) => ({ container: { height: '100%', - display: 'flex', - flexDirection: 'row', - flexWrap: 'wrap', margin: '16px', - justifyContent: 'center', overflow: 'auto', }, }));