Skip to content

Commit

Permalink
Router, structure (#3)
Browse files Browse the repository at this point in the history
* structure, router

* home

---------

Co-authored-by: Dmitri Gornakov <[email protected]>
  • Loading branch information
visualGravitySense and Dmitri Gornakov authored Oct 21, 2024
1 parent 74f4742 commit abbf93f
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 2 deletions.
75 changes: 74 additions & 1 deletion online-school/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion online-school/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"preview": "vite preview"
},
"dependencies": {
"bootstrap": "^5.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-router-dom": "^6.27.0"
},
"devDependencies": {
"@eslint/js": "^9.11.1",
Expand Down
15 changes: 15 additions & 0 deletions online-school/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'

import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Home from './components/Home';
import CourseList from './components/CourseList';
import About from './components/About';
import Contact from './components/Contact';

function App() {
const [count, setCount] = useState(0)

Expand All @@ -28,6 +34,15 @@ function App() {
<p className="read-the-docs">
Click on the Vite and React logos to learn more
</p>

<Router>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/courses" element={<CourseList />} />
<Route path="/about" element={<About />} />
<Route path="/contact" element={<Contact />} />
</Routes>
</Router>
</>
)
}
Expand Down
Empty file.
Empty file.
Empty file.
22 changes: 22 additions & 0 deletions online-school/src/components/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';

function Home() {
return (
<div>
<section className="hero">
<h1>Добро пожаловать в онлайн-школу!</h1>
<p>Изучай новые навыки с лучшими преподавателями.</p>
</section>
<section className="courses">
<h2>Популярные курсы</h2>
{/* Здесь будет список популярных курсов */}
</section>
<section className="testimonials">
<h2>Отзывы студентов</h2>
{/* Здесь будут отзывы */}
</section>
</div>
);
}

export default Home;

0 comments on commit abbf93f

Please sign in to comment.