mirror of
https://github.com/yawaflua/SusMarket.git
synced 2025-12-11 16:16:26 +02:00
Profile page, file structure & fixes
Fixed warning about Babel, added folder 'utils', coding profile page & other
This commit is contained in:
@@ -15,10 +15,10 @@ export default function App() {
|
||||
<main className="main">
|
||||
<Routes>
|
||||
<Route path="/" element={<HomePage />}/>
|
||||
<Route path="/profile" element={<ProfilePage />}/>
|
||||
<Route path="/Product" element={<ProductPage />}/>
|
||||
<Route path="/payment" element={<PaymentPage />}/>
|
||||
<Route path="/scam" element={<ScamPage />}/>
|
||||
<Route path="profile/*" element={<ProfilePage />}/>
|
||||
<Route path="Product" element={<ProductPage />}/>
|
||||
<Route path="payment" element={<PaymentPage />}/>
|
||||
<Route path="scam" element={<ScamPage />}/>
|
||||
</Routes>
|
||||
</main>
|
||||
</>
|
||||
|
||||
@@ -8,4 +8,136 @@ $accent-color: #EB5E28;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
|
||||
.profile-section__nav {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.profile-link {
|
||||
color: white;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
line-height: 39px;
|
||||
letter-spacing: 0%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.active {
|
||||
color: $accent-color;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-section__info-div {
|
||||
display: flex;
|
||||
max-width: 150px;
|
||||
flex-direction: column;
|
||||
|
||||
span {
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
line-height: 29px;
|
||||
letter-spacing: 0%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
|
||||
.orders-section {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
|
||||
.orders-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 80px;
|
||||
|
||||
.orders-div {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
gap: 40px;
|
||||
|
||||
.order-article {
|
||||
width: 352px;
|
||||
height: 120px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0px 14px 0px 14px;
|
||||
border-radius: 15px;
|
||||
box-shadow: -4px -4px 10px 0px rgba(0, 0, 0, 0.25),4px 4px 10px 0px rgba(0, 0, 0, 0.25);
|
||||
background: $background-color;
|
||||
|
||||
.order-article__img {
|
||||
min-width: 90px;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
height: 90px;
|
||||
border-radius: 8px;
|
||||
background-image: url(../src/assets/img/product-image-1.webp);
|
||||
}
|
||||
|
||||
.order-article__info-div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
|
||||
.order-article__status-span {
|
||||
color: white;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
line-height: 29px;
|
||||
letter-spacing: 0%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.order-article__info-span {
|
||||
color: #808080;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
letter-spacing: 0%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.order-article__date-span {
|
||||
color: white;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
letter-spacing: 0%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.purchases-section {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
|
||||
.purchases-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 80px;
|
||||
|
||||
.purchases-div {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
reactapp/src/assets/img/profile-avatar.png
Normal file
BIN
reactapp/src/assets/img/profile-avatar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -7,11 +7,18 @@ type ProductTypes = {
|
||||
}
|
||||
|
||||
export default function ProductCard({ProductName, ProductImg, Price}:ProductTypes) {
|
||||
const PriceAsString = Price.toString();
|
||||
|
||||
return(
|
||||
<article className="product-article">
|
||||
<img src={ProductImg} alt="" className="product-article__img"/>
|
||||
<h5 className="product-article__price-h5">{Price} ₽</h5>
|
||||
<h6 className="product-article__name-h6">{ProductName}</h6>
|
||||
<h5 className="product-article__price-h5">
|
||||
<span>{PriceAsString}</span>
|
||||
<span>₽</span>
|
||||
</h5>
|
||||
<h6 className="product-article__name-h6">
|
||||
{ProductName}
|
||||
</h6>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
12
reactapp/src/components/ProfileInfo.tsx
Normal file
12
reactapp/src/components/ProfileInfo.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from "react";
|
||||
import ProfileAvatar from '../assets/img/profile-avatar.png';
|
||||
import '../ProfileStyle.scss';
|
||||
|
||||
export default function ProfileInfo() {
|
||||
return(
|
||||
<div className="profile-section__info-div">
|
||||
<img src={ProfileAvatar} alt="" className="info-div__img"/>
|
||||
<span>Роман Константинов</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,40 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import '../ProfileStyle.scss';
|
||||
import ProfileInfo from "./ProfileInfo";
|
||||
|
||||
export default function ProfileOrders() {
|
||||
return(
|
||||
<>
|
||||
</>
|
||||
<section className="orders-section">
|
||||
<nav className="profile-section__nav">
|
||||
<Link to="/" className="profile-link active">
|
||||
Мои заказы
|
||||
</Link>
|
||||
<Link to="purchases" className="profile-link">
|
||||
Мои покупки
|
||||
</Link>
|
||||
</nav>
|
||||
<div className="orders-container">
|
||||
<ProfileInfo />
|
||||
<div className="orders-div">
|
||||
<article className="order-article">
|
||||
<div className="order-article__img"></div>
|
||||
<div className="order-article__info-div">
|
||||
<span className="order-article__status-span">В пути</span>
|
||||
<span className="order-article__info-span">Доставка в пункт выдачи</span>
|
||||
<span className="order-article__date-span">Ожидаем 9 декабря</span>
|
||||
</div>
|
||||
</article>
|
||||
<article className="order-article">
|
||||
<div className="order-article__img"></div>
|
||||
<div className="order-article__info-div">
|
||||
<span className="order-article__status-span">В пути</span>
|
||||
<span className="order-article__info-span">Доставка в пункт выдачи</span>
|
||||
<span className="order-article__date-span">Ожидаем 9 декабря</span>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,8 +1,29 @@
|
||||
import React from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import '../ProfileStyle.scss';
|
||||
import ProfileInfo from "./ProfileInfo";
|
||||
import ProductCard from "./ProductCard";
|
||||
import ProductImage from "../assets/img/product-image-3.webp";
|
||||
|
||||
export default function ProfilePurchases() {
|
||||
return(
|
||||
<>
|
||||
</>
|
||||
<section className="purchases-section">
|
||||
<nav className="profile-section__nav">
|
||||
<Link to="/profile" className="profile-link">
|
||||
Мои заказы
|
||||
</Link>
|
||||
<Link to="purchases" className="profile-link active">
|
||||
Мои покупки
|
||||
</Link>
|
||||
</nav>
|
||||
<div className="purchases-container">
|
||||
<ProfileInfo />
|
||||
<div className="purchases-div">
|
||||
<ProductCard ProductImg={ProductImage} ProductName="Абеме" Price={150}/>
|
||||
<ProductCard ProductImg={ProductImage} ProductName="Абеме" Price={1234523453}/>
|
||||
<ProductCard ProductImg={ProductImage} ProductName="Абеме" Price={10}/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
$background-color: #252422;
|
||||
$main-color: #CCC5B9;
|
||||
$accent-color: #EB5E28;
|
||||
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap');
|
||||
|
||||
body {
|
||||
background-color: $background-color;
|
||||
@@ -30,8 +30,18 @@ body {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
line-height: 39px;
|
||||
letter-spacing: 0%;
|
||||
height: 50px;
|
||||
text-align: left;
|
||||
display: inline-block;
|
||||
|
||||
span {
|
||||
max-width: 186px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.product-article__name-h6 {
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
import './index.scss';
|
||||
import './reset.css';
|
||||
import './utils/reset.css';
|
||||
import App from './App';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function HomePage() {
|
||||
<ProductCard ProductName="Мороженое" ProductImg={Image4} Price={150} />
|
||||
<ProductCard ProductName="Фигурка" ProductImg={Image5} Price={1799} />
|
||||
<ProductCard ProductName="Трансформер" ProductImg={Image6} Price={19999} />
|
||||
<ProductCard ProductName="Старая игрушка Баз-Лайтер" ProductImg={Image7} Price={99999999999} />
|
||||
<ProductCard ProductName="Старая игрушка Баз-Лайтер" ProductImg={Image7} Price={2564235634563456} />
|
||||
<ProductCard ProductName="Одёжка" ProductImg={Image8} Price={756} />
|
||||
<ProductCard ProductName="Книга про ботанику" ProductImg={Image9} Price={2345} />
|
||||
<ProductCard ProductName="Книга белая" ProductImg={Image10} Price={150} />
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import React from "react";
|
||||
import Banner from "../components/AddBanner";
|
||||
import '../ProfileStyle.scss';
|
||||
import { Route, Routes } from "react-router-dom";
|
||||
import ProfileOrders from "../components/ProfileOrders";
|
||||
import ProfilePurchases from "../components/ProfilePurchases";
|
||||
import '../ProfileStyle.scss';
|
||||
import { Routes, Route, Link } from 'react-router-dom';
|
||||
|
||||
export default function ProfilePage() {
|
||||
return(
|
||||
<section className="profile-section">
|
||||
<Banner />
|
||||
<Routes>
|
||||
<Route path="/profile/orders" element={<ProfileOrders />} />
|
||||
<Route path="/profile/orders" element={<ProfilePurchases />} />
|
||||
<Route path="/" element={<ProfileOrders/>}/>
|
||||
<Route path="purchases" element={<ProfilePurchases/>}/>
|
||||
</Routes>
|
||||
</section>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user