mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(console): display full sign-up and sign-in config in the change alert (#2382)
This commit is contained in:
parent
f64a0f2df4
commit
073870f495
1 changed files with 15 additions and 31 deletions
|
@ -3,7 +3,6 @@ import type { SignInExperience } from '@logto/schemas';
|
|||
import SignInDiffSection from './SignInDiffSection';
|
||||
import SignUpDiffSection from './SignUpDiffSection';
|
||||
import SocialTargetsDiffSection from './SocialTargetsDiffSection';
|
||||
import { isSignInMethodsDifferent, isSignUpDifferent, isSocialTargetsDifferent } from './utilities';
|
||||
|
||||
type Props = {
|
||||
before: SignInExperience;
|
||||
|
@ -11,35 +10,20 @@ type Props = {
|
|||
isAfter?: boolean;
|
||||
};
|
||||
|
||||
const SignUpAndSignInDiffSection = ({ before, after, isAfter = false }: Props) => {
|
||||
const showSignUpDiff = isSignUpDifferent(before.signUp, after.signUp);
|
||||
const showSignInDiff = isSignInMethodsDifferent(before.signIn.methods, after.signIn.methods);
|
||||
const showSocialDiff = isSocialTargetsDifferent(
|
||||
before.socialSignInConnectorTargets,
|
||||
after.socialSignInConnectorTargets
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{showSignUpDiff && (
|
||||
<SignUpDiffSection before={before.signUp} after={after.signUp} isAfter={isAfter} />
|
||||
)}
|
||||
{showSignInDiff && (
|
||||
<SignInDiffSection
|
||||
before={before.signIn.methods}
|
||||
after={after.signIn.methods}
|
||||
isAfter={isAfter}
|
||||
/>
|
||||
)}
|
||||
{showSocialDiff && (
|
||||
<SocialTargetsDiffSection
|
||||
before={before.socialSignInConnectorTargets}
|
||||
after={after.socialSignInConnectorTargets}
|
||||
isAfter={isAfter}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
const SignUpAndSignInDiffSection = ({ before, after, isAfter = false }: Props) => (
|
||||
<>
|
||||
<SignUpDiffSection before={before.signUp} after={after.signUp} isAfter={isAfter} />
|
||||
<SignInDiffSection
|
||||
before={before.signIn.methods}
|
||||
after={after.signIn.methods}
|
||||
isAfter={isAfter}
|
||||
/>
|
||||
<SocialTargetsDiffSection
|
||||
before={before.socialSignInConnectorTargets}
|
||||
after={after.socialSignInConnectorTargets}
|
||||
isAfter={isAfter}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
export default SignUpAndSignInDiffSection;
|
||||
|
|
Loading…
Reference in a new issue