|
1 | 1 | import * as React from 'react'; |
2 | 2 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; |
3 | 3 | import { faBox, faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; |
| 4 | +import useMedia from '../hooks/useMedia'; |
4 | 5 |
|
5 | | -const Info: React.SFC<{}> = () => ( |
6 | | - <div className="column column-40 flex-center"> |
7 | | - <h1 className="purple">create-cli-application</h1> |
8 | | - <blockquote className="blue-quote"> |
9 | | - A bootstrapper for creating a cli application with Node. |
10 | | - </blockquote> |
11 | | - <span className="badge"> |
12 | | - <FontAwesomeIcon icon={faBox} /> |
13 | | - <span className="margin-left-sm">15.6kb gzipped</span> |
14 | | - </span> |
15 | | - <a |
16 | | - className="purple" |
17 | | - href="https://github.com/alexlee-dev/create-cli-application" |
18 | | - rel="noopener noreferrer" |
19 | | - target="_blank" |
| 6 | +const Info: React.SFC<{}> = () => { |
| 7 | + const columnSize = useMedia( |
| 8 | + ['(min-width: 1000px)', '(min-width: 600px)'], |
| 9 | + ['column-40', ''], |
| 10 | + '', |
| 11 | + ); |
| 12 | + |
| 13 | + return ( |
| 14 | + <div |
| 15 | + className={`column ${columnSize} flex-center ${ |
| 16 | + columnSize === '' && 'margin-bottom-md margin-top-lg' |
| 17 | + }`} |
20 | 18 | > |
21 | | - <FontAwesomeIcon icon={faExternalLinkAlt} /> |
22 | | - <span className="margin-left-sm">View Documentation</span> |
23 | | - </a> |
24 | | - </div> |
25 | | -); |
| 19 | + <h1 className="purple">create-cli-application</h1> |
| 20 | + <blockquote className="blue-quote"> |
| 21 | + A bootstrapper for creating a cli application with Node. |
| 22 | + </blockquote> |
| 23 | + <span className="badge"> |
| 24 | + <FontAwesomeIcon icon={faBox} /> |
| 25 | + <span className="margin-left-sm">15.6kb gzipped</span> |
| 26 | + </span> |
| 27 | + <a |
| 28 | + className="purple" |
| 29 | + href="https://github.com/alexlee-dev/create-cli-application" |
| 30 | + rel="noopener noreferrer" |
| 31 | + target="_blank" |
| 32 | + > |
| 33 | + <FontAwesomeIcon icon={faExternalLinkAlt} /> |
| 34 | + <span className="margin-left-sm">View Documentation</span> |
| 35 | + </a> |
| 36 | + </div> |
| 37 | + ); |
| 38 | +}; |
26 | 39 |
|
27 | 40 | export default Info; |
0 commit comments