Skip to content

Commit 73982c8

Browse files
committed
🔨 Switch ZenModeIntroductionModal to use useOvermind
1 parent a758bab commit 73982c8

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

‎packages/app/src/app/pages/Sandbox/ZenModeIntroductionModal/elements.ts‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
import styled from 'styled-components';
1+
import { Button as ButtonBase } from '@codesandbox/common/lib/components/Button';
2+
import styled, { css } from 'styled-components';
3+
4+
export const Button = styled(ButtonBase)`
5+
margin-right: 0.5rem;
6+
`;
27

38
export const Container = styled.div`
4-
background-color: ${props => props.theme.background};
5-
padding: 1rem;
6-
margin: 0;
7-
color: ${props =>
8-
props.theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'};
9+
${({ theme }) => css`
10+
background-color: ${theme.background};
11+
padding: 1rem;
12+
margin: 0;
13+
color: ${theme.light ? 'rgba(0, 0, 0, 0.8)' : 'rgba(255, 255, 255, 0.8)'};
14+
`};
915
`;
1016

1117
export const Heading = styled.h2`

‎packages/app/src/app/pages/Sandbox/ZenModeIntroductionModal/index.tsx‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1+
import Row from '@codesandbox/common/lib/components/flex/Row';
12
import React, { FunctionComponent } from 'react';
3+
24
import { useOvermind } from 'app/overmind';
3-
import { Button } from '@codesandbox/common/lib/components/Button';
4-
import Row from '@codesandbox/common/lib/components/flex/Row';
55

6-
import { Container, Heading, Explanation } from './elements';
6+
import { Button, Container, Explanation, Heading } from './elements';
77

8-
export const ZenModeIntroduction: FunctionComponent = () => {
8+
export const ZenModeIntroductionModal: FunctionComponent = () => {
99
const {
1010
actions: { modalClosed },
1111
} = useOvermind();
1212

1313
return (
1414
<Container>
1515
<Heading>Zen Mode Explained</Heading>
16+
1617
<Explanation>
1718
Zen Mode is perfect for giving instruction videos and presentations. You
18-
can toggle the sidebar by double tapping <code>shift</code>. You can
19-
leave Zen Mode by hovering over the file name above the editor and
20-
clicking the icon on the right.
19+
can toggle the sidebar by double tapping <kbd>shift</kbd>. You can leave
20+
Zen Mode by hovering over the file name above the editor and clicking
21+
the icon on the right.
2122
</Explanation>
2223

2324
<Row justifyContent="space-around">
24-
<Button style={{ marginRight: '.5rem' }} onClick={() => modalClosed()}>
25-
Close
26-
</Button>
25+
<Button onClick={() => modalClosed()}>Close</Button>
2726
</Row>
2827
</Container>
2928
);

0 commit comments

Comments
 (0)