Files
standardnotes-app-web/app/assets/javascripts/preferences/panes/AccountPreferences.tsx
Gorjan Petrovski b312df41a6 feat(preferences): not logged in segment (#649)
* feat(preferences): not logged in segment

* Update app/assets/javascripts/preferences/panes/account/Authentication.tsx

Co-authored-by: Mo Bitar <mo@standardnotes.org>

* Update app/assets/javascripts/preferences/panes/account/Authentication.tsx

Co-authored-by: Mo Bitar <mo@standardnotes.org>

Co-authored-by: Mo Bitar <mo@standardnotes.org>
2021-09-27 18:01:12 +02:00

41 lines
1.1 KiB
TypeScript

import {
Sync,
SubscriptionWrapper,
Credentials,
LogOutWrapper,
Authentication,
} from '@/preferences/panes/account';
import { PreferencesPane } from '@/preferences/components';
import { observer } from 'mobx-react-lite';
import { WebApplication } from '@/ui_models/application';
import { AppState } from '@/ui_models/app_state';
type Props = {
application: WebApplication;
appState: AppState;
};
export const AccountPreferences = observer(
({ application, appState }: Props) => {
const isLoggedIn = application.getUser();
if (!isLoggedIn) {
return (
<PreferencesPane>
<Authentication application={application} appState={appState} />
<LogOutWrapper application={application} appState={appState} />
</PreferencesPane>
);
}
return (
<PreferencesPane>
<Credentials application={application} />
<Sync application={application} />
<SubscriptionWrapper application={application} />
<LogOutWrapper application={application} appState={appState} />
</PreferencesPane>
);
}
);