-
-
Notifications
You must be signed in to change notification settings - Fork 211
/
SettingsMenu.tsx
43 lines (36 loc) · 1.11 KB
/
SettingsMenu.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import React, { Component } from 'react'
import styles from './SettingsMenu.css'
import LayoutMain from 'renderer/components/layout/Main'
import { MenuHeader } from '../menu/MenuHeader'
import ProfileSettings from './sections/Profile'
import AdvancedSettings from './sections/Advanced'
import ThirdPartySettings from './sections/ThirdParty'
import LanguageSettings from './sections/Language'
import { t } from 'locale'
interface IProps {}
interface State {
hide?: boolean
}
export class SettingsMenu extends Component<IProps, State> {
state: State = {}
/** Force rerender of all children */
private invalidate = () => {
this.setState({ hide: true }, () => {
this.setState({ hide: false })
})
}
render(): JSX.Element | null {
if (this.state.hide) return null
return (
<LayoutMain className={styles.container}>
<MenuHeader text={t('settings')} />
<div className={styles.content}>
<ProfileSettings />
<AdvancedSettings />
<LanguageSettings onChange={this.invalidate} />
<ThirdPartySettings />
</div>
</LayoutMain>
)
}
}