mirror of
https://github.com/He4eT/huge-link.git
synced 2026-05-05 08:57:23 +00:00
Initial commit
This commit is contained in:
commit
11523c975b
13 changed files with 15621 additions and 0 deletions
30
src/app.js
Normal file
30
src/app.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import {h} from 'preact'
|
||||
import {useState} from 'preact/hooks'
|
||||
import {Router} from 'preact-router'
|
||||
|
||||
import Editor from './routes/editor'
|
||||
import Post from './routes/post'
|
||||
|
||||
const App = () => {
|
||||
const [markdown, setMarkdown] = useState('')
|
||||
|
||||
return (<main>
|
||||
<Router>
|
||||
<Editor
|
||||
path='/'
|
||||
markdown={ markdown }
|
||||
{ ...{setMarkdown} } />
|
||||
<Post
|
||||
path='/preview/'
|
||||
mode='preview'
|
||||
payload={ markdown }
|
||||
{ ...{setMarkdown} } />
|
||||
<Post
|
||||
path='/p/:payload'
|
||||
mode='post'
|
||||
{ ...{setMarkdown} } />
|
||||
</Router>
|
||||
</main>)
|
||||
}
|
||||
|
||||
export default App
|
||||
Loading…
Add table
Add a link
Reference in a new issue