Что доделали по уроку

This commit is contained in:
2026-05-17 12:46:44 +03:00
parent 6cfec52fb8
commit c3a78e506a
17 changed files with 141 additions and 29 deletions
+13
View File
@@ -0,0 +1,13 @@
import styles from './index.module.scss'
import Header from '../../components/header/index'
const About = () => {
return (
<div className={styles.container}>
<Header />
</div>
)
}
export default About
+4
View File
@@ -0,0 +1,4 @@
.container {
max-width: 1170px;
margin: 0 auto;
}
+9 -1
View File
@@ -1,5 +1,13 @@
import styles from './index.module.scss'
import Header from '../../components/header/index'
const Cart = () => {
return <></>
return (
<div className={styles.container}>
<Header />
</div>
)
}
export default Cart
+4
View File
@@ -0,0 +1,4 @@
.container {
max-width: 1170px;
margin: 0 auto;
}
+12
View File
@@ -0,0 +1,12 @@
import styles from './index.module.scss'
import { useParams } from 'react-router-dom'
const Product = ({ name, price }) => {
const { id } = useParams();
return (
<>
<h2>Товар {id}. {name} по цене {price }</h2>
</>
)
}
export default Product
View File
+22
View File
@@ -0,0 +1,22 @@
import styles from './index.module.scss'
import { useNavigate } from 'react-router-dom'
const Login = () => {
const navigate = useNavigate();
const handleSubmit = formData => {
//Какая то логика проверки авторизации
navigate('/catalog')
}
return (
<>
<h2>Страница авторизации</h2>
<form onSubmit={handleSubmit}>
<button type="submit">Войти</button>
</form>
</>
)
}
export default Login
View File
+15
View File
@@ -0,0 +1,15 @@
import styles from './index.module.scss'
import Header from '../../components/header/index'
import { useParams } from 'react-router-dom'
const UserProfile = ({ name }) => {
const { id } = useParams();
return (
<div className={styles.container}>
<Header />
<h2>Профиль пользователя {id} {name}</h2>
</div>
)
}
export default UserProfile
+4
View File
@@ -0,0 +1,4 @@
.container {
max-width: 1170px;
margin: 0 auto;
}