Skip to content

Commit ae4513e

Browse files
NabeelahYSaraVieira
authored andcommitted
🔨 Refactored 🧠 Overmind Hacktober | /app/pages/common/Modals/Changelog/Dashboard/index.js (codesandbox#2664)
* Refactor /app/pages/common/Modals/Changelog/Dashboard/index.js * Remove export default
1 parent 261a71b commit ae4513e

File tree

1 file changed

+19
-15
lines changed
  • packages/app/src/app/pages/common/Modals/Changelog/Dashboard

1 file changed

+19
-15
lines changed

packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.js renamed to packages/app/src/app/pages/common/Modals/Changelog/Dashboard/index.tsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from 'react';
2-
import { inject, hooksObserver } from 'app/componentConnectors';
1+
import React, { FunctionComponent } from 'react';
2+
import CSS from 'csstype';
3+
import { useOvermind } from 'app/overmind';
34
import { Link } from 'react-router-dom';
45
import theme from '@codesandbox/common/lib/theme';
5-
66
import { Button } from '@codesandbox/common/lib/components/Button';
77

88
// Inline styles because styled-components didn't load the styles
9-
const titleStyles = {
9+
const titleStyles: CSS.Properties = {
1010
fontWeight: 600,
1111
color: 'rgba(255, 255, 255, 0.9)',
1212
fontSize: '1.125rem',
@@ -16,23 +16,23 @@ const titleStyles = {
1616
textTransform: 'uppercase',
1717
};
1818

19-
const dateStyles = {
19+
const dateStyles: CSS.Properties = {
2020
color: 'rgba(255, 255, 255, 0.5)',
2121
fontSize: '.875rem',
2222
float: 'right',
2323
width: '100%',
2424
textAlign: 'right',
2525
};
2626

27-
const subTitleStyles = {
27+
const subTitleStyles: CSS.Properties = {
2828
fontWeight: 600,
2929
color: 'rgba(255, 255, 255, .9)',
3030
fontSize: '1rem',
3131
marginTop: '1rem',
3232
marginBottom: 0,
3333
};
3434

35-
const descriptionStyles = {
35+
const descriptionStyles: CSS.Properties = {
3636
lineHeight: 1.6,
3737
color: 'rgba(255, 255, 255, 0.7)',
3838
fontWeight: 600,
@@ -41,9 +41,15 @@ const descriptionStyles = {
4141
marginBottom: 0,
4242
};
4343

44-
const W = props => <span {...props} style={{ color: 'white' }} />;
44+
const W: FunctionComponent = props => (
45+
<span {...props} style={{ color: 'white' }} />
46+
);
47+
48+
export const DashboardChangelog: FunctionComponent = () => {
49+
const {
50+
actions: { modalClosed },
51+
} = useOvermind();
4552

46-
function DashboardChangelog({ signals }) {
4753
return (
4854
<div
4955
style={{
@@ -130,12 +136,12 @@ function DashboardChangelog({ signals }) {
130136
block
131137
small
132138
secondary
133-
onClick={() => {
134-
signals.modalClosed();
135-
}}
139+
onClick={() => modalClosed()}
136140
>
137141
Close
138142
</Button>
143+
{/*
144+
// @ts-ignore */}
139145
<Button
140146
href="/post/announcing-codesandbox-dashboard-teams"
141147
style={{ marginTop: '1rem', marginLeft: '.25rem' }}
@@ -149,6 +155,4 @@ function DashboardChangelog({ signals }) {
149155
</div>
150156
</div>
151157
);
152-
}
153-
154-
export default inject('signals')(hooksObserver(DashboardChangelog));
158+
};

0 commit comments

Comments
 (0)