diff --git a/packages/kit/src/components/Connect/Connect.tsx b/packages/kit/src/components/Connect/Connect.tsx index 4f24b9d9..47f6e616 100644 --- a/packages/kit/src/components/Connect/Connect.tsx +++ b/packages/kit/src/components/Connect/Connect.tsx @@ -47,7 +47,7 @@ export const Connect = (props: ConnectWalletContentProps) => { const storage = useStorage() // TODO: remove true - const descriptiveSocials = !!config?.signIn?.descriptiveSocials + const descriptiveSocials = !!config?.signIn?.descriptiveSocials || true const [isLoading, setIsLoading] = useState(false) const projectName = config?.signIn?.projectName @@ -205,7 +205,7 @@ export const Connect = (props: ConnectWalletContentProps) => { const showMoreSocialOptions = socialAuthConnectors.length > MAX_ITEM_PER_ROW const showMoreWalletOptions = walletConnectors.length > MAX_ITEM_PER_ROW - const socialConnectorsPerRow = showMoreSocialOptions ? MAX_ITEM_PER_ROW - 1 : socialAuthConnectors.length + const socialConnectorsPerRow = showMoreSocialOptions && !descriptiveSocials ? MAX_ITEM_PER_ROW - 1 : socialAuthConnectors.length const walletConnectorsPerRow = showMoreWalletOptions ? MAX_ITEM_PER_ROW - 1 : walletConnectors.length return ( @@ -239,7 +239,12 @@ export const Connect = (props: ConnectWalletContentProps) => { <> {showSocialConnectorSection && ( - + {socialAuthConnectors.slice(0, socialConnectorsPerRow).map(connector => { return ( diff --git a/packages/kit/src/components/ConnectButton/ConnectButton.tsx b/packages/kit/src/components/ConnectButton/ConnectButton.tsx index f6373a08..56eb72c7 100644 --- a/packages/kit/src/components/ConnectButton/ConnectButton.tsx +++ b/packages/kit/src/components/ConnectButton/ConnectButton.tsx @@ -8,7 +8,7 @@ import { useStorage, useStorageItem } from '../../hooks/useStorage' import { ExtendedConnector, WalletProperties } from '../../types' const BUTTON_HEIGHT = '52px' -const BUTTON_HEIGHT_FULL_WIDTH = '44px' +const BUTTON_HEIGHT_DESCRIPTIVE = '44px' const ICON_SIZE = '8' const getLogo = (theme: any, walletProps: WalletProperties) => @@ -35,16 +35,19 @@ export const ConnectButton = (props: ConnectButtonProps) => { return ( onConnect(connector)} width="full" - style={{ height: BUTTON_HEIGHT_FULL_WIDTH }} + style={{ height: BUTTON_HEIGHT_DESCRIPTIVE }} > - Continue with label + + Continue with {label || walletProps.name} + ) @@ -70,7 +73,7 @@ export const ConnectButton = (props: ConnectButtonProps) => { } export const GoogleWaasConnectButton = (props: ConnectButtonProps) => { - const { connector, onConnect } = props + const { connector, onConnect, isDescriptive = false } = props const storage = useStorage() const [enableGoogleTooltip, setEnableGoogleTooltip] = useState(false) @@ -85,6 +88,68 @@ export const GoogleWaasConnectButton = (props: ConnectButtonProps) => { }, 300) }) + if (isDescriptive) { + return ( + + + + { + if (credentialResponse.credential) { + storage?.setItem(LocalStorageKey.WaasGoogleIdToken, credentialResponse.credential) + onConnect(connector) + } + }} + onError={() => { + console.log('Login Failed') + }} + /> + + + + + + + + ) + } + return (