split SettingsFooter to component

This commit is contained in:
srgooglo 2022-10-25 12:07:49 +00:00
parent 8ab88f589e
commit 44fb448f3a

View File

@ -24,6 +24,34 @@ const ItemTypes = {
SliderColorPicker: SliderPicker,
}
const SettingsFooter = () => {
const isDevMode = window.__evite?.env?.NODE_ENV !== "production"
return <div className="footer" >
<div>
<div>{config.app?.siteName}</div>
<div>
<antd.Tag>
<Icons.Tag />v{window.app.version}
</antd.Tag>
</div>
<div>
<antd.Tag color={isDevMode ? "magenta" : "green"}>
{isDevMode ? <Icons.Triangle /> : <Icons.Box />}
{isDevMode ? "development" : "stable"}
</antd.Tag>
</div>
</div>
<div>
<antd.Button type="link" onClick={this.onClickAppAbout}>
<Translation>
{t => t("about")}
</Translation>
</antd.Button>
</div>
</div>
}
const SettingItem = (props) => {
let { item } = props
@ -397,10 +425,7 @@ export default class SettingsMenu extends React.PureComponent {
}
render() {
const isDevMode = window.__evite?.env?.NODE_ENV !== "production"
return (
<div className="settings">
return <div className="settings">
<antd.Tabs
activeKey={this.state.activeKey}
centered
@ -409,30 +434,8 @@ export default class SettingsMenu extends React.PureComponent {
>
{this.generateSettingsTabs()}
</antd.Tabs>
<div className="footer">
<div>
<div>{config.app?.siteName}</div>
<div>
<antd.Tag>
<Icons.Tag />v{window.app.version}
</antd.Tag>
<SettingsFooter />
</div>
<div>
<antd.Tag color={isDevMode ? "magenta" : "green"}>
{isDevMode ? <Icons.Triangle /> : <Icons.Box />}
{isDevMode ? "development" : "stable"}
</antd.Tag>
</div>
</div>
<div>
<antd.Button type="link" onClick={this.onClickAppAbout}>
<Translation>
{t => t("about")}
</Translation>
</antd.Button>
</div>
</div>
</div>
)
}
}