feat: onboarding pre-work
This commit is contained in:
@@ -11,14 +11,12 @@ interface DeleteAccountModalProps {
|
||||
}
|
||||
|
||||
export const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({ isOpen, onClose }) => {
|
||||
const [password, setPassword] = useState('');
|
||||
const [confirmationText, setConfirmationText] = useState('');
|
||||
const requestDeletionMutation = useRequestDeletion();
|
||||
|
||||
// Clear form when modal closes
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
setPassword('');
|
||||
setConfirmationText('');
|
||||
}
|
||||
}, [isOpen]);
|
||||
@@ -26,15 +24,15 @@ export const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({ isOpen,
|
||||
if (!isOpen) return null;
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!password || confirmationText !== 'DELETE') {
|
||||
if (confirmationText !== 'DELETE') {
|
||||
return;
|
||||
}
|
||||
|
||||
await requestDeletionMutation.mutateAsync({ password, confirmationText });
|
||||
await requestDeletionMutation.mutateAsync({ confirmationText });
|
||||
onClose();
|
||||
};
|
||||
|
||||
const isValid = password.length > 0 && confirmationText === 'DELETE';
|
||||
const isValid = confirmationText === 'DELETE';
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">
|
||||
@@ -50,23 +48,6 @@ export const DeleteAccountModal: React.FC<DeleteAccountModalProps> = ({ isOpen,
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Password Input */}
|
||||
<div className="mb-4">
|
||||
<label className="block text-sm font-medium text-slate-700 mb-1">
|
||||
Password
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
placeholder="Enter your password"
|
||||
className="w-full px-3 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-red-500 focus:border-red-500"
|
||||
style={{ fontSize: '16px', minHeight: '44px' }}
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
<p className="text-xs text-slate-500 mt-1">Enter your password to confirm</p>
|
||||
</div>
|
||||
|
||||
{/* Confirmation Input */}
|
||||
<div className="mb-6">
|
||||
<label className="block text-sm font-medium text-slate-700 mb-1">
|
||||
|
||||
Reference in New Issue
Block a user