mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
added initial components and routing
This commit is contained in:
+11
-1
@@ -1,5 +1,15 @@
|
||||
import React from 'react';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
import Home from './components/Home';
|
||||
import Board from './components/Board';
|
||||
import Thread from './components/Thread';
|
||||
|
||||
function App() {
|
||||
return null;
|
||||
return <Routes>
|
||||
<Route path='/' element={<Home />} />
|
||||
<Route path='/board' element={<Board />} />
|
||||
<Route path='/board/:thread' element={<Thread />} />
|
||||
</Routes>
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import React from "react";
|
||||
|
||||
class Board extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Board</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Board;
|
||||
@@ -0,0 +1,13 @@
|
||||
import React from 'react';
|
||||
|
||||
class Home extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className='container'>
|
||||
<h1>plebchan</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Home;
|
||||
@@ -0,0 +1,13 @@
|
||||
import React from "react";
|
||||
|
||||
class Thread extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Thread</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Thread;
|
||||
+10
-2
@@ -1,5 +1,13 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import App from './App';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
</React.StrictMode>
|
||||
);
|
||||
Reference in New Issue
Block a user