Skip to content

Commit

Permalink
feat: add Menu config, About button in help menu and some labels
Browse files Browse the repository at this point in the history
  • Loading branch information
nborde-CSM committed Jan 25, 2022
1 parent e670fde commit e747ef7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/layouts/TabLayout/TabLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Auth } from '@cosmotech/core';
import { PrivateRoute, UserInfo, HelpMenu } from '@cosmotech/ui';
import { useTranslation } from 'react-i18next';
import { LANGUAGES, SUPPORT_URL, DOCUMENTATION_URL } from '../../config/AppConfiguration';
import { About } from '../../services/config/Menu';
import theme from '../../theme/';
import profilePlaceholder from '../../assets/profile_placeholder.png';

Expand Down Expand Up @@ -82,6 +83,8 @@ const TabLayout = (props) => {
const helpLabels = {
documentation: t('genericcomponent.helpmenu.documentation'),
support: t('genericcomponent.helpmenu.support'),
aboutTitle: t('genericcomponent.helpmenu.about'),
close: t('genericcomponent.dialog.about.button.close'),
};

return (
Expand All @@ -103,7 +106,12 @@ const TabLayout = (props) => {
</Tabs>
<div className={classes.rightBar}>
<div className={classes.rightBarElement}>
<HelpMenu documentationUrl={DOCUMENTATION_URL} supportUrl={SUPPORT_URL} labels={helpLabels} />
<HelpMenu
documentationUrl={DOCUMENTATION_URL}
supportUrl={SUPPORT_URL}
about={About ? <About /> : null}
labels={helpLabels}
/>
</div>
<div className={classes.rightBarElement}>
<UserInfo
Expand Down
7 changes: 7 additions & 0 deletions src/services/config/Menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Cosmo Tech.
// Licensed under the MIT license.

import { AboutContent } from '../../components/About';

// If you do not want to display About entry in help menu, set About to null
export const About = AboutContent;

0 comments on commit e747ef7

Please sign in to comment.