Skip to main content

Delete Account Button

A secure delete account component that provides user account deletion functionality with confirmation modal and proper error handling.

Getting Started​

Basic Usage​

The simplest way to implement account deletion:

import { DeleteAccountButton } from "@ovok/native";
import React from "react";

const BasicDeleteAccount = () => {
return <DeleteAccountButton />;
};

export default BasicDeleteAccount;

Features​

  • Confirmation Modal: Built-in confirmation dialog to prevent accidental deletion
  • Scheduled Deletion: Schedules a full medical-data wipe after a fixed 30-day grace period
  • Error Handling: Comprehensive error handling with callback support
  • Theme Integration: Consistent styling with your app theme
  • Icon Integration: Uses profile delete icon with error color
  • Auto Logout: Clears the local active login session immediately after scheduling
  • TypeScript: Full type safety throughout

Props​

Extends all SettingListItemProps with additional delete-specific functionality.

PropTypeDefaultDescription
titlestring"settings.delete-account" translationCustom button title
onSuccess() => voidundefinedCalled when account deletion succeeds
onError(error: Error) => voidundefinedCalled when account deletion fails
onPress() => voidundefinedCalled when button is pressed (before modal)

Inherited Props​

All props from SettingListItem are supported:

  • style - Custom styling
  • testID - Test identifier
  • disabled - Disable the button
  • description - Additional description text
  • And all other SettingListItemProps

Localization​

The component uses these translation keys:

{
"settings": {
"delete-account": "Delete Account",
"delete-account-confirmation": "Are you sure you want to schedule deletion of your account? Your data will be permanently deleted after 30 days."
},
"common": {
"cancel": "Cancel",
"delete": "Delete"
}
}
  • Logout Button - Simple session termination without account deletion
  • Profile Form - User account management and editing
  • Sign-In - User authentication (needed after account recovery)