all repos — caroster @ f653544e725a8d67c364b7ce06589f2dba5f0197

[Octree] Group carpool to your event https://caroster.io

feat: :lipstick: Re-order menu
Tim Izzo tim@octree.ch
Wed, 28 Sep 2022 07:13:16 +0000
commit

f653544e725a8d67c364b7ce06589f2dba5f0197

parent

977a49f918209f5b36bb88670077f49cb1a5a14f

M frontend/containers/EventBar/index.tsxfrontend/containers/EventBar/index.tsx

@@ -16,13 +16,10 @@

const EventBar = ({event, onAdd}) => { const {share} = useShare(); const [anchorEl, setAnchorEl] = useState(null); - const {profile, connected} = useProfile(); + const {connected} = useProfile(); const classes = useStyles(); const menuActions = useActions({onAdd, eventId: event?.id}); const appLink = connected ? '/dashboard' : `/e/${event.uuid}` || ''; - const userInfos = profile - ? [{label: profile.username, id: 'Email'}, {divider: true}] - : []; return ( <AppBar

@@ -70,7 +67,7 @@ {

<GenericMenu anchorEl={anchorEl} setAnchorEl={setAnchorEl} - actions={[...userInfos, ...menuActions]} + actions={menuActions} /> } <IconButton
M frontend/containers/EventBar/useActions.tsfrontend/containers/EventBar/useActions.ts

@@ -48,14 +48,15 @@ ];

const loggedMenuActions = [ { + label: t('menu.profile'), + onClick: () => router.push('/profile'), + id: 'ProfileTab', + }, + {divider: true}, + { label: t('menu.dashboard'), onClick: () => router.push('/dashboard'), id: 'GoToDashboardTab', - }, - { - label: t('menu.profile'), - onClick: () => router.push('/profile'), - id: 'ProfileTab', }, {divider: true}, ];
M frontend/containers/GenericMenu/index.tsxfrontend/containers/GenericMenu/index.tsx

@@ -43,8 +43,9 @@ };

const validActions = [ ...actions, + languageMenuItem, aboutMenuItem, - languageMenuItem, + {divider: true}, logoutMenuItem, ].filter(Boolean);
M frontend/containers/GenericToolbar/index.tsxfrontend/containers/GenericToolbar/index.tsx

@@ -25,10 +25,6 @@ const [anchorEl, setAnchorEl] = useState(null);

const classes = useStyles(); const {profile} = useProfile(); - const userInfos = profile - ? [{label: profile.username, id: 'Email'}, {divider: true}] - : []; - useEffect(() => { window.scrollTo(0, 0); }, []);

@@ -79,7 +75,7 @@

<GenericMenu anchorEl={anchorEl} setAnchorEl={setAnchorEl} - actions={[...userInfos, ...actions, {divider: true}]} + actions={[...actions, {divider: true}]} /> </> )}
M frontend/locales/en.jsonfrontend/locales/en.json

@@ -45,12 +45,12 @@ "joyride.skip": "Skip",

"menu.about": "About Caroster", "menu.tour": "Caroster tour", "menu.dashboard": "My Caroster", - "menu.language": "Language", + "menu.language": "Change language", "menu.login": "Login", "menu.logout": "Logout", "menu.register": "Sign-Up", "menu.new_event": "Create a caroster", - "menu.profile": "Profile", + "menu.profile": "My profile", "event.title": "{{title}} - Caroster", "event.not_found": "Project not found", "event.no_travel.title": "There are currently no cars",
M frontend/locales/fr.jsonfrontend/locales/fr.json

@@ -45,12 +45,12 @@ "joyride.skip": "Fermer",

"menu.about": "À propos de Caroster", "menu.tour": "Découverte de Caroster", "menu.dashboard": "Mes Caroster", - "menu.language": "Langue", + "menu.language": "Changer la langue", "menu.login": "Se connecter", "menu.logout": "Se déconnecter", "menu.register": "Créer un compte", "menu.new_event": "Créer un caroster", - "menu.profile": "Profil", + "menu.profile": "Mon profil", "event.title": "{{title}} - Caroster", "event.not_found": "Projet introuvable", "event.no_travel.title": "Pas de voitures pour le moment",
M frontend/pages/dashboard.tsxfrontend/pages/dashboard.tsx

@@ -46,14 +46,15 @@ );

const menuActions = [ { + label: t('menu.profile'), + onClick: () => router.push('/profile'), + id: 'ProfileTabs', + }, + {divider: true}, + { label: t('menu.new_event'), onClick: () => router.push('/'), id: 'AddEventTabs', - }, - { - label: t('menu.profile'), - onClick: () => router.push('/profile'), - id: 'ProfileTabs', }, ];
M frontend/pages/index.tsxfrontend/pages/index.tsx

@@ -42,14 +42,15 @@ ];

const loggedMenuActions = [ { + label: t('menu.profile'), + onClick: () => router.push('/profile'), + id: 'ProfileTabs', + }, + {divider: true}, + { label: t('menu.dashboard'), onClick: () => router.push('/dashboard'), id: 'SeeDashboardTabs', - }, - { - label: t('menu.profile'), - onClick: () => router.push('/profile'), - id: 'ProfileTabs', }, ];