-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1251 from multiversx/development
v2.39.0
- Loading branch information
Showing
37 changed files
with
525 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './SignWithIframeModal'; |
1 change: 0 additions & 1 deletion
1
src/UI/SignTransactionsModals/SignWithMetamaskProxyModal/index.tsx
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
src/UI/SignTransactionsModals/SignWithPasskeyModal/SignWithPasskeyModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { SignModalPropsType } from 'types'; | ||
|
||
import { | ||
SignWaitingScreenModal, | ||
SignWaitingScreenModalPropsType | ||
} from '../components'; | ||
|
||
export const SignWithPasskeyModal = (props: SignModalPropsType) => { | ||
const description = props.error | ||
? props.error | ||
: props.transactions?.length > 1 | ||
? 'Please signin with your passkey in order to sign the transactions' | ||
: 'Please signin with your passkey in order to sign the transaction'; | ||
|
||
const waitingScreenProps: SignWaitingScreenModalPropsType = { | ||
...props, | ||
description, | ||
title: 'Confirm by signing in with passkey' | ||
}; | ||
|
||
return <SignWaitingScreenModal {...waitingScreenProps} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './SignWithPasskeyModal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './IframeButton'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { withStyles, WithStylesImportType } from 'hocs/withStyles'; | ||
|
||
import { usePasskeyLogin } from 'hooks/login/usePasskeyLogin'; | ||
import { getIsNativeAuthSingingForbidden } from 'services/nativeAuth/helpers'; | ||
import { LoginButton } from 'UI/LoginButton/LoginButton'; | ||
import { OnProviderLoginType } from '../../../types'; | ||
import { WithClassnameType } from '../../types'; | ||
|
||
export interface PasskeyLoginButtonPropsType | ||
extends WithClassnameType, | ||
OnProviderLoginType { | ||
children?: ReactNode; | ||
buttonClassName?: string; | ||
loginButtonText?: string; | ||
disabled?: boolean; | ||
} | ||
|
||
const PasskeyLoginButtonComponent: ( | ||
props: PasskeyLoginButtonPropsType & WithStylesImportType | ||
) => JSX.Element = ({ | ||
token, | ||
className = 'dapp-passkey-login', | ||
children, | ||
callbackRoute, | ||
buttonClassName = 'dapp-default-login-button', | ||
nativeAuth, | ||
loginButtonText = 'Passkey', | ||
onLoginRedirect, | ||
disabled | ||
}) => { | ||
const [onInitiateLogin] = usePasskeyLogin({ | ||
callbackRoute, | ||
token, | ||
onLoginRedirect, | ||
nativeAuth | ||
}); | ||
const disabledConnectButton = getIsNativeAuthSingingForbidden(token); | ||
|
||
const handleLogin = () => { | ||
onInitiateLogin(); | ||
}; | ||
|
||
return ( | ||
<LoginButton | ||
onLogin={handleLogin} | ||
className={className} | ||
btnClassName={buttonClassName} | ||
text={loginButtonText} | ||
disabled={disabled || disabledConnectButton} | ||
> | ||
{children} | ||
</LoginButton> | ||
); | ||
}; | ||
|
||
export const PasskeyLoginButton = withStyles(PasskeyLoginButtonComponent, { | ||
ssrStyles: () => | ||
import( | ||
'UI/extension/ExtensionLoginButton/extensionLoginButton.styles.scss' | ||
), | ||
clientStyles: () => | ||
require('UI/extension/ExtensionLoginButton/extensionLoginButton.styles.scss') | ||
.default | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './PasskeyLoginButton'; |
19 changes: 19 additions & 0 deletions
19
src/UI/passkey/PasskeyLoginButton/passkeyLoginButton.styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.passkey-login { | ||
box-sizing: border-box; | ||
} | ||
|
||
.login-text { | ||
box-sizing: border-box; | ||
} | ||
|
||
.no-passkey-button-wrapper { | ||
box-sizing: border-box; | ||
} | ||
|
||
.nopasskeyButtonContent { | ||
box-sizing: border-box; | ||
} | ||
|
||
.no-passkey-button-title { | ||
box-sizing: border-box; | ||
} |
Oops, something went wrong.