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
-
-
July 2nd, 2018
-
+
+
+
July 2nd, 2018
+
-
-
+
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.
-
+
-
+
modalClosed()}
+ secondary
+ small
+ style={{ marginRight: '.25rem' }}
>
Close
- {/*
- // @ts-ignore */}
+
+ {/*
+ // @ts-ignore */}
View Announcement
-
-
+
+
);
};
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 ;
-}
+ return ;
+};
-export { ButtonComponent as Button, styles as buttonStyles };
+export { Button, styles as buttonStyles };
diff --git a/packages/common/src/components/Modal/Modal.tsx b/packages/common/src/components/Modal/Modal.tsx
index dd32e3f8fec..883d09f2298 100644
--- a/packages/common/src/components/Modal/Modal.tsx
+++ b/packages/common/src/components/Modal/Modal.tsx
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, { ComponentProps } from 'react';
import {
useDialogState,
DialogDisclosure,
@@ -6,10 +6,10 @@ import {
Dialog,
} from 'reakit/Dialog';
import { Portal } from 'reakit/Portal';
-import { Button, IButtonProps } from '../Button';
+import { Button } from '../Button';
import { Backdrop, Container } from './elements';
-export interface IModalProps extends IButtonProps {
+export interface IModalProps extends ComponentProps {
label?: string;
button?: React.ElementType;
backdrop?: React.ElementType;
diff --git a/packages/common/src/components/MultiAction/elements.ts b/packages/common/src/components/MultiAction/elements.ts
index a2532505966..d409dd4706b 100644
--- a/packages/common/src/components/MultiAction/elements.ts
+++ b/packages/common/src/components/MultiAction/elements.ts
@@ -1,15 +1,19 @@
-import styled, { css } from 'styled-components';
+import { ComponentProps } from 'react';
+import { Button as ReakitButton } from 'reakit/Button';
import { Group } from 'reakit/Group';
-import { Button } from 'reakit/Button';
import { Menu, MenuItem, MenuDisclosure } from 'reakit/Menu';
-import { IButtonProps, buttonStyles } from '../Button';
+import styled, { css } from 'styled-components';
+
+import { Button, buttonStyles } from '../Button';
export const Container = styled(Group)`
position: relative;
display: flex;
`;
-export const PrimaryAction = styled(Button)`
+export const PrimaryAction = styled(ReakitButton)<
+ ComponentProps
+>`
${({ block }) => css`
${buttonStyles};
justify-content: center;
@@ -21,7 +25,9 @@ export const PrimaryAction = styled(Button)`
`}
`;
-export const ToggleActionsList = styled(MenuDisclosure)`
+export const ToggleActionsList = styled(MenuDisclosure)<
+ ComponentProps
+>`
${buttonStyles};
justify-content: center;
width: 32px;
diff --git a/packages/common/src/components/ProgressButton/index.tsx b/packages/common/src/components/ProgressButton/index.tsx
index 588afc76a9a..345f70a4fc8 100644
--- a/packages/common/src/components/ProgressButton/index.tsx
+++ b/packages/common/src/components/ProgressButton/index.tsx
@@ -1,14 +1,13 @@
-import React from 'react';
-import { Button, IButtonProps } from '../Button';
+import React, { ComponentProps, FunctionComponent } from 'react';
+import { Button } from '../Button';
import { Wrapper, Loader } from './elements';
-interface IProgressButtonProps extends IButtonProps {
+type Props = ComponentProps & {
loading?: boolean;
-}
-
-const ProgressButton: React.FC = ({
- loading = false,
+};
+const ProgressButton: FunctionComponent = ({
disabled = false,
+ loading = false,
...props
}) => (