Skip to content

Commit 0e7436e

Browse files
committed
🔨 Switch DashboardChangelog to use useOvermind
1 parent 395c3bc commit 0e7436e

File tree

3 files changed

+34
-21
lines changed

3 files changed

+34
-21
lines changed

‎packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.tsx‎

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import React, { FunctionComponent } from 'react';
21
import CSS from 'csstype';
3-
import { useOvermind } from 'app/overmind';
4-
import { Link } from 'react-router-dom';
52
import theme from '@codesandbox/common/lib/theme';
63
import { Button } from '@codesandbox/common/lib/components/Button';
4+
import React, { FunctionComponent } from 'react';
5+
import { Link } from 'react-router-dom';
6+
7+
import { useOvermind } from 'app/overmind';
78

89
// Inline styles because styled-components didn't load the styles
910
const titleStyles: CSS.Properties = {
@@ -53,32 +54,33 @@ export const DashboardChangelog: FunctionComponent = () => {
5354
return (
5455
<div
5556
style={{
56-
padding: '1.5rem',
5757
backgroundColor: theme.background(),
58+
padding: '1.5rem',
5859
}}
5960
>
6061
<div
6162
style={{
62-
marginBottom: '1rem',
63-
display: 'flex',
6463
alignItems: 'center',
64+
display: 'flex',
65+
marginBottom: '1rem',
6566
}}
6667
>
6768
<h1 style={titleStyles}>
6869
What
6970
{"'"}s New
7071
</h1>
72+
7173
<div style={dateStyles}>July 2nd, 2018</div>
7274
</div>
7375

7476
<img
7577
alt="CodeSandbox Announcement"
78+
src="https://cdn-images-1.medium.com/max/1600/1*wIMw31_Phf1WNEP6zjuTUw.png"
7679
style={{
7780
width: '100%',
7881
backgroundColor: 'rgba(0, 0, 0, 0.3)',
7982
borderRadius: 2,
8083
}}
81-
src="https://cdn-images-1.medium.com/max/1600/1*wIMw31_Phf1WNEP6zjuTUw.png"
8284
/>
8385

8486
<p style={descriptionStyles}>
@@ -90,6 +92,7 @@ export const DashboardChangelog: FunctionComponent = () => {
9092
</p>
9193

9294
<h2 style={subTitleStyles}>Dashboard</h2>
95+
9396
<p style={descriptionStyles}>
9497
You can now manage your sandboxes in your own{' '}
9598
<Link to="/dashboard">dashboard</Link>! You
@@ -99,6 +102,7 @@ export const DashboardChangelog: FunctionComponent = () => {
99102
</p>
100103

101104
<h2 style={subTitleStyles}>Create Teams</h2>
105+
102106
<p style={descriptionStyles}>
103107
An extension to the dashboard is <W>teams</W>! You can now create a team
104108
with unlimited members to share sandboxes for collaboration. All
@@ -107,6 +111,7 @@ export const DashboardChangelog: FunctionComponent = () => {
107111
</p>
108112

109113
<h2 style={subTitleStyles}>Free CodeSandbox Live</h2>
114+
110115
<p style={descriptionStyles}>
111116
Teams is not our only feature that allows for collaboration. We also
112117
have <W>real time collaboration</W> with{' '}
@@ -124,6 +129,7 @@ export const DashboardChangelog: FunctionComponent = () => {
124129
</p>
125130

126131
<h2 style={subTitleStyles}>And More</h2>
132+
127133
<p style={descriptionStyles}>
128134
There
129135
{"'"}s a lot more included in this update! Make sure to check out the
@@ -132,23 +138,24 @@ export const DashboardChangelog: FunctionComponent = () => {
132138

133139
<div style={{ display: 'flex' }}>
134140
<Button
135-
style={{ marginTop: '1rem', marginRight: '.25rem' }}
136141
block
137-
small
138-
secondary
139142
onClick={() => modalClosed()}
143+
secondary
144+
small
145+
style={{ marginTop: '1rem', marginRight: '.25rem' }}
140146
>
141147
Close
142148
</Button>
143-
{/*
144-
// @ts-ignore */}
149+
150+
{/*
151+
// @ts-ignore */}
145152
<Button
146-
href="/post/announcing-codesandbox-dashboard-teams"
147-
style={{ marginTop: '1rem', marginLeft: '.25rem' }}
148153
block
154+
href="/post/announcing-codesandbox-dashboard-teams"
155+
rel="noreferrer noopener"
149156
small
157+
style={{ marginLeft: '.25rem', marginTop: '1rem' }}
150158
target="_blank"
151-
rel="noreferrer noopener"
152159
>
153160
View Announcement
154161
</Button>

‎packages/common/src/components/Button/index.tsx‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React from 'react';
1+
import React, { FunctionComponent } from 'react';
2+
23
import { LinkButton, AButton, Button } from './elements';
34

45
export type Props = {
@@ -14,19 +15,24 @@ export type Props = {
1415
danger?: boolean;
1516
secondary?: boolean;
1617
red?: boolean;
18+
target?: string;
19+
rel?: string;
1720
};
1821

19-
function ButtonComponent({ style = {}, ...props }: Props) {
22+
const ButtonComponent: FunctionComponent<Props> = ({
23+
style = {},
24+
...props
25+
}) => {
2026
// Link
2127
if (props.to) {
22-
return <LinkButton style={style} {...props} />;
28+
return <LinkButton {...props} style={style} />;
2329
}
2430

2531
if (props.href) {
26-
return <AButton style={style} {...props} />;
32+
return <AButton {...props} style={style} />;
2733
}
2834

29-
return <Button style={style} {...props} />;
30-
}
35+
return <Button {...props} style={style} />;
36+
};
3137

3238
export { ButtonComponent as Button };

0 commit comments

Comments
 (0)