Skip to content

Commit

Permalink
fix titles
Browse files Browse the repository at this point in the history
  • Loading branch information
zerts committed Jul 25, 2024
1 parent d392bb0 commit 3ab5b56
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 30 deletions.
28 changes: 13 additions & 15 deletions src/ui/components/SignMessageButton/SignMessageButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,13 @@ export const SignMessageButton = React.forwardRef(function SignMessageButton(

const title = buttonTitle || 'Sign';

const successTitle = (
<HStack gap={4} alignItems="center">
<CheckIcon
style={{
width: 20,
height: 20,
color: 'var(--positive-500)',
}}
/>
<span>Signed</span>
</HStack>
);

return isDeviceAccount(wallet) ? (
<HardwareSignMessage
ref={hardwareSignRef}
derivationPath={wallet.derivationPath}
isSigning={isLoading}
children={children}
buttonTitle={isSuccess ? successTitle : buttonTitle}
buttonTitle={isSuccess ? 'Signed' : buttonTitle}
buttonKind={buttonKind}
onClick={onClick}
disabled={disabled}
Expand All @@ -142,7 +129,18 @@ export const SignMessageButton = React.forwardRef(function SignMessageButton(
holdToSign ? (
<HoldableButton
text={`Hold to ${title}`}
successText={successTitle}
successText={
<HStack gap={4} alignItems="center">
<CheckIcon
style={{
width: 20,
height: 20,
color: 'var(--positive-500)',
}}
/>
<span>Signed</span>
</HStack>
}
submittingText="Sending..."
onClick={handleClick}
success={isSuccess}
Expand Down
28 changes: 13 additions & 15 deletions src/ui/components/SignTransactionButton/SignTransactionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,6 @@ export const SignTransactionButton = React.forwardRef(
const disabled = isLoading || sendTxMutation.isSuccess || disabledAttr;
const title = buttonTitle || 'Confirm';

const successTitle = (
<HStack gap={4} alignItems="center">
<CheckIcon
style={{
width: 20,
height: 20,
color: 'var(--positive-500)',
}}
/>
<span>Sent</span>
</HStack>
);

return isDeviceAccount(wallet) ? (
<HardwareSignTransaction
ref={hardwareSignRef}
Expand All @@ -106,7 +93,7 @@ export const SignTransactionButton = React.forwardRef(
children={children}
buttonTitle={
sendTxMutation.isSuccess
? successTitle
? 'Sent'
: isLoadingProp
? 'Preparing...'
: buttonTitle
Expand All @@ -124,7 +111,18 @@ export const SignTransactionButton = React.forwardRef(
return holdToSign ? (
<HoldableButton
text={`Hold to ${title}`}
successText={successTitle}
successText={
<HStack gap={4} alignItems="center">
<CheckIcon
style={{
width: 20,
height: 20,
color: 'var(--positive-500)',
}}
/>
<span>Sent</span>
</HStack>
}
submittingText="Sending..."
onClick={handleClick}
success={sendTxMutation.isSuccess}
Expand Down

0 comments on commit 3ab5b56

Please sign in to comment.