Skip to content
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
16 changes: 16 additions & 0 deletions src/app/routes/ScrollToTop.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { useEffect } from "react";
import { useLocation } from "react-router-dom";

export const ScrollToTop = () => {
const { pathname } = useLocation();

useEffect(() => {
window.scrollTo({
top: 0,
left: 0,
behavior: "instant" as ScrollBehavior
});
}, [pathname]);

return null;
};
6 changes: 5 additions & 1 deletion src/features/auth/AuthPage/AuthPage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
padding: map.get($spacing, "md");
background-color: var(--auth-modal-bg);

--auth-block-width: 450px;
--auth-block-width: 300px;

@include on-tablet {
--auth-block-width: 450px;
}

@include on-desktop {
flex-direction: row;
Expand Down
10 changes: 1 addition & 9 deletions src/features/contacts/ContactsPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react';
import React, { useState } from 'react';
import './ContactsPage.scss';
import * as Form from '@radix-ui/react-form';
import { Button } from '../../shared/ui/Button';
Expand Down Expand Up @@ -53,14 +53,6 @@ export const ContactsPage: React.FC = () => {
});
};

useEffect(() => {
window.scrollTo({
top: 0,
left: 0,
behavior: "auto",
});
}, []);

return (
<div className="contacts">
<div className="contacts__card">
Expand Down
6 changes: 6 additions & 0 deletions src/features/creators/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export const creators: CreatorInfo[] = [
},
{
link: 'https://t.me/Pitsan_Viktoriia',
icon: SocialNetworkEnum.TELEGRAM,
},
],
},

{
key: 'mkm',
images: [mkm_1],
socialNetworks: [
Expand Down
12 changes: 3 additions & 9 deletions src/features/product-detail/ProductDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { BlurReveal } from './components/BlurReveal';
import { useLanguage } from '../../shared/context/language';
import { Language } from '../../widgets/LanguageButton';
import { SlideIn } from '../../shared/animation/SlideIn';
import { useTranslation } from 'react-i18next';

const ProductDetailPage: React.FC = () => {
const { id } = useParams();
Expand All @@ -23,6 +24,7 @@ const ProductDetailPage: React.FC = () => {
const [isLoading, setIsLoading] = useState(false);
const [relatedProducts, setRelatedProducts] = useState<Product[]>([]);
const { language: lng } = useLanguage();
const { t } = useTranslation('productDetail');

useEffect(() => {
if (!id) return;
Expand Down Expand Up @@ -52,14 +54,6 @@ const ProductDetailPage: React.FC = () => {
loadProduct();
}, [id]);

useEffect(() => {
window.scrollTo({
top: 0,
left: 0,
behavior: "auto",
});
}, []);

return (
<div className="product-detail">
<div className="product-detail__breadcrumbs">
Expand Down Expand Up @@ -120,7 +114,7 @@ const ProductDetailPage: React.FC = () => {
<SlideIn>
<div className="product-detail__related">
<ProductSlider
layoutText="You may also like"
layoutText={t("youMayAlsoLike")}
products={relatedProducts}
isLoading={isLoading}
/>
Expand Down
4 changes: 3 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
CartCountProvider,
FavoriteCountProvider,
} from './app/providers';
import { ScrollToTop } from './app/routes/ScrollToTop.tsx';

createRoot(document.getElementById('root')!).render(
<StrictMode>
Expand All @@ -18,7 +19,8 @@ createRoot(document.getElementById('root')!).render(
<CurrencyProvider>
<CartCountProvider>
<FavoriteCountProvider>
<AppRoutes />
<ScrollToTop />
<AppRoutes />
</FavoriteCountProvider>
</CartCountProvider>
</CurrencyProvider>
Expand Down
1 change: 1 addition & 0 deletions src/shared/i18n/languages/en/creators.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"name": "Viktoriia Pitsan",
"role": "Developer",
"description": "I'm a web developer specializing in creating responsive, user-friendly web interfaces. I am passionate about enhancing user experience by building well-crafted, accessible, and intuitive web solutions."
},
"mkm": {
"name": "Kramarchuk Marina",
"role": "Tech Lead",
Expand Down
3 changes: 2 additions & 1 deletion src/shared/i18n/languages/en/productDetail.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"camera": "Camera",
"zoom": "Zoom",
"cell": "Cell"
}
},
"youMayAlsoLike": "You may also like"
}
1 change: 1 addition & 0 deletions src/shared/i18n/languages/ua/creators.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"name": "Піцан Вікторія",
"role": "Розробник",
"description": "Я веб-розробник, що спеціалізується на створенні адаптивних, зручних для користувачів веб-інтерфейсів. Мені подобається покращувати досвід користувачів, створюючи добре розроблені, доступні та інтуїтивно зрозумілі веб-рішення."
},
"mkm": {
"name": "Крамарчук Маріна",
"role": "Тех лід",
Expand Down
4 changes: 3 additions & 1 deletion src/shared/i18n/languages/ua/productDetail.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@
"camera": "Камера",
"zoom": "Зум",
"cell": "Стільниковий зв’язок"
}
},

"youMayAlsoLike": "Вам також може сподобатися"
}
Loading