refactor: clean up message files and improve product category handling
This commit is contained in:
@@ -5,15 +5,20 @@ import Navbar from '../navbar';
|
||||
import Button, { IconButton } from '@/components/uikit/button';
|
||||
import { Icon } from '@/components/uikit/icons';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import routeFactory from '@/assets/constants/routeFactory';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
export default function Header() {
|
||||
const t = useTranslations();
|
||||
const params = useParams();
|
||||
const locale = params.locale as string;
|
||||
|
||||
const bannerFooter = [
|
||||
t('com_home_Banner_link1'),
|
||||
t('com_home_Banner_link2'),
|
||||
t('com_home_Banner_link3'),
|
||||
];
|
||||
const routes = routeFactory(t, locale);
|
||||
|
||||
return (
|
||||
<header
|
||||
@@ -37,7 +42,9 @@ export default function Header() {
|
||||
}}
|
||||
/>
|
||||
<div>
|
||||
<Button endIcon="showMore">{t('com_home_banner_button')}</Button>
|
||||
<Button endIcon="showMore" link={routes.productCategories.route()}>
|
||||
{t('com_home_banner_button')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@ export default function ProductList({
|
||||
.then((res) => {
|
||||
setProducts(res.data);
|
||||
setPagination(res.pagination);
|
||||
|
||||
document
|
||||
.getElementById('productList')
|
||||
?.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to fetch products:', error);
|
||||
|
||||
Reference in New Issue
Block a user