1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-08 01:15:49 +02:00
unleash.unleash/frontend/src/component/demo/DemoDialog/DemoDialog.tsx
Nuno Góis 2cf6e689ee
feat: add demo guide welcome dialog (#3574)
https://linear.app/unleash/issue/2-923/add-initial-getting-started-dialog

Adds the welcome dialog with the static QR code pointing to our demo
website. Also changes how the run logic works a bit, so that we have
better control over it (only start demo steps once we click the start
button, etc).

Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#3537


![image](https://user-images.githubusercontent.com/14320932/233395897-133edc18-371f-424f-a276-9ca0c9ec5b49.png)
2023-04-20 16:32:26 +01:00

41 lines
1.1 KiB
TypeScript

import { Dialog, IconButton, Typography, styled } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
const StyledDialog = styled(Dialog)(({ theme }) => ({
'& .MuiDialog-paper': {
borderRadius: theme.shape.borderRadiusExtraLarge,
maxWidth: theme.spacing(90),
padding: theme.spacing(7.5),
textAlign: 'center',
},
}));
const StyledCloseButton = styled(IconButton)(({ theme }) => ({
position: 'absolute',
right: theme.spacing(2),
top: theme.spacing(2),
color: theme.palette.neutral.main,
}));
const StyledHeader = styled(Typography)(({ theme }) => ({
fontSize: theme.fontSizes.largeHeader,
fontWeight: theme.fontWeight.bold,
}));
interface IDemoDialogProps {
open: boolean;
onClose: () => void;
children: React.ReactNode;
}
export const DemoDialog = ({ open, onClose, children }: IDemoDialogProps) => (
<StyledDialog open={open} onClose={onClose}>
<StyledCloseButton aria-label="close" onClick={onClose}>
<CloseIcon />
</StyledCloseButton>
{children}
</StyledDialog>
);
DemoDialog.Header = StyledHeader;