From 37c1adcb81785bfdcf830d025455480168967cc9 Mon Sep 17 00:00:00 2001 From: QueenColly Date: Sat, 29 Aug 2026 11:24:06 +0100 Subject: [PATCH] fix(ui): clear KMS settings when toggling to Public privacy mode --- .../components/steps/SPVPrivacyStep.tsx | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 frontend/features/verification/components/steps/SPVPrivacyStep.tsx diff --git a/frontend/features/verification/components/steps/SPVPrivacyStep.tsx b/frontend/features/verification/components/steps/SPVPrivacyStep.tsx new file mode 100644 index 0000000..9c227f3 --- /dev/null +++ b/frontend/features/verification/components/steps/SPVPrivacyStep.tsx @@ -0,0 +1,56 @@ +// frontend/features/verification/components/steps/SPVPrivacyStep.tsx + +import React from 'react'; + +export const SPVPrivacyStep = ({ formData, setFormData }) => { + const handlePrivacyToggle = (mode: 'public' | 'kms') => { + if (mode === 'public') { + // 🎯 Fix: Explicitly clear KMS specific settings when switching to Public + setFormData((prev) => ({ + ...prev, + privacyMode: 'public', + kmsProvider: '', + kmsKeyId: '', + kmsRegion: '', + })); + } else { + setFormData((prev) => ({ + ...prev, + privacyMode: 'kms', + })); + } + }; + + return ( +
+ {/* Example Toggle UI */} + + + + {/* KMS Settings conditionally rendered */} + {formData.privacyMode === 'kms' && ( +
+ {/* KMS Inputs here */} +
+ )} +
+ ); +}; \ No newline at end of file