From 1307160ccb02f2262bdb8664f9c51050289f82b8 Mon Sep 17 00:00:00 2001
From: HZ991
Date: Tue, 26 Nov 2024 10:09:14 +1100
Subject: [PATCH 1/7] Add: PassCodeReview resend button clears passcode value
---
.../pass-code-view.component.tsx | 24 ++++++++++++++++---
.../pass-code/pass-code.component.tsx | 24 ++++++++++++++++++-
.../components/pass-code/pass-code.types.ts | 1 +
3 files changed, 45 insertions(+), 4 deletions(-)
diff --git a/packages/ui/src/components/pass-code-view/pass-code-view.component.tsx b/packages/ui/src/components/pass-code-view/pass-code-view.component.tsx
index f5c1b364c..25bbba175 100644
--- a/packages/ui/src/components/pass-code-view/pass-code-view.component.tsx
+++ b/packages/ui/src/components/pass-code-view/pass-code-view.component.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { useRef } from 'react';
import { AlertIcon, PadlockIcon } from '../icon/index.js';
import { Button, Link } from '../index.js';
@@ -31,6 +31,13 @@ export function PassCodeView({
...props
}: PassCodeViewProps) {
const styles = passCodeViewStyles({});
+ const passcodeRef = useRef<{ updatePasscode: (code: string) => void }>(null);
+
+ const clearPasscode = () => {
+ if (passcodeRef.current) {
+ passcodeRef.current.updatePasscode('');
+ }
+ };
return (
@@ -54,9 +61,20 @@ export function PassCodeView({
{errorMessage}
)}
-
+
{resendButtonLabel && (
-