diff --git a/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/Helmet.js b/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/Helmet.tsx similarity index 100% rename from packages/app/src/app/pages/common/Modals/Changelog/Dashboard/Helmet.js rename to packages/app/src/app/pages/common/Modals/Changelog/Dashboard/Helmet.tsx diff --git a/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/elements.ts b/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/elements.ts new file mode 100644 index 00000000000..c57b18b2cda --- /dev/null +++ b/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/elements.ts @@ -0,0 +1,68 @@ +import { Button as ButtonBase } from '@codesandbox/common/lib/components/Button'; +import styled, { css } from 'styled-components'; + +export const Button = styled(ButtonBase)` + margin-top: 1rem; +`; + +export const ButtonContainer = styled.div` + display: flex; +`; + +export const Container = styled.div` + ${({ theme }) => css` + background-color: ${theme.background()}; + padding: 1.5rem; + `}; +`; + +export const Date = styled.div` + color: rgba(255, 255, 255, 0.5); + font-size: 0.875rem; + float: right; + width: 100%; + text-align: right; +`; + +export const Description = styled.p` + line-height: 1.6; + color: rgba(255, 255, 255, 0.7); + font-weight: 600; + font-size: 0.875rem; + margin-top: 0.5rem; + margin-bottom: 0; +`; + +export const Image = styled.img` + background-color: rgba(0, 0, 0, 0.3); + border-radius: 2px; + width: 100%; +`; + +export const SubTitle = styled.h2` + font-weight: 600; + color: rgba(255, 255, 255, 0.9); + font-size: 1rem; + margin-top: 1rem; + margin-bottom: 0; +`; + +export const Title = styled.h1` + font-weight: 600; + color: rgba(255, 255, 255, 0.9); + font-size: 1.125rem; + margin-top: 0; + margin-bottom: 0; + width: 100%; + text-transform: uppercase; +`; + +export const TitleContainer = styled.div` + align-items: center; + display: flex; + margin-bottom: 1rem; +`; + +export const White = styled.span` + color: #ffffff; +`; diff --git a/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.tsx b/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.tsx index 6f4d42b405a..93de3e693a6 100644 --- a/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.tsx +++ b/packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.tsx @@ -1,49 +1,20 @@ import React, { FunctionComponent } from 'react'; -import CSS from 'csstype'; -import { useOvermind } from 'app/overmind'; import { Link } from 'react-router-dom'; -import theme from '@codesandbox/common/lib/theme'; -import { Button } from '@codesandbox/common/lib/components/Button'; - -// Inline styles because styled-components didn't load the styles -const titleStyles: CSS.Properties = { - fontWeight: 600, - color: 'rgba(255, 255, 255, 0.9)', - fontSize: '1.125rem', - marginTop: 0, - marginBottom: 0, - width: '100%', - textTransform: 'uppercase', -}; - -const dateStyles: CSS.Properties = { - color: 'rgba(255, 255, 255, 0.5)', - fontSize: '.875rem', - float: 'right', - width: '100%', - textAlign: 'right', -}; - -const subTitleStyles: CSS.Properties = { - fontWeight: 600, - color: 'rgba(255, 255, 255, .9)', - fontSize: '1rem', - marginTop: '1rem', - marginBottom: 0, -}; -const descriptionStyles: CSS.Properties = { - lineHeight: 1.6, - color: 'rgba(255, 255, 255, 0.7)', - fontWeight: 600, - fontSize: '.875rem', - marginTop: '.5rem', - marginBottom: 0, -}; +import { useOvermind } from 'app/overmind'; -const W: FunctionComponent = props => ( - -); +import { + Button, + ButtonContainer, + Container, + Date, + Description, + Image, + SubTitle, + Title, + TitleContainer, + White, +} from './elements'; export const DashboardChangelog: FunctionComponent = () => { const { @@ -51,65 +22,54 @@ export const DashboardChangelog: FunctionComponent = () => { } = useOvermind(); return ( -
-
-

+ + + What {"'"}s New - </h1> - <div style={dateStyles}>July 2nd, 2018</div> - </div> + + + July 2nd, 2018 + - CodeSandbox Announcement -

+ We {"'"} re back with a new update! This update is very focused on{' '} - collaboration and organization. Let + collaboration and organization. Let {"'"}s take a look! -

+ -

Dashboard

-

+ Dashboard + + You can now manage your sandboxes in your own{' '} dashboard! You {"'"} - re able to filter, sort, search, delete, create and update{' '} - multiple sandboxes at the same time. The possibilities are endless! -

- -

Create Teams

-

- An extension to the dashboard is teams! You can now create a team - with unlimited members to share sandboxes for collaboration. All - sandboxes automatically sync using live collaboration between - team members. -

- -

Free CodeSandbox Live

-

+ re able to{' '} + filter, sort, search, delete, create and update multiple + sandboxes at the same time. The possibilities are endless! + + + Create Teams + + + An extension to the dashboard is teams! You can now + create a team with unlimited members to share sandboxes for + collaboration. All sandboxes automatically sync using{' '} + live collaboration between team members. + + + Free CodeSandbox Live + + Teams is not our only feature that allows for collaboration. We also - have real time collaboration with{' '} + have real time collaboration with{' '} CodeSandbox Live @@ -120,39 +80,41 @@ export const DashboardChangelog: FunctionComponent = () => { subscription, but we {"'"} re happy to announce that{' '} - CodeSandbox Live is from now on free for everyone! -

+ CodeSandbox Live is from now on free for everyone! + + + And More -

And More

-

+ There {"'"}s a lot more included in this update! Make sure to check out the announcement post to find out more about this update. -

+ -
+ - {/* - // @ts-ignore */} + + {/* + // @ts-ignore */} -
-

+ + ); }; diff --git a/packages/common/src/components/Button/elements.tsx b/packages/common/src/components/Button/elements.tsx index 758453b481a..1dd84b8c9fa 100644 --- a/packages/common/src/components/Button/elements.tsx +++ b/packages/common/src/components/Button/elements.tsx @@ -1,11 +1,13 @@ -import React from 'react'; -import styled, { css } from 'styled-components'; +import React, { ComponentProps } from 'react'; import { Link } from 'react-router-dom'; -import { Button as ReakitButton } from 'reakit/Button'; +import { Button as ReakitButtonBase } from 'reakit/Button'; +import styled, { css } from 'styled-components'; + import theme from '../../theme'; -import { IButtonProps } from '.'; import { withoutProps } from '../../utils'; +import { Button } from '.'; + export type OptionProps = { theme: any; disabled?: boolean; @@ -102,7 +104,7 @@ const getBorder = ({ return '2px solid #66B9F4'; }; -export const styles = css` +export const styles = css | any>` transition: 0.3s ease all; font-family: Poppins, Roboto, sans-serif; @@ -160,6 +162,6 @@ export const LinkButton = styled(withoutProps(`small`)(Link))` export const AButton = styled(withoutProps(`small`)(props => ))` ${styles}; `; -export const Button = styled(withoutProps(`small`)(ReakitButton))` +export const ReakitButton = styled(withoutProps(`small`)(ReakitButtonBase))` ${styles} `; diff --git a/packages/common/src/components/Button/index.tsx b/packages/common/src/components/Button/index.tsx index cc1755a51c6..343d0cc9572 100644 --- a/packages/common/src/components/Button/index.tsx +++ b/packages/common/src/components/Button/index.tsx @@ -1,7 +1,8 @@ -import React from 'react'; -import { LinkButton, AButton, Button, styles } from './elements'; +import React, { FunctionComponent } from 'react'; -export interface IButtonProps { +import { LinkButton, AButton, ReakitButton, styles } from './elements'; + +type Props = { to?: string; href?: string; big?: boolean; @@ -9,7 +10,6 @@ export interface IButtonProps { style?: React.CSSProperties; block?: boolean; onClick?: (event: React.MouseEvent) => void; - children?: React.ReactNode; disabled?: boolean; type?: 'button' | 'reset' | 'submit'; danger?: boolean; @@ -17,21 +17,18 @@ export interface IButtonProps { red?: boolean; target?: string; rel?: string; -} - -function ButtonComponent({ style = {}, ...props }: IButtonProps) { +}; +const Button: FunctionComponent = ({ style = {}, ...props }) => { // Link if (typeof props.to === 'string') { - return ; + return ; } if (props.href) { - // @ts-ignore - return ; + return ; } - // @ts-ignore - return