diff --git a/webapp/src/components/Inputs/styles.ts b/webapp/src/components/Inputs/styles.ts index cd1da2c..419e00f 100644 --- a/webapp/src/components/Inputs/styles.ts +++ b/webapp/src/components/Inputs/styles.ts @@ -31,6 +31,7 @@ export const useButtonStyles = createAppUseStyles<{}>(theme => ({ ...commonInputStyle(theme).input, paddingTop: '2%', paddingBottom: '2%', + cursor: 'pointer', }, })); diff --git a/webapp/src/components/Modal/index.stories.tsx b/webapp/src/components/Modal/index.stories.tsx new file mode 100644 index 0000000..5d23799 --- /dev/null +++ b/webapp/src/components/Modal/index.stories.tsx @@ -0,0 +1,33 @@ +import React from "react"; +import { ComponentMeta, ComponentStory } from '@storybook/react'; +import { Modal } from "."; +import { useState } from 'react'; +import { Button } from "components/Inputs/Button"; + + +export default { + title: 'Modal', + component: Modal, + parameters: { actions: { argTypesRegex: '^on.*' } }, + args: { + open: true + } +} as ComponentMeta + +export const Simple: ComponentStory = args => { + return <> + +
Hello World!
+
+ +} +export const WithButtons: ComponentStory = args => { + const [open, setOpen] = useState(false); + return <> + + +
Hello World!
+ +
+ +} diff --git a/webapp/src/components/Modal/index.tsx b/webapp/src/components/Modal/index.tsx new file mode 100644 index 0000000..4e29902 --- /dev/null +++ b/webapp/src/components/Modal/index.tsx @@ -0,0 +1,59 @@ +import { FC } from "react"; +import { createAppUseStyles } from "styles/theme"; +import Color from 'chroma-js'; + +export interface ModalStyleProps { + open: boolean; +} +export interface Props extends ModalStyleProps { +} +const useModalStyle = createAppUseStyles(theme => ({ + root: ({ open }) => ({ + display: open ? 'flex' : 'none', + justifyContent: 'center', + alignItems: 'center', + zIndex: open ? 10 : -1, + position: 'absolute', + height: '100vh', + width: '100vw', + top: 0, + left: 0, + }), + background: { + zIndex: 5, + position: 'absolute', + height: '100vh', + width: '100vw', + top: 0, + left: 0, + backgroundColor: Color(theme.secondary).alpha(0.5).hex(), + }, + inner: { + zIndex: 10, + maxWidth: '80%', + maxHeight: '60%', + minHeight: '200px', + minWidth: '200px', + padding: '15px', + display: 'flex', + flexDirection: 'column', + backgroundColor: theme.primary, + borderSize: '1px', + borderStyle: 'solid', + borderColor: theme.primaryAccent, + borderRadius: '10px', + color: theme.primaryAccent, + } +})); +export const Modal: FC = ({ + children, + ...props +}) => { + const { classes } = useModalStyle(props); + return
+
+
+ {children} +
+
+}