mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-06-11 02:12:13 +02:00
ux: creation of a menu in the user settings
This commit is contained in:
parent
d50f87972c
commit
3433f37a0e
|
@ -107,7 +107,7 @@ export default function EmailSettings(props) {
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
className='defaultButton'
|
className={classes.AccountSettingsButton}
|
||||||
disabled={!isValid || isSubmitting}
|
disabled={!isValid || isSubmitting}
|
||||||
>
|
>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
|
|
|
@ -106,7 +106,7 @@ export default function PasswordSettings(props) {
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
className='defaultButton'
|
className={classes.AccountSettingsButton}
|
||||||
disabled={!isValid || isSubmitting}
|
disabled={!isValid || isSubmitting}
|
||||||
>
|
>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
//Lib
|
//Lib
|
||||||
import 'react-toastify/dist/ReactToastify.css';
|
import 'react-toastify/dist/ReactToastify.css';
|
||||||
import classes from './UserSettings.module.css';
|
import classes from './UserSettings.module.css';
|
||||||
|
import { useState } from 'react';
|
||||||
|
|
||||||
//Components
|
//Components
|
||||||
import EmailSettings from './EmailSettings/EmailSettings';
|
import EmailSettings from './EmailSettings/EmailSettings';
|
||||||
|
@ -10,21 +11,57 @@ import EmailAlertSettings from './EmailAlertSettings/EmailAlertSettings';
|
||||||
import AppriseAlertSettings from './AppriseAlertSettings/AppriseAlertSettings';
|
import AppriseAlertSettings from './AppriseAlertSettings/AppriseAlertSettings';
|
||||||
|
|
||||||
export default function UserSettings(props) {
|
export default function UserSettings(props) {
|
||||||
|
//States
|
||||||
|
const [tab, setTab] = useState('General');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.containerSettings}>
|
<div className={classes.containerSettings}>
|
||||||
<div>
|
<div>
|
||||||
<h1 style={{ color: '#494b7a', textAlign: 'center' }}>
|
<h1
|
||||||
Welcome{' '}
|
style={{
|
||||||
{props.status === 'authenticated' && props.data.user.name}{' '}
|
color: '#494b7a',
|
||||||
👋
|
textAlign: 'left',
|
||||||
|
marginLeft: '30px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Account{' '}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={classes.tabList}>
|
||||||
<PasswordSettings username={props.data.user.name} />
|
<button
|
||||||
<EmailSettings email={props.data.user.email} />
|
className={
|
||||||
<UsernameSettings username={props.data.user.name} />
|
tab == 'General'
|
||||||
<EmailAlertSettings />
|
? classes.tabListButtonActive
|
||||||
<AppriseAlertSettings />
|
: classes.tabListButton
|
||||||
|
}
|
||||||
|
onClick={() => setTab('General')}
|
||||||
|
>
|
||||||
|
General
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className={
|
||||||
|
tab == 'Notifications'
|
||||||
|
? classes.tabListButtonActive
|
||||||
|
: classes.tabListButton
|
||||||
|
}
|
||||||
|
onClick={() => setTab('Notifications')}
|
||||||
|
>
|
||||||
|
Notifications
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{tab == 'General' && (
|
||||||
|
<>
|
||||||
|
<PasswordSettings username={props.data.user.name} />
|
||||||
|
<EmailSettings email={props.data.user.email} />
|
||||||
|
<UsernameSettings username={props.data.user.name} />{' '}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{tab == 'Notifications' && (
|
||||||
|
<>
|
||||||
|
<EmailAlertSettings />
|
||||||
|
<AppriseAlertSettings />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,3 +161,88 @@
|
||||||
animation: entrance 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
|
animation: entrance 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tabList {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabListButton {
|
||||||
|
color: #494b7a;
|
||||||
|
padding: 12px 0px;
|
||||||
|
min-height: 48px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
flex-direction: column;
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.71;
|
||||||
|
text-transform: none;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-decoration: none;
|
||||||
|
border: 0;
|
||||||
|
background-color: transparent;
|
||||||
|
margin-left: 30px;
|
||||||
|
border-bottom: 2px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabListButton:hover {
|
||||||
|
color: #6d4aff;
|
||||||
|
border-bottom: 2px solid #6d4aff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabListButtonActive {
|
||||||
|
color: #6d4aff;
|
||||||
|
border: 0;
|
||||||
|
border-bottom: 2px solid #6d4aff;
|
||||||
|
padding: 12px 0px;
|
||||||
|
min-height: 48px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-align: center;
|
||||||
|
flex-direction: column;
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1.71;
|
||||||
|
text-transform: none;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: transparent;
|
||||||
|
margin-left: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.AccountSettingsButton {
|
||||||
|
border: 0;
|
||||||
|
padding: 10px 15px;
|
||||||
|
background-color: #6d4aff;
|
||||||
|
color: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.AccountSettingsButton:hover {
|
||||||
|
border: 0;
|
||||||
|
padding: 10px 15px;
|
||||||
|
background-color: #4f31ce;
|
||||||
|
color: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.AccountSettingsButton:active {
|
||||||
|
border: 0;
|
||||||
|
padding: 10px 15px;
|
||||||
|
background-color: #4f31ce;
|
||||||
|
color: white;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 1em;
|
||||||
|
transform: scale(0.95);
|
||||||
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ export default function UsernameSettings(props) {
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
className='defaultButton'
|
className={classes.AccountSettingsButton}
|
||||||
disabled={!isValid || isSubmitting}
|
disabled={!isValid || isSubmitting}
|
||||||
>
|
>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
|
|
Loading…
Reference in a new issue