fix: hide some account preferences sections
This commit is contained in:
@@ -37,12 +37,22 @@ const PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
|
|||||||
{ id: 'help-feedback', label: 'Help & feedback', icon: 'help' },
|
{ id: 'help-feedback', label: 'Help & feedback', icon: 'help' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const READY_PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
|
||||||
|
{ id: 'general', label: 'General', icon: 'settings' },
|
||||||
|
{ id: 'account', label: 'Account', icon: 'user' },
|
||||||
|
{ id: 'security', label: 'Security', icon: 'security' },
|
||||||
|
{ id: 'listed', label: 'Listed', icon: 'listed' },
|
||||||
|
{ id: 'help-feedback', label: 'Help & feedback', icon: 'help' },
|
||||||
|
];
|
||||||
|
|
||||||
export class PreferencesMenu {
|
export class PreferencesMenu {
|
||||||
private _selectedPane: PreferenceId = 'general';
|
private _selectedPane: PreferenceId = 'general';
|
||||||
|
private _menu: PreferencesMenuItem[];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _menu: PreferencesMenuItem[] = PREFERENCES_MENU_ITEMS
|
private readonly _enableUnfinishedFeatures: boolean,
|
||||||
) {
|
) {
|
||||||
|
this._menu = this._enableUnfinishedFeatures ? PREFERENCES_MENU_ITEMS : READY_PREFERENCES_MENU_ITEMS;
|
||||||
makeAutoObservable<PreferencesMenu, '_selectedPane' | '_twoFactorAuth'>(
|
makeAutoObservable<PreferencesMenu, '_selectedPane' | '_twoFactorAuth'>(
|
||||||
this,
|
this,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ const PreferencesCanvas: FunctionComponent<
|
|||||||
|
|
||||||
export const PreferencesView: FunctionComponent<PreferencesProps> = observer(
|
export const PreferencesView: FunctionComponent<PreferencesProps> = observer(
|
||||||
(props) => {
|
(props) => {
|
||||||
const menu = useMemo(() => new PreferencesMenu(), []);
|
const menu = useMemo(() => new PreferencesMenu(props.appState.enableUnfinishedFeatures), [
|
||||||
|
props.appState.enableUnfinishedFeatures
|
||||||
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
menu.selectPane(props.appState.preferences.currentPane);
|
menu.selectPane(props.appState.preferences.currentPane);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const AccountPreferences = observer(
|
|||||||
return (
|
return (
|
||||||
<PreferencesPane>
|
<PreferencesPane>
|
||||||
<Authentication application={application} appState={appState} />
|
<Authentication application={application} appState={appState} />
|
||||||
<SubscriptionWrapper application={application} />
|
{appState.enableUnfinishedFeatures && <SubscriptionWrapper application={application} />}
|
||||||
<SignOutWrapper application={application} appState={appState} />
|
<SignOutWrapper application={application} appState={appState} />
|
||||||
</PreferencesPane>
|
</PreferencesPane>
|
||||||
);
|
);
|
||||||
@@ -32,7 +32,7 @@ export const AccountPreferences = observer(
|
|||||||
<PreferencesPane>
|
<PreferencesPane>
|
||||||
<Credentials application={application} />
|
<Credentials application={application} />
|
||||||
<Sync application={application} />
|
<Sync application={application} />
|
||||||
<SubscriptionWrapper application={application} />
|
{appState.enableUnfinishedFeatures && <SubscriptionWrapper application={application} />}
|
||||||
<SignOutWrapper application={application} appState={appState} />
|
<SignOutWrapper application={application} appState={appState} />
|
||||||
</PreferencesPane>
|
</PreferencesPane>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
)
|
)
|
||||||
.sk-app-bar-item.ml-0-important(
|
.sk-app-bar-item.ml-0-important(
|
||||||
ng-click='ctrl.clickPreferences()'
|
ng-click='ctrl.clickPreferences()'
|
||||||
ng-if='ctrl.appState.enableUnfinishedFeatures'
|
|
||||||
)
|
)
|
||||||
.w-8.h-full.flex.items-center.justify-center.cursor-pointer
|
.w-8.h-full.flex.items-center.justify-center.cursor-pointer
|
||||||
.h-5
|
.h-5
|
||||||
|
|||||||
Reference in New Issue
Block a user