b27fa51092
* Chore/browser extension bootstrap (#3257) * init package * set up TS and Webpack * add eslint config * add prettier config * add react and mui theme * add CI * update mui theme version number * Chore/browser extension routes (#3327) * start routes * create layouts * add initial app routes * add initial app pages * add global types * create reuseable components * move password and mnemonic fields to shared react components package * refactor register routes * move client address component to shared package * move components to ui folder * create menu and appbar components * adjust layout components * add readme * use memory router * Feature/nym browser extension login and send (#3373) * init package * set up TS and Webpack * add eslint config * add prettier config * add react and mui theme * add CI * update mui theme version number * Chore/browser extension routes (#3327) * start routes * create layouts * add initial app routes * add initial app pages * add global types * create reuseable components * move password and mnemonic fields to shared react components package * refactor register routes * move client address component to shared package * move components to ui folder * create menu and appbar components * adjust layout components * add readme * use memory router * add extension to mono-repo config * fix webpack build * util functions * add TX type * refactor routes * refactor pages + add send page * add page layout for app pages * set up app context * app components * set up connection config * fix lint errors * Chore/browser extension bootstrap (#3257) * init package * set up TS and Webpack * add eslint config * add prettier config * add react and mui theme * add CI * update mui theme version number * Chore/browser extension routes (#3327) * start routes * create layouts * add initial app routes * add initial app pages * add global types * create reuseable components * move password and mnemonic fields to shared react components package * refactor register routes * move client address component to shared package * move components to ui folder * create menu and appbar components * adjust layout components * add readme * use memory router * add extension to mono-repo config * util functions * add TX type * refactor routes * refactor pages + add send page * add page layout for app pages * set up app context * app components * set up connection config * use fee simulation when sending tokens * use object argument for simulate send api * login validation + fee refinements * use components from shared components lib * add receive modal (#3408) * account storage via wasm * method to get all storage keys * Feature/nym browser extension password encryption (single account) (#3442) * build wasm * reuse components and state for password pages * refactor registration pages * use login with password * import storage as local package * add yarn preinstall script to ts lint gh action * install wasm-pack for CI * use @nym scope for ext storage package * introduced a call to check if database was already initialised (#3465) * introduced a call to check if database was already initialised * use extension storage method to check for db existance --------- Co-authored-by: fmtabbara <fmtabbara@hotmail.co.uk> * introduced mnemonic key existence check (#3462) * Browser extension - Multi-accounts + view mnemonic action (#3488) * add UI for multi-accounts + add view mnemonic for accounts * refactor routes * set up import account * add account to existing wallet * check if account name exists before creating new one * handle password errors * add token to currency conversion * fixed ClientStorageError import path * fix CI * fix CI --------- Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
75 lines
1.6 KiB
TypeScript
75 lines
1.6 KiB
TypeScript
import React from 'react';
|
|
import {
|
|
Breakpoint,
|
|
Paper,
|
|
Dialog,
|
|
DialogActions,
|
|
DialogContent,
|
|
DialogTitle,
|
|
SxProps,
|
|
Typography,
|
|
} from '@mui/material';
|
|
import { Button } from '../Button';
|
|
|
|
export interface ErrorModalProps {
|
|
open: boolean;
|
|
children?: React.ReactNode;
|
|
title: React.ReactNode | string;
|
|
subtitle?: React.ReactNode | string;
|
|
sx?: SxProps;
|
|
fullWidth?: boolean;
|
|
maxWidth?: Breakpoint;
|
|
backdropProps?: object;
|
|
onClose?: () => void;
|
|
}
|
|
|
|
export const ErrorModal = ({
|
|
open,
|
|
onClose,
|
|
children,
|
|
title,
|
|
subtitle,
|
|
sx,
|
|
fullWidth,
|
|
maxWidth,
|
|
backdropProps,
|
|
}: ErrorModalProps) => {
|
|
const Title = (
|
|
<DialogTitle id="responsive-dialog-title" sx={{ pb: 2 }}>
|
|
<Typography variant="body2" fontWeight={600}>
|
|
{title}
|
|
</Typography>
|
|
{subtitle &&
|
|
(typeof subtitle === 'string' ? (
|
|
<Typography fontWeight={400} variant="subtitle1" fontSize={12} sx={{ color: 'grey.400' }}>
|
|
{subtitle}
|
|
</Typography>
|
|
) : (
|
|
subtitle
|
|
))}
|
|
</DialogTitle>
|
|
);
|
|
|
|
return (
|
|
<Dialog
|
|
open={open}
|
|
onClose={onClose}
|
|
aria-labelledby="responsive-dialog-title"
|
|
maxWidth={maxWidth || 'sm'}
|
|
sx={{ textAlign: 'center', ...sx }}
|
|
fullWidth={fullWidth}
|
|
BackdropProps={backdropProps}
|
|
PaperComponent={Paper}
|
|
PaperProps={{ elevation: 0 }}
|
|
>
|
|
{Title}
|
|
<DialogContent>{children}</DialogContent>
|
|
<DialogActions sx={{ px: 3, pb: 3 }}>
|
|
<Button variant="contained" size="large" fullWidth onClick={onClose}>
|
|
Close
|
|
</Button>
|
|
</DialogActions>
|
|
</Dialog>
|
|
);
|
|
};
|