0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(ui): passing in social connectors as props (#3157)

This commit is contained in:
simeng-li 2023-02-21 10:43:34 +08:00 committed by GitHub
parent b89b5246ab
commit f2e176bbad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -1,16 +1,16 @@
import type { ConnectorMetadata } from '@logto/schemas';
import TermsOfUse from '@/containers/TermsOfUse';
import useSocial from '@/hooks/use-social';
import SocialSignInList from './SocialSignInList';
import * as styles from './index.module.scss';
type Props = {
className?: string;
socialConnectors: ConnectorMetadata[];
};
const SocialSignIn = ({ className }: Props) => {
const { socialConnectors } = useSocial();
const SocialSignIn = ({ className, socialConnectors }: Props) => {
return (
<>
<TermsOfUse className={styles.terms} />

View file

@ -24,7 +24,9 @@ const Register = () => {
{signUpMethods.length > 0 && (
<IdentifierRegisterForm signUpMethods={signUpMethods} className={styles.main} />
)}
{signUpMethods.length === 0 && socialConnectors.length > 0 && <SocialSignIn />}
{signUpMethods.length === 0 && socialConnectors.length > 0 && (
<SocialSignIn className={styles.main} socialConnectors={socialConnectors} />
)}
{
// SignIn footer
signInMode === SignInMode.SignInAndRegister && signInMethods.length > 0 && (

View file

@ -13,7 +13,7 @@ type Props = {
const Main = ({ signInMethods, socialConnectors }: Props) => {
if (signInMethods.length === 0 && socialConnectors.length > 0) {
return <SocialSignIn className={styles.main} />;
return <SocialSignIn className={styles.main} socialConnectors={socialConnectors} />;
}
const isPasswordOnly =