feat(settings): add expand all button

This commit is contained in:
plebeius.eth
2024-05-16 22:00:22 +02:00
parent 5080dee121
commit 91d2a5ae01
2 changed files with 25 additions and 1 deletions
@@ -89,6 +89,19 @@
background-image: var(--settings-modal-close-button-background-image); background-image: var(--settings-modal-close-button-background-image);
} }
.expandAllSettings {
text-align: center;
}
.expandAllSettings span {
color: var(--button-desktop-text-color);
}
.expandAllSettings span:hover {
color: var(--button-desktop-text-color-hover);
cursor: pointer;
}
.languageSettings { .languageSettings {
display: inline-block; display: inline-block;
} }
@@ -124,7 +124,15 @@ const SettingsModal = () => {
const [showAccountSettings, setShowAccountSettings] = useState(false); const [showAccountSettings, setShowAccountSettings] = useState(false);
const [showCryptoAddressSetting, setShowCryptoAddressSetting] = useState(false); const [showCryptoAddressSetting, setShowCryptoAddressSetting] = useState(false);
const [showCryptoWalletSettings, setShowCryptoWalletSettings] = useState(false); const [showCryptoWalletSettings, setShowCryptoWalletSettings] = useState(false);
// const [showPlebbitOptionsSettings, setShowPlebbitOptionsSettings] = useState(false); const [expandAll, setExpandAll] = useState(false);
const handleExpandAll = () => {
const newExpandState = !expandAll;
setExpandAll(newExpandState);
setShowAccountSettings(newExpandState);
setShowCryptoAddressSetting(newExpandState);
setShowCryptoWalletSettings(newExpandState);
};
return ( return (
<> <>
@@ -144,6 +152,9 @@ const SettingsModal = () => {
<span className={styles.title}>{t('settings')}</span> <span className={styles.title}>{t('settings')}</span>
<span className={styles.closeButton} title='close' onClick={closeModal} /> <span className={styles.closeButton} title='close' onClick={closeModal} />
</div> </div>
<div className={styles.expandAllSettings}>
[<span onClick={handleExpandAll}>{expandAll ? 'Collapse All Settings' : 'Expand All Settings'}</span>]
</div>
<div className={styles.setting}> <div className={styles.setting}>
{t('update')}: <CheckForUpdates /> {t('update')}: <CheckForUpdates />
</div> </div>