|
1 |
| -import { useState } from 'react'; |
2 |
| -import GitHubCorners from '@uiw/react-github-corners'; |
3 | 1 | import Github from '@uiw/react-shields/esm/github';
|
4 | 2 | import Npm from '@uiw/react-shields/esm/npm';
|
5 |
| -import BackToUp from '@uiw/react-back-to-top'; |
6 |
| -import MarkdownPreview from '@uiw/react-markdown-preview'; |
7 |
| -import '@wcj/dark-mode'; |
8 |
| -import logo from './logo.svg'; |
9 |
| -import { Preview } from './preview'; |
10 |
| -import './App.css'; |
| 3 | +import styled from 'styled-components'; |
11 | 4 |
|
12 |
| -let val = 1; |
| 5 | +const Footer = styled.footer` |
| 6 | + text-align: center; |
| 7 | + padding-top: 30px; |
| 8 | +`; |
13 | 9 |
|
14 | 10 | const App = () => {
|
15 |
| - const [value, setValue] = useState(''); |
16 | 11 | return (
|
17 |
| - <div className="App"> |
18 |
| - <BackToUp>Top</BackToUp> |
19 |
| - <dark-mode permanent light="Light" dark="Dark"></dark-mode> |
20 |
| - <GitHubCorners zIndex={9999} fixed target="__blank" href="https://github.com/uiwjs/react-markdown-preview" /> |
21 |
| - <header className="App-header"> |
22 |
| - <img style={{}} src={logo} className="App-logo" alt="logo" /> |
23 |
| - <a href="https://github.com/uiwjs/react-markdown-preview" target="_blank" rel="noopener noreferrer"> |
24 |
| - React Markdown Preview |
25 |
| - </a> |
26 |
| - <p> |
27 |
| - React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub |
28 |
| - Markdown style. |
29 |
| - </p> |
30 |
| - </header> |
31 |
| - <div className="App-editor"> |
32 |
| - <button onClick={() => setValue('# Markdown ' + val++)}>set value</button> |
33 |
| - |
34 |
| - <textarea |
35 |
| - placeholder="Please enter the Markdown code!" |
36 |
| - value={value} |
37 |
| - spellCheck="false" |
38 |
| - onChange={(e) => setValue(e.target.value)} |
39 |
| - /> |
40 |
| - <MarkdownPreview className="App-editor-preview" source={value} /> |
41 |
| - </div> |
42 |
| - <Preview /> |
43 |
| - <div className="App-footer"> |
44 |
| - <Github user="uiwjs" repo="react-markdown-preview"> |
45 |
| - <Github.Social type="forks" href="https://github.com/uiwjs/react-markdown-preview" /> |
46 |
| - <Github.Social type="stars" href="https://github.com/uiwjs/react-markdown-preview/stargazers" /> |
47 |
| - <Github.Social type="watchers" href="https://github.com/uiwjs/react-markdown-preview/watchers" /> |
48 |
| - </Github> |
49 |
| - <Npm.Version |
50 |
| - scope="@uiw" |
51 |
| - packageName="react-markdown-preview" |
52 |
| - href="https://www.npmjs.com/package/@uiw/react-markdown-preview" |
53 |
| - /> |
54 |
| - </div> |
55 |
| - </div> |
| 12 | + <Footer> |
| 13 | + <Github user="uiwjs" repo="react-markdown-preview"> |
| 14 | + <Github.Social type="forks" href="https://github.com/uiwjs/react-markdown-preview" /> |
| 15 | + <Github.Social type="stars" href="https://github.com/uiwjs/react-markdown-preview/stargazers" /> |
| 16 | + <Github.Social type="watchers" href="https://github.com/uiwjs/react-markdown-preview/watchers" /> |
| 17 | + </Github> |
| 18 | + <Npm.Version |
| 19 | + scope="@uiw" |
| 20 | + packageName="react-markdown-preview" |
| 21 | + href="https://www.npmjs.com/package/@uiw/react-markdown-preview" |
| 22 | + /> |
| 23 | + </Footer> |
56 | 24 | );
|
57 | 25 | };
|
58 | 26 |
|
|
0 commit comments