laconic-wallet/components/Dialog.tsx
Adwait Gharpure 96c7fedacf
Show Mnemonic on wallet creation (#25)
* Display mnemonic on wallet creation

* Change srp to mnemonic

* Display mnemonic in a grid

* Remove line

* Make review changes

---------

Co-authored-by: Adw8 <adwait@deepstacksoft.com>
2024-02-19 17:45:31 +05:30

47 lines
1.2 KiB
TypeScript

import React from 'react';
import { View } from 'react-native';
import { Button, Dialog, Portal, Text } from 'react-native-paper';
import styles from '../styles/stylesheet';
import GridView from './Grid';
type CustomDialogProps = {
visible: boolean;
hideDialog: () => void;
contentText: string;
titleText?: string;
};
const DialogComponent: React.FC<CustomDialogProps> = ({
visible,
hideDialog,
contentText,
}) => {
const words = contentText.split(' ');
return (
<Portal>
<Dialog visible={visible} onDismiss={hideDialog}>
<Dialog.Content>
<Text variant="titleLarge">Mnemonic</Text>
<View style={styles.dialogTitle}>
<Text variant="titleMedium">
Your mnemonic provides full access to your wallet and funds. Make
sure to note it down.{' '}
</Text>
<Text variant="titleMedium" style={styles.dialogWarning}>
Do not share your mnemonic with anyone
</Text>
<GridView words={words} />
</View>
</Dialog.Content>
<Dialog.Actions>
<Button onPress={hideDialog}>Done</Button>
</Dialog.Actions>
</Dialog>
</Portal>
);
};
export { DialogComponent };