Skip to content

Commit

Permalink
fix: adapt styling and add custom title for event dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Oct 16, 2023
1 parent 3459983 commit 5625597
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Root = (): JSX.Element => (
</Router>
</ThemeProvider>
</I18nextProvider>
{import.meta.env.DEV && <ReactQueryDevtools />}
{import.meta.env.DEV && <ReactQueryDevtools position="bottom-right" />}
</QueryClientProvider>
);

Expand Down
80 changes: 47 additions & 33 deletions src/components/main/MainMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { useLocation, useNavigate } from 'react-router';

import { BugReport } from '@mui/icons-material';
import AutoStoriesIcon from '@mui/icons-material/AutoStories';
import DeleteIcon from '@mui/icons-material/Delete';
import FolderIcon from '@mui/icons-material/Folder';
import FolderSharedIcon from '@mui/icons-material/FolderShared';
import Star from '@mui/icons-material/Star';
import { Box, Button, styled, useTheme } from '@mui/material';
import {
ListItem,
ListItemButton,
ListItemText,
Stack,
styled,
useTheme,
} from '@mui/material';
import ListItemIcon from '@mui/material/ListItemIcon';

import { DEFAULT_LANG } from '@graasp/sdk';
Expand All @@ -25,25 +33,18 @@ import {
import { BUILDER } from '../../langs/constants';
import { useCurrentUserContext } from '../context/CurrentUserContext';

const BottomContainer = styled(Box)(({ theme }) => ({
position: 'absolute',
bottom: 0,
width: '100%',
padding: theme.spacing(2),
}));

const StyledLink = styled('a')(({ theme }) => ({
display: 'flex',
alignItems: 'center',
boxSizing: 'border-box',
color: 'grey',
textDecoration: 'none',
marginTop: theme.spacing(1),

'&:hover': {
color: theme.palette.primary.main,
},
}));
// const StyledLink = styled('a')(({ theme }) => ({
// display: 'flex',
// alignItems: 'center',
// boxSizing: 'border-box',
// color: 'grey',
// textDecoration: 'none',
// marginTop: theme.spacing(1),

// '&:hover': {
// color: theme.palette.primary.main,
// },
// }));
const StyledMenuItem = styled(MenuItem)(({ theme }) => ({
'&:hover': {
color: theme.palette.primary.main,
Expand All @@ -70,23 +71,31 @@ const MainMenu = (): JSX.Element => {
// this will be reported in sentry user feedback issues
showReportDialog({
eventId,
title: translateBuilder(BUILDER.REPORT_A_BUG),
lang: i18n.language || DEFAULT_LANG,
});
};

const resourceLinks = (
<BottomContainer>
<Button onClick={openBugReport}>
{translateBuilder(BUILDER.REPORT_A_BUG)}
</Button>
const reportBugLink = (
<ListItem disablePadding>
<ListItemButton onClick={openBugReport}>
<ListItemIcon>
<BugReport />
</ListItemIcon>
<ListItemText>{translateBuilder(BUILDER.REPORT_A_BUG)}</ListItemText>
</ListItemButton>
</ListItem>
);

<StyledLink href={TUTORIALS_LINK} target="_blank">
const resourceLinks = (
<ListItem disablePadding>
<ListItemButton href={TUTORIALS_LINK} target="_blank">
<ListItemIcon>
<AutoStoriesIcon />
</ListItemIcon>
{translateBuilder('Tutorials')}
</StyledLink>
</BottomContainer>
<ListItemText>{translateBuilder('Tutorials')}</ListItemText>
</ListItemButton>
</ListItem>
);

const renderAuthenticatedMemberMenuItems = () => {
Expand All @@ -101,7 +110,7 @@ const MainMenu = (): JSX.Element => {
}

return (
<>
<div>
<MenuItem
onClick={() => goTo(HOME_PATH)}
selected={pathname === HOME_PATH}
Expand Down Expand Up @@ -138,14 +147,19 @@ const MainMenu = (): JSX.Element => {
text={translateBuilder(BUILDER.RECYCLE_BIN_TITLE)}
icon={<DeleteIcon />}
/>
</>
</div>
);
};

return (
<GraaspMainMenu fullHeight>
{renderAuthenticatedMemberMenuItems()}
{resourceLinks}
<Stack direction="column" height="100%" justifyContent="space-between">
{renderAuthenticatedMemberMenuItems()}
<div>
{reportBugLink}
{resourceLinks}
</div>
</Stack>
</GraaspMainMenu>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/langs/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,6 @@
"STATUS_TOOLTIP_IS_PUBLISHED": "Publié",
"STATUS_TOOLTIP_IS_COLLAPSIBLE": "Minifié",
"STATUS_TOOLTIP_SHOW_CHATBOX": "Chatbox visible",
"SETTINGS_FILE_SETTINGS_TITLE": "Paramètres du fichier"
"SETTINGS_FILE_SETTINGS_TITLE": "Paramètres du fichier",
"REPORT_A_BUG": "Signaler un problème"
}

0 comments on commit 5625597

Please sign in to comment.