From c8040ed02bfc60bb3514b299f9d12234e8c7b094 Mon Sep 17 00:00:00 2001 From: Hawk Date: Sat, 2 May 2020 18:24:34 +0200 Subject: [PATCH] resource list and drawer menu responsive close#25 --- frontend/src/components/navigation.js | 14 +++++++++++- .../src/components/selectResource/index.js | 22 +++++++++---------- .../components/selectResource/resourceCard.js | 15 ++++++++----- 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/navigation.js b/frontend/src/components/navigation.js index d4e0f2d..0598abe 100644 --- a/frontend/src/components/navigation.js +++ b/frontend/src/components/navigation.js @@ -44,6 +44,9 @@ const useStyles = makeStyles((theme) => ({ easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.enteringScreen, }), + [theme.breakpoints.down('xs')]: { + width: `calc(100% - ${drawerWidth}px)`, + }, }, menuButton: { marginRight: theme.spacing(2), @@ -54,7 +57,10 @@ const useStyles = makeStyles((theme) => ({ drawer: { width: drawerWidth, flexShrink: 0, - whiteSpace: 'nowrap' + whiteSpace: 'nowrap', + [theme.breakpoints.down('xs')]: { + width: 0, + }, }, drawerOpen: { width: drawerWidthOpen, @@ -62,6 +68,9 @@ const useStyles = makeStyles((theme) => ({ easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.enteringScreen, }), + [theme.breakpoints.down('xs')]: { + width: drawerWidth, + }, }, drawerClose: { transition: theme.transitions.create('width', { @@ -70,6 +79,9 @@ const useStyles = makeStyles((theme) => ({ }), overflowX: 'hidden', width: drawerWidth, + [theme.breakpoints.down('xs')]: { + width: 0, + }, }, drawerHeader: { display: 'flex', diff --git a/frontend/src/components/selectResource/index.js b/frontend/src/components/selectResource/index.js index ab3467c..3c246a6 100644 --- a/frontend/src/components/selectResource/index.js +++ b/frontend/src/components/selectResource/index.js @@ -74,7 +74,7 @@ export default function SelectResource() { - + {resources[0]} @@ -88,7 +88,7 @@ export default function SelectResource() { - + {resources[1]} @@ -102,7 +102,7 @@ export default function SelectResource() { - + {resources[2]} @@ -116,7 +116,7 @@ export default function SelectResource() { - + {resources[3]} @@ -127,10 +127,10 @@ export default function SelectResource() { Electronics - + - + {resources[4]} @@ -144,7 +144,7 @@ export default function SelectResource() { - + {resources[5]} @@ -158,7 +158,7 @@ export default function SelectResource() { - + {resources[6]} @@ -172,7 +172,7 @@ export default function SelectResource() { - + {resources[7]} @@ -186,7 +186,7 @@ export default function SelectResource() { - + {resources[8]} @@ -200,7 +200,7 @@ export default function SelectResource() { - + {resources[9]} diff --git a/frontend/src/components/selectResource/resourceCard.js b/frontend/src/components/selectResource/resourceCard.js index 05f1cdb..9bb6304 100644 --- a/frontend/src/components/selectResource/resourceCard.js +++ b/frontend/src/components/selectResource/resourceCard.js @@ -9,6 +9,8 @@ import Link1 from '@material-ui/core/Link'; import ListItem from '@material-ui/core/ListItem'; import ListItemText from '@material-ui/core/ListItemText'; import ListItemIcon from '@material-ui/core/ListItemIcon'; +import Tooltip from '@material-ui/core/Tooltip'; +import Zoom from '@material-ui/core/Zoom'; const useStyles = makeStyles(theme => ({ @@ -42,15 +44,16 @@ export default function ResourceCard(props) { return ( - + - - {props.resource["name"]} - - - + + + {props.resource["name"]} + + +