|
1 | | -import React from 'react'; |
2 | | - |
| 1 | +import MaxWidth from '@codesandbox/common/lib/components/flex/MaxWidth'; |
| 2 | +import Margin from '@codesandbox/common/lib/components/spacing/Margin'; |
3 | 3 | import { inject } from 'mobx-react'; |
| 4 | +import React, { useEffect } from 'react'; |
4 | 5 |
|
5 | 6 | import Navigation from 'app/pages/common/Navigation'; |
6 | | -import Title from 'app/components/Title'; |
7 | 7 | import SubTitle from 'app/components/SubTitle'; |
8 | | -import MaxWidth from '@codesandbox/common/lib/components/flex/MaxWidth'; |
9 | | -import Margin from '@codesandbox/common/lib/components/spacing/Margin'; |
| 8 | +import Title from 'app/components/Title'; |
10 | 9 |
|
11 | 10 | import { Container, Content, Code } from './elements'; |
12 | 11 |
|
13 | | -class CliInstructions extends React.PureComponent { |
14 | | - componentDidMount() { |
15 | | - this.props.signals.cliInstructionsMounted(); |
16 | | - } |
17 | | - |
18 | | - render() { |
19 | | - return ( |
20 | | - <MaxWidth> |
21 | | - <Margin vertical={1.5} horizontal={1.5}> |
22 | | - <Container> |
23 | | - <Navigation title="CLI Import" /> |
24 | | - <Content vertical> |
25 | | - <Title>Import from CLI</Title> |
26 | | - <SubTitle> |
27 | | - 1. Install the CLI <Code>npm i -g codesandbox</Code> |
28 | | - </SubTitle> |
29 | | - <SubTitle> |
30 | | - 2. Go to your project <Code>cd path-of-your-project</Code> |
31 | | - </SubTitle> |
32 | | - <SubTitle> |
33 | | - 3. Deploy your project to CodeSandbox{' '} |
34 | | - <Code>codesandbox ./</Code> |
35 | | - </SubTitle> |
36 | | - </Content> |
37 | | - </Container> |
38 | | - </Margin> |
39 | | - </MaxWidth> |
40 | | - ); |
41 | | - } |
42 | | -} |
43 | | - |
44 | | -export default inject(['signals'])(CliInstructions); |
| 12 | +const CLIInstructions = ({ signals: { cliInstructionsMounted } }) => { |
| 13 | + useEffect(() => { |
| 14 | + cliInstructionsMounted(); |
| 15 | + }, [cliInstructionsMounted]); |
| 16 | + |
| 17 | + return ( |
| 18 | + <MaxWidth> |
| 19 | + <Margin vertical={1.5} horizontal={1.5}> |
| 20 | + <Container> |
| 21 | + <Navigation title="CLI Import" /> |
| 22 | + |
| 23 | + <Content vertical> |
| 24 | + <Title>Import from CLI</Title> |
| 25 | + |
| 26 | + <SubTitle> |
| 27 | + 1. Install the CLI <Code>npm i -g codesandbox</Code> |
| 28 | + </SubTitle> |
| 29 | + |
| 30 | + <SubTitle> |
| 31 | + 2. Go to your project <Code>cd path-of-your-project</Code> |
| 32 | + </SubTitle> |
| 33 | + |
| 34 | + <SubTitle> |
| 35 | + 3. Deploy your project to CodeSandbox <Code>codesandbox ./</Code> |
| 36 | + </SubTitle> |
| 37 | + </Content> |
| 38 | + </Container> |
| 39 | + </Margin> |
| 40 | + </MaxWidth> |
| 41 | + ); |
| 42 | +}; |
| 43 | + |
| 44 | +export default inject(['signals'])(CLIInstructions); |
0 commit comments