diff --git a/src/components/v2/Icon/icons/check.tsx b/src/components/v2/Icon/icons/check.tsx index 56f44e1672..95ebc56d6d 100644 --- a/src/components/v2/Icon/icons/check.tsx +++ b/src/components/v2/Icon/icons/check.tsx @@ -2,12 +2,18 @@ import * as React from 'react'; import { SVGProps } from 'react'; const SvgCheck = (props: SVGProps) => ( - + diff --git a/src/components/v2/Icon/icons/dots.tsx b/src/components/v2/Icon/icons/dots.tsx new file mode 100644 index 0000000000..799bf5035f --- /dev/null +++ b/src/components/v2/Icon/icons/dots.tsx @@ -0,0 +1,19 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +const SvgDots = (props: SVGProps) => ( + + + + + +); + +export default SvgDots; diff --git a/src/components/v2/Icon/icons/exclamation.tsx b/src/components/v2/Icon/icons/exclamation.tsx new file mode 100644 index 0000000000..cef4c5c2db --- /dev/null +++ b/src/components/v2/Icon/icons/exclamation.tsx @@ -0,0 +1,11 @@ +import * as React from 'react'; +import { SVGProps } from 'react'; + +const SvgExclamation = (props: SVGProps) => ( + + + + +); + +export default SvgExclamation; diff --git a/src/components/v2/Icon/icons/index.ts b/src/components/v2/Icon/icons/index.ts index 60db5a1c20..6685344e0e 100644 --- a/src/components/v2/Icon/icons/index.ts +++ b/src/components/v2/Icon/icons/index.ts @@ -35,6 +35,8 @@ export { default as checkInline } from './checkInline'; export { default as mark } from './mark'; export { default as arrowShaft } from './arrowShaft'; export { default as notice } from './notice'; +export { default as dots } from './dots'; +export { default as exclamation } from './exclamation'; // Coin icons export { default as aave } from './coins/aave'; diff --git a/src/components/v2/VoteProposalUi/index.stories.tsx b/src/components/v2/VoteProposalUi/index.stories.tsx new file mode 100644 index 0000000000..13298f0637 --- /dev/null +++ b/src/components/v2/VoteProposalUi/index.stories.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { withThemeProvider, withCenterStory } from 'stories/decorators'; +import { VoteProposalUi } from '.'; + +export default { + title: 'Components/VoteProposalUi', + decorators: [withThemeProvider, withCenterStory({ width: 600 })], + parameters: { + backgrounds: { + default: 'Default', + }, + }, +}; + +export const Active = () => ; +export const Queued = () => ; +export const ReadyToExecute = () => ; +export const Executed = () => ; +export const Cancelled = () => ; diff --git a/src/components/v2/VoteProposalUi/index.tsx b/src/components/v2/VoteProposalUi/index.tsx new file mode 100644 index 0000000000..ccc7408f64 --- /dev/null +++ b/src/components/v2/VoteProposalUi/index.tsx @@ -0,0 +1,131 @@ +/** @jsxImportSource @emotion/react */ +import React from 'react'; +import Paper from '@mui/material/Paper'; +import Grid from '@mui/material/Grid'; +import Typography from '@mui/material/Typography'; + +import { Icon } from '../Icon'; +import { useStyles } from './styles'; + +type Status = 'active' | 'queued' | 'readyToExecute' | 'executed' | 'cancelled'; + +interface IStatusCard { + status: Status; +} + +const StatusCard: React.FC = ({ status }) => { + const styles = useStyles(); + + switch (status) { + case 'active': + return ( + <> + + stats + + + ); + case 'queued': + return ( + <> +
+ +
+ + Queue + + + ); + case 'readyToExecute': + return ( + <> +
+ +
+ + Ready to execute + + + ); + case 'executed': + return ( + <> +
+ +
+ + Executed + + + ); + default: + case 'cancelled': + return ( + <> +
+ +
+ + Cancelled + + + ); + } +}; + +interface IVoteProposalUiProps { + className?: string; + status: Status; +} + +export const VoteProposalUi: React.FC = ({ className, status }) => { + const styles = useStyles(); + return ( + + + +
+
+ + #57 + + + Active + +
+ + Not voted +
+ + + Buy back and burn and Tokenomic contribution finised soon + + +
+ + Active until: + + 27 Jun 13:54 + + + + + 27h : 13m : 54s + +
+
+ + + +
+
+ ); +}; diff --git a/src/components/v2/VoteProposalUi/styles.ts b/src/components/v2/VoteProposalUi/styles.ts new file mode 100644 index 0000000000..e73e65fb73 --- /dev/null +++ b/src/components/v2/VoteProposalUi/styles.ts @@ -0,0 +1,124 @@ +import { css } from '@emotion/react'; +import { alpha, useTheme } from '@mui/material'; + +export const useStyles = () => { + const theme = useTheme(); + + return { + root: css` + padding-top: 0; + padding-bottom: 0; + ${theme.breakpoints.down('sm')} { + padding-left: 0; + padding-right: 0; + } + `, + gridItem: css` + padding: ${theme.spacing(6, 0)}; + ${theme.breakpoints.down('sm')} { + padding-left: ${theme.spacing(6)}; + padding-right: ${theme.spacing(6)}; + } + `, + gridItemLeft: css` + padding-right: ${theme.spacing(6)}; + display: flex; + flex-direction: column; + justify-content: space-between; + `, + cardHeader: css` + display: flex; + justify-content: space-between; + `, + cardBadges: css` + /* TODO */ + `, + cardBadgeItem: css` + padding: ${theme.spacing(1, 3)}; + background-color: ${theme.palette.secondary.light}; + border-radius: ${theme.shape.borderRadius.small}px; + margin-right: ${theme.spacing(2)}; + `, + cardBadgeNumber: css` + /* TODO */ + `, + cardBadgeActive: css` + background-color: ${alpha(theme.palette.interactive.success as string, 0.1)}; + color: ${theme.palette.interactive.success}; + `, + cardTitle: css` + padding-top: ${theme.spacing(5)}; + padding-bottom: ${theme.spacing(6)}; + `, + cardFooter: css` + display: flex; + justify-content: space-between; + `, + gridItemRight: css` + padding-left: ${theme.spacing(6)}; + border-left: 1px solid ${theme.palette.secondary.light}; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + ${theme.breakpoints.down('sm')} { + flex-direction: row; + border-left: none; + border-top: 1px solid ${theme.palette.secondary.light}; + padding-top: ${theme.spacing(10)}; + padding-bottom: ${theme.spacing(10)}; + } + `, + + /* StatusCard styles */ + statusText: css` + color: ${theme.palette.text.primary}; + text-transform: none; + margin-top: ${theme.spacing(2)}; + text-align: center; + ${theme.breakpoints.down('sm')} { + margin-top: 0; + margin-left: ${theme.spacing(3)}; + } + `, + + iconWrapper: css` + border-radius: 50%; + width: ${theme.shape.iconSize.xxLarge}px; + height: ${theme.shape.iconSize.xxLarge}px; + display: flex; + align-items: center; + justify-content: center; + ${theme.breakpoints.down('sm')} { + width: ${theme.shape.iconSize.xLarge}px; + height: ${theme.shape.iconSize.xLarge}px; + } + `, + iconDotsWrapper: css` + background-color: ${theme.palette.text.secondary}; + `, + iconInfoWrapper: css` + background-color: ${theme.palette.interactive.primary}; + `, + iconMarkWrapper: css` + background-color: ${theme.palette.interactive.success}; + `, + iconCloseWrapper: css` + background-color: ${theme.palette.interactive.error}; + `, + icon: css` + width: ${theme.shape.iconSize.medium}px; + height: ${theme.shape.iconSize.medium}px; + color: white; + ${theme.breakpoints.down('sm')} { + width: ${theme.shape.iconSize.small}px; + height: ${theme.shape.iconSize.small}px; + } + `, + iconCheck: css` + background-color: ${theme.palette.interactive.success}; + border-radius: 50%; + stroke-width: ${theme.spacing(0.5)}; + `, + }; +}; diff --git a/src/theme/MuiThemeProvider/muiTheme.ts b/src/theme/MuiThemeProvider/muiTheme.ts index 4af6e95e82..4d364f5cd0 100644 --- a/src/theme/MuiThemeProvider/muiTheme.ts +++ b/src/theme/MuiThemeProvider/muiTheme.ts @@ -88,9 +88,11 @@ export const SHAPE = { large: SPACING * 6, } as any, // our custom types seem to clash with the default MUI types iconSize: { + small: SPACING * 3, medium: SPACING * 4, large: SPACING * 5, xLarge: SPACING * 6, + xxLarge: SPACING * 10, }, footerHeight: '56px', bannerHeight: '56px', diff --git a/src/types/mui.d.ts b/src/types/mui.d.ts index 53e3e5cd6a..ea0bd9b83a 100644 --- a/src/types/mui.d.ts +++ b/src/types/mui.d.ts @@ -45,9 +45,11 @@ declare module '@mui/material/styles' { large: number; }; iconSize: { + small: number; medium: number; large: number; xLarge: number; + xxLarge: number; }; footerHeight: string; bannerHeight: string;