Skip to content

Commit

Permalink
feat: moved passkey login in login methods section
Browse files Browse the repository at this point in the history
  • Loading branch information
Agilulfo1820 committed Feb 3, 2025
1 parent 66f32b2 commit 98e809a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { ActionButton } from '../../Components';
import { GiHouseKeys } from 'react-icons/gi';
import { MdManageAccounts, MdOutlineNavigateNext } from 'react-icons/md';
import { WalletSecuredBy } from '../ConnectionDetails/Components';
import { IoIosFingerPrint } from 'react-icons/io';

type Props = {
setCurrentContent: React.Dispatch<
Expand All @@ -48,11 +47,9 @@ export const EmbeddedWalletContent = ({ setCurrentContent }: Props) => {

const { getConnectionCache } = useCrossAppConnectionCache();

const { darkMode: isDark, privy } = useVeChainKitConfig();
const { darkMode: isDark } = useVeChainKitConfig();
const { connection } = useWallet();

const { linkPasskey } = usePrivy();

const connectionCache = getConnectionCache();

return (
Expand Down Expand Up @@ -202,22 +199,6 @@ export const EmbeddedWalletContent = ({ setCurrentContent }: Props) => {
leftIcon={MdManageAccounts}
rightIcon={MdOutlineNavigateNext}
/>

<ActionButton
title={t('Manage passkey login')}
description={t(
'Enable one click login by adding a passkey to your account.',
)}
onClick={() => {
linkPasskey();
}}
leftIcon={IoIosFingerPrint}
rightIcon={MdOutlineNavigateNext}
isDisabled={
!connection.isConnectedWithSocialLogin ||
!privy?.allowPasskeyLinking
}
/>
</VStack>
</ModalBody>
<ModalFooter w={'full'}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { useTranslation } from 'react-i18next';
import { useState } from 'react';
import { useVeChainKitConfig } from '@/providers';
import { IoIosFingerPrint } from 'react-icons/io';
import { MdOutlineNavigateNext } from 'react-icons/md';

type ConfirmUnlinkProps = {
accountType: string;
Expand Down Expand Up @@ -306,6 +307,19 @@ export const PrivyLinkedAccounts = ({ onBack }: PrivyLinkedAccountsProps) => {
</StickyHeaderContainer>
<ModalBody>
<VStack spacing={3} align="stretch">
<ActionButton
title={t('Handle Passkey Login')}
description={t(
'Enable one click login by adding a passkey to your account.',
)}
onClick={() => {
linkPasskey();
}}
leftIcon={IoIosFingerPrint}
rightIcon={MdOutlineNavigateNext}
isDisabled={!privy?.allowPasskeyLinking}
/>

{canLinkGoogle && (
<ActionButton
title={t('Link Google Account')}
Expand Down
3 changes: 2 additions & 1 deletion packages/vechain-kit/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,6 @@
"Changing your domain name will update also your profile image.": "Changing your domain name will update also your profile image.",
"Manage passkey login": "Manage passkey login",
"This is your main wallet, created by {{element}} and secured by Privy. This wallet is the owner of your smart account, which is used as your identity and as a gateway for your blockchain interactions. Please be sure to keep it safe and backed up.": "This is your main wallet, created by {{element}} and secured by Privy. This wallet is the owner of your smart account, which is used as your identity and as a gateway for your blockchain interactions. Please be sure to keep it safe and backed up.",
"This wallet is the owner of your smart account, which is used as your identity and as a gateway for your blockchain interactions.": "This wallet is the owner of your smart account, which is used as your identity and as a gateway for your blockchain interactions."
"This wallet is the owner of your smart account, which is used as your identity and as a gateway for your blockchain interactions.": "This wallet is the owner of your smart account, which is used as your identity and as a gateway for your blockchain interactions.",
"Handle Passkey Login": "Handle Passkey Login"
}

0 comments on commit 98e809a

Please sign in to comment.