Skip to content

Commit

Permalink
fix: disable change email feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonella Sgarlatta committed Oct 13, 2021
1 parent e1b7f07 commit 5b91e41
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AccountPreferences = observer(

return (
<PreferencesPane>
<Credentials application={application} />
<Credentials application={application} appState={appState} />
<Sync application={application} />
{appState.enableUnfinishedFeatures && <SubscriptionWrapper application={application} />}
<SignOutWrapper application={application} appState={appState} />
Expand Down
22 changes: 13 additions & 9 deletions app/assets/javascripts/preferences/panes/account/Credentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { useState } from 'preact/hooks';
import { ChangeEmail } from '@/preferences/panes/account/changeEmail';
import { PasswordWizardType } from '@/types';
import { FunctionComponent } from 'preact';
import { AppState } from '@/ui_models/app_state';

type Props = {
application: WebApplication;
appState: AppState;
};

export const Credentials: FunctionComponent<Props> = observer(({ application }: Props) => {
export const Credentials: FunctionComponent<Props> = observer(({ application, appState }: Props) => {
const [isChangeEmailDialogOpen, setIsChangeEmailDialogOpen] = useState(false);

const user = application.getUser();
Expand All @@ -31,14 +33,16 @@ export const Credentials: FunctionComponent<Props> = observer(({ application }:
<Text>
You're signed in as <span className='font-bold'>{user?.email}</span>
</Text>
<Button
className='min-w-20 mt-3'
type='normal'
label='Change email'
onClick={() => {
setIsChangeEmailDialogOpen(true);
}}
/>
{appState.enableUnfinishedFeatures && (
<Button
className='min-w-20 mt-3'
type='normal'
label='Change email'
onClick={() => {
setIsChangeEmailDialogOpen(true);
}}
/>
)}
<HorizontalSeparator classes='mt-5 mb-3' />
<div className={'text-input mt-2'}>
Password
Expand Down

0 comments on commit 5b91e41

Please sign in to comment.