app/src/pages/Profile.js (view raw)
1import React from 'react';
2import {useAuth} from 'strapi-react-context';
3import Layout from '../layouts/Centered';
4import {useTranslation} from 'react-i18next';
5import GenericMenu from '../containers/GenericMenu';
6
7import {useHistory} from 'react-router-dom';
8
9const Menu = () => {
10 const history = useHistory();
11 const {t} = useTranslation();
12 const {logout} = useAuth();
13 const goDashboard = history.push.bind(undefined, '/dashboard');
14 const goNewEvent = history.push.bind(undefined, '/new');
15 const goAbout = () => (window.location.href = t('meta.about_href'));
16
17 return (
18 <GenericMenu
19 title={t('profile.title')}
20 actions={[
21 {
22 label: t('menu.new_event'),
23 onClick: goNewEvent,
24 id: 'AddEventTabs',
25 },
26 {
27 label: t('menu.dashboard'),
28 onClick: goDashboard,
29 id: 'DashboardTabs',
30 },
31 {
32 label: t('menu.logout'),
33 onClick: logout,
34 id: 'LogoutTabs',
35 },
36 {
37 label: t('menu.about'),
38 onClick: goAbout,
39 id: 'AboutTabs',
40 },
41 ]}
42 />
43 );
44};
45
46const Profile = () => {
47 return (
48 <>
49 <Menu />
50 <Layout>Profile – NOT IMPLEMENTED</Layout>
51 </>
52 );
53};
54
55export default Profile;