Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix favorit count issue #17

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/img/contacts/Les.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/contacts/Nazar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/contacts/Stas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/contacts/Veronika.jfif
Binary file not shown.
Binary file added public/img/contacts/Vitalij.jfif
Binary file not shown.
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { CartProvider } from './utils/CartProvider.tsx';
import { BaseLayout } from './Pages/BaseLayout/BaseLayout.tsx';
import { FavouriteItems } from './components/FavoriteItems/FavoriteItems.tsx';
import { FavoriteProvider } from './utils/FavoriteProvider.tsx';
import { Contacts } from './Pages/Contacts/Contacts.tsx';

export const App: React.FC = () => {
return (
Expand All @@ -33,6 +34,7 @@ export const App: React.FC = () => {
<Route path="/accessories" element={<AccessoriesPage />} />
<Route path="/favorites" element={<FavouriteItems />} />
<Route path="/cart" element={<Cart />} />
<Route path="/contacts" element={<Contacts />} />
<Route path="*" element={<PageNotFound />} />
</Routes>
</main>
Expand Down
64 changes: 64 additions & 0 deletions src/Pages/Contacts/Contacts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
.contacts-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}

.contacts__person {
display: flex;
align-items: center;
background: white;
border: 1px solid #ddd;
border-radius: 8px;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.person__photo {
width: 175px;
height: 175px;
border-radius: 50%;
background-color: #ccc;
background-position: center;
background-repeat: no-repeat;
background-size: contain;
margin-right: 15px;

&--1 {
background-image: url(/img/contacts/Les.png);
}
&--2 {
background-image: url(/img/contacts/Veronika.jfif);
}
&--3 {
background-image: url(/img/contacts/Vitalij.jfif);
}
&--4 {
background-image: url(/img/contacts/Nazar.png);
}
&--5 {
background-image: url(/img/contacts/Stas.png);
}
}

.person__info {
display: flex;
flex-direction: column;
}

.person__name {
font-size: 1.2em;
color: #333;
margin-bottom: 5px;
}

.person__info a {
color: #1a73e8;
text-decoration: none;
}

.person__info a:hover {
text-decoration: underline;
}
42 changes: 42 additions & 0 deletions src/Pages/Contacts/Contacts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react';
import './Contacts.scss';

export const Contacts: React.FC = () => (
<div className="contacts-container">
<div className="contacts__person person">
<div className="person__photo person__photo--1" />
<div className="person__info">
<div className="person__name">Oleksandr Dyman</div>
<a href="https://github.com/lesdyman">Github</a>
</div>
</div>
<div className="contacts__person person">
<div className="person__photo person__photo--2" />
<div className="person__info">
<div className="person__name">Veronika Demko</div>
<a href="https://github.com/demkoveronika">Github</a>
</div>
</div>
<div className="contacts__person person">
<div className="person__photo person__photo--3" />
<div className="person__info">
<div className="person__name">Vitalii Shut</div>
<a href="https://github.com/V-Shut">Github</a>
</div>
</div>
<div className="contacts__person person">
<div className="person__photo person__photo--4" />
<div className="person__info">
<div className="person__name">Nazarii Siryi</div>
<a href="https://github.com/akryto">Github</a>
</div>
</div>
<div className="contacts__person person">
<div className="person__photo person__photo--5" />
<div className="person__info">
<div className="person__name">Stas Andrushchak</div>
<a href="https://github.com/Stasandrushchak">Github</a>
</div>
</div>
</div>
);
2 changes: 1 addition & 1 deletion src/components/FavoriteItems/FavoriteItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const FavouriteItems = () => {
<h1 className="component__title">Favourites</h1>
</div>
<div className="component__models-number">
<p>... models</p>
<p>{`${context.favorites.length} models`}</p>
</div>
<div className="component__wrap">
{context.favorites.length ? (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const Footer: React.FC = () => {
>
Github
</NavLink>
<NavLink className="footer__link footer__item" to="/">
<NavLink className="footer__link footer__item" to="/contacts">
Contacts
</NavLink>
<NavLink className="footer__link footer__item" to="/">
Expand Down
Loading