|
1 | 1 | import { Fragment } from 'react'; |
| 2 | + |
| 3 | +// UI |
2 | 4 | import { Button, SettingsHeadline } from '../../UI'; |
| 5 | +import { AuthForm } from './AuthForm/AuthForm'; |
3 | 6 | import classes from './AppDetails.module.css'; |
| 7 | + |
| 8 | +// Store |
| 9 | +import { useSelector } from 'react-redux'; |
| 10 | +import { State } from '../../../store/reducers'; |
| 11 | + |
| 12 | +// Other |
4 | 13 | import { checkVersion } from '../../../utility'; |
5 | | -import { AuthForm } from './AuthForm/AuthForm'; |
6 | 14 |
|
7 | 15 | export const AppDetails = (): JSX.Element => { |
| 16 | + const { isAuthenticated } = useSelector((state: State) => state.auth); |
| 17 | + |
8 | 18 | return ( |
9 | 19 | <Fragment> |
10 | 20 | <SettingsHeadline text="Authentication" /> |
11 | 21 | <AuthForm /> |
12 | 22 |
|
13 | | - <hr className={classes.separator} /> |
14 | | - |
15 | | - <div> |
16 | | - <SettingsHeadline text="App version" /> |
17 | | - <p className={classes.text}> |
18 | | - <a |
19 | | - href="https://github.com/pawelmalak/flame" |
20 | | - target="_blank" |
21 | | - rel="noreferrer" |
22 | | - > |
23 | | - Flame |
24 | | - </a>{' '} |
25 | | - version {process.env.REACT_APP_VERSION} |
26 | | - </p> |
27 | | - |
28 | | - <p className={classes.text}> |
29 | | - See changelog{' '} |
30 | | - <a |
31 | | - href="https://github.com/pawelmalak/flame/blob/master/CHANGELOG.md" |
32 | | - target="_blank" |
33 | | - rel="noreferrer" |
34 | | - > |
35 | | - here |
36 | | - </a> |
37 | | - </p> |
38 | | - |
39 | | - <Button click={() => checkVersion(true)}>Check for updates</Button> |
40 | | - </div> |
| 23 | + {isAuthenticated && ( |
| 24 | + <Fragment> |
| 25 | + <hr className={classes.separator} /> |
| 26 | + |
| 27 | + <div> |
| 28 | + <SettingsHeadline text="App version" /> |
| 29 | + <p className={classes.text}> |
| 30 | + <a |
| 31 | + href="https://github.com/pawelmalak/flame" |
| 32 | + target="_blank" |
| 33 | + rel="noreferrer" |
| 34 | + > |
| 35 | + Flame |
| 36 | + </a>{' '} |
| 37 | + version {process.env.REACT_APP_VERSION} |
| 38 | + </p> |
| 39 | + |
| 40 | + <p className={classes.text}> |
| 41 | + See changelog{' '} |
| 42 | + <a |
| 43 | + href="https://github.com/pawelmalak/flame/blob/master/CHANGELOG.md" |
| 44 | + target="_blank" |
| 45 | + rel="noreferrer" |
| 46 | + > |
| 47 | + here |
| 48 | + </a> |
| 49 | + </p> |
| 50 | + |
| 51 | + <Button click={() => checkVersion(true)}>Check for updates</Button> |
| 52 | + </div> |
| 53 | + </Fragment> |
| 54 | + )} |
41 | 55 | </Fragment> |
42 | 56 | ); |
43 | 57 | }; |
0 commit comments