mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Initial expanded view in details.
This commit is contained in:
parent
b392a51676
commit
f535dca7b9
14 changed files with 108 additions and 39 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import Page from 'components/layout/Page';
|
||||
import MenuLayout from 'components/layout/MenuLayout';
|
||||
import WebsiteSettings from './WebsiteSettings';
|
||||
|
|
@ -8,21 +8,16 @@ import { useSelector } from 'react-redux';
|
|||
|
||||
export default function Settings() {
|
||||
const user = useSelector(state => state.user);
|
||||
const [option, setOption] = useState('Websites');
|
||||
|
||||
const menuOptions = ['Websites', user.is_admin && 'Accounts', 'Profile'];
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<MenuLayout menu={menuOptions} selectedOption="Websites">
|
||||
{option => {
|
||||
if (option === 'Websites') {
|
||||
return <WebsiteSettings />;
|
||||
} else if (option === 'Accounts') {
|
||||
return <AccountSettings />;
|
||||
} else if (option === 'Profile') {
|
||||
return <ProfileSettings />;
|
||||
}
|
||||
}}
|
||||
<MenuLayout menu={menuOptions} selectedOption={option} onMenuSelect={setOption}>
|
||||
{option === 'Websites' && <WebsiteSettings />}
|
||||
{option === 'Accounts' && <AccountSettings />}
|
||||
{option === 'Profile' && <ProfileSettings />}
|
||||
</MenuLayout>
|
||||
</Page>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue