mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
- Added Site settings > Authentication section - Create/edit/delete your custom oauth2 configurations - Login or signup with oauth2
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import * as React from 'react';
|
|
import I18n from 'i18n-js';
|
|
|
|
import Box from '../../common/Box';
|
|
import { AuthenticationPages } from './AuthenticationSiteSettingsP';
|
|
import OAuthForm, { ISiteSettingsOAuthForm } from './OAuthForm';
|
|
import Spinner from '../../common/Spinner';
|
|
import { DangerText } from '../../common/CustomTexts';
|
|
import { IOAuth } from '../../../interfaces/IOAuth';
|
|
|
|
interface Props {
|
|
handleSubmitOAuth(oAuth: IOAuth): void;
|
|
handleUpdateOAuth(id: number, form: ISiteSettingsOAuthForm): void;
|
|
isSubmitting: boolean;
|
|
submitError: string;
|
|
selectedOAuth: IOAuth;
|
|
page: AuthenticationPages;
|
|
setPage: React.Dispatch<React.SetStateAction<AuthenticationPages>>;
|
|
}
|
|
|
|
const AuthenticationFormPage = ({
|
|
handleSubmitOAuth,
|
|
handleUpdateOAuth,
|
|
isSubmitting,
|
|
submitError,
|
|
selectedOAuth,
|
|
page,
|
|
setPage,
|
|
}: Props) => (
|
|
<>
|
|
<Box customClass="authenticationFormPage">
|
|
<OAuthForm
|
|
handleSubmitOAuth={handleSubmitOAuth}
|
|
handleUpdateOAuth={handleUpdateOAuth}
|
|
selectedOAuth={selectedOAuth}
|
|
page={page}
|
|
setPage={setPage}
|
|
/>
|
|
|
|
{ isSubmitting && <Spinner /> }
|
|
{ submitError && <DangerText>{submitError}</DangerText> }
|
|
</Box>
|
|
</>
|
|
);
|
|
|
|
export default AuthenticationFormPage; |