-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NBO/add_about_section_PROD-7848'
- Loading branch information
Showing
15 changed files
with
217 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# About customization | ||
|
||
## Customization of About content component | ||
|
||
By default, About content customization is set in the React component: | ||
[src/components/AboutContent/AboutContent.js](../src/components/AboutContent/AboutContent.js) | ||
|
||
## About content configuration | ||
|
||
- In the same [AboutContent.js](../src/components/AboutContent/AboutContent.js) file, | ||
**title** and **text** contents are set through these translation keys: | ||
|
||
```jsx | ||
<Grid className={classes.title} item> | ||
{t('genericcomponent.dialog.about.title')} | ||
</Grid> | ||
... | ||
<Grid item className={classes.content}> | ||
{t('genericcomponent.dialog.about.content')} | ||
</Grid> | ||
``` | ||
|
||
and translation files: | ||
|
||
[public/locales/en/translation.json](../public/locales/en/translation.json) | ||
|
||
[public/locales/fr/translation.json](../public/locales/fr/translation.json) | ||
|
||
- Webapp **version number** is automaticaly fetched from [package.json](package.json) at deployment. | ||
So, don't forget to keep up-to-date the variable `version`: | ||
|
||
```json | ||
{ | ||
"name": "azure-sample-webapp", | ||
"version": "2.1.0", | ||
"private": true, | ||
"dependencies": { | ||
``` | ||
|
||
## Enable or disable About entry in help menu | ||
|
||
In file [src/services/config/Menu.js](../src/services/config/Menu.js): | ||
|
||
- To **enable** About entry in help menu. | ||
`About` constant must be set with **About content component**. | ||
|
||
By default, the constant is set like that: | ||
|
||
```js | ||
import { AboutContent } from '../../components/AboutContent'; | ||
|
||
export const About = AboutContent; | ||
``` | ||
|
||
If you want to use another component, don't forget to set correctly the `import` line. | ||
|
||
- To **disable** About entry in help menu. | ||
`About` constant must be set as **_null_** : | ||
|
||
```js | ||
// import { AboutContent } from '../../components/AboutContent'; | ||
|
||
export const About = null; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Copyright (c) Cosmo Tech. | ||
// Licensed under the MIT license. | ||
|
||
import React from 'react'; | ||
import { Grid, makeStyles, ButtonBase, Link } from '@material-ui/core'; | ||
import theme from '../../theme'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { SUPPORT_URL, COSMOTECH_URL, APP_VERSION } from '../../config/AppConfiguration'; | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
root: { | ||
alignItems: 'center', | ||
}, | ||
picture: { | ||
marginRight: '16px', | ||
}, | ||
title: { | ||
fontWeight: 'bold', | ||
fontSize: '24px', | ||
}, | ||
version: { | ||
marginTop: '16px', | ||
fontWeight: 'bold', | ||
}, | ||
content: { | ||
marginTop: '2px', | ||
marginBottom: '16px', | ||
}, | ||
})); | ||
|
||
export const AboutContent = () => { | ||
const { t } = useTranslation(); | ||
const classes = useStyles(); | ||
|
||
return ( | ||
<Grid container spacing={2} className={classes.root}> | ||
<Grid item className={classes.picture}> | ||
<ButtonBase> | ||
<img alt="Cosmo Tech" src={theme.picture.logo} /> | ||
</ButtonBase> | ||
</Grid> | ||
<Grid item container xs> | ||
<Grid item container direction="column"> | ||
<Grid className={classes.title} item> | ||
{t('genericcomponent.dialog.about.title')} | ||
</Grid> | ||
<Grid item className={classes.version}> | ||
{APP_VERSION} | ||
</Grid> | ||
<Grid item className={classes.content}> | ||
{t('genericcomponent.dialog.about.content')} | ||
</Grid> | ||
<Grid item> | ||
<Link href={SUPPORT_URL} target="_blank" rel="noreferrer"> | ||
{SUPPORT_URL} | ||
</Link> | ||
</Grid> | ||
<Grid item> | ||
<Link href={COSMOTECH_URL} target="_blank" rel="noreferrer"> | ||
{COSMOTECH_URL} | ||
</Link> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
); | ||
}; | ||
|
||
AboutContent.propTypes = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { AboutContent } from './AboutContent'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/AboutContent'; | ||
|
||
// If you do not want to display About entry in help menu, set About to null | ||
export const About = AboutContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters