Files
nym/explorer-nextjs/src/components/modal/SimpleModal.tsx
T
Fouad c45492cdc8 Feature/explorer v2 connect wallet (#5301)
* set up libs for connecting wallet

* wallet - get address and balance

* format wallet balance

* start staking modal work

* Yana/node page (#5276)

* Add nym-node page api WIP

* nym-node page api WIP

* Add rewards card

* Add account balances

* fix build

* Add USD price to tokenomics card

* fix build

* fix build

* fix build

* Refactor ProgressBar

* Add profile card

* fix build

* replace hardcoded id

* Add build version and node roles

* fix build

* rename id param to address

* add node table to explorer page

* get node details from unstable endpoint + layout updates

* allow node select from table

* stop propogation on favorite/unfavorite

* update self bond data

* card refactors

* revert node engine requirement

* use node v20

---------

Co-authored-by: Yana <yanok87@users.noreply.github.com>
Co-authored-by: fmtabbara <fmtabbara@hotmail.co.uk>

* set up libs for connecting wallet

* wallet - get address and balance

* update typings + refactor favorite component

* fix event propogation

* fix multiple url declarations

* move pages to pages directory

* build staking page and base components

* refactor wallet components and add useNymClient hook

* enhance DesktopHeader to highlight active menu item with icon

* remove StakeModal and getNymNodes components

* refactor NodeTable and NodeTableWithAction components for improved staking functionality

* refactor API configuration and theme styles for improved maintainability

* refactor Loading component to implement LoadingModal with enhanced styling and functionality

* add InfoModal component for displaying informational messages with customizable actions

* fix type

* fix linting

* update CI workflow to use Node.js 20

* add explorer package to dependencies in package.json

* fix mui grid2 build errors

* fix full page reload

* fix unstaking

* fix delegation operation

* fix up workspace packages

* refactor staking and wallet components for improved functionality and readability

* fix undelegation (again)

* update ci to include new explorer

* update wallet ci node version

* remove logs

---------

Co-authored-by: Yana Matrosova <42305364+yanok87@users.noreply.github.com>
Co-authored-by: Yana <yanok87@users.noreply.github.com>
2024-12-30 22:19:13 +00:00

54 lines
1.2 KiB
TypeScript

import Cross from "@/components/icons/Cross";
import {
Dialog,
DialogActions,
DialogContent,
IconButton,
Stack,
Typography,
} from "@mui/material";
type SimpleModalPropsClosed = {
open: false;
};
type SimpleModalPropsOpen = {
open: true;
title: string;
children?: React.ReactNode;
Actions?: React.ReactNode;
onClose: () => void;
};
export type SimpleModalProps = SimpleModalPropsClosed | SimpleModalPropsOpen;
const SimpleModal = (props: SimpleModalProps) => {
if (!props.open) {
return null;
}
const { title, children, Actions, onClose } = props;
return (
<Dialog open maxWidth="sm" fullWidth onClose={onClose}>
<Stack
direction="row"
justifyContent="space-between"
alignItems="center"
sx={{ p: 4 }}
>
<Typography variant="body1" sx={{ textTransform: "uppercase" }}>
{title}
</Typography>
<IconButton aria-label="close" size="large" onClick={onClose}>
<Cross />
</IconButton>
</Stack>
<DialogContent sx={{ p: 4, pt: 0 }}>{children}</DialogContent>
<DialogActions sx={{ px: 4, pb: 4 }}>{Actions}</DialogActions>
</Dialog>
);
};
export default SimpleModal;