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:
parent
b89b5246ab
commit
f2e176bbad
3 changed files with 8 additions and 6 deletions
|
@ -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} />
|
||||
|
|
|
@ -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 && (
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue