diff --git a/src/app/[locale]/experts/[expertId]/page.tsx b/src/app/[locale]/experts/[expertId]/page.tsx
index dac9296..ba143d3 100644
--- a/src/app/[locale]/experts/[expertId]/page.tsx
+++ b/src/app/[locale]/experts/[expertId]/page.tsx
@@ -1,7 +1,6 @@
-import React from 'react';
+import React, { Suspense } from 'react';
import type { Metadata } from 'next';
import { notFound } from 'next/navigation';
-import { Link } from '../../../../navigation';
import { getExpertById, getExpertsList } from '../../../../actions/experts';
import {
ExpertCard,
@@ -10,6 +9,7 @@ import {
ExpertPractice
} from '../../../../components/Experts/ExpertDetails';
import { Details } from '../../../../types/experts';
+import { BackButton } from '../../../../components/view';
export const metadata: Metadata = {
title: 'Bbuddy - Experts item',
@@ -80,10 +80,12 @@ export default async function ExpertItem({ params: { expertId = '', locale} }: {
-
-
- Back to experts list
-
+
+
+
+ Back to experts list
+
+
diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx
index 9405a5c..047d48a 100644
--- a/src/app/not-found.tsx
+++ b/src/app/not-found.tsx
@@ -35,7 +35,9 @@ export default function NotFound() {
404
We can't seem to find a page you're looking for
-
+
+ Go back
+
diff --git a/src/components/Experts/AdditionalFilter.tsx b/src/components/Experts/AdditionalFilter.tsx
index df97946..1174064 100644
--- a/src/components/Experts/AdditionalFilter.tsx
+++ b/src/components/Experts/AdditionalFilter.tsx
@@ -47,7 +47,7 @@ export const ExpertsAdditionalFilter = ({
setFilter(newFilter);
}, [filter]);
- useEffect(() => {
+ const updateRoute = debounce(() => {
router.push({
pathname: basePath as any,
query: {
@@ -55,6 +55,10 @@ export const ExpertsAdditionalFilter = ({
...filter
}
})
+ }, 300);
+
+ useEffect(() => {
+ updateRoute();
}, [filter]);
return (
diff --git a/src/components/Experts/Experts.tsx b/src/components/Experts/Experts.tsx
index 18dd2ae..351752e 100644
--- a/src/components/Experts/Experts.tsx
+++ b/src/components/Experts/Experts.tsx
@@ -18,7 +18,7 @@ export const Experts = async ({ basePath = '/', locale, pageSize = DEFAULT_PAGE_
const t = await getTranslations('Experts');
const searchData = await getTagList(locale);
const languages = await getLanguages(locale);
- const filter = getFilter({ searchData, pageSize });
+ const filter = getFilter({ pageSize });
const experts = await getExpertsList(filter, locale);
return (
diff --git a/src/components/view/BackButton.tsx b/src/components/view/BackButton.tsx
index 2a56bef..323fea6 100644
--- a/src/components/view/BackButton.tsx
+++ b/src/components/view/BackButton.tsx
@@ -1,8 +1,10 @@
-import React from 'react';
+'use client'
+
+import React, { ReactNode } from 'react';
import { Button } from 'antd';
import { useRouter } from 'next/navigation';
-export const BackButton = ({ className, text }: { className?: string, text: string }) => {
+export const BackButton = ({ className, children }: { className?: string, children: ReactNode }) => {
const router = useRouter();
return (
@@ -10,7 +12,7 @@ export const BackButton = ({ className, text }: { className?: string, text: stri
className={className}
onClick={() => router.back()}
>
- {text}
+ {children}
);
};
diff --git a/src/components/view/CustomPagination.tsx b/src/components/view/CustomPagination.tsx
index 9b0361f..83b7a78 100644
--- a/src/components/view/CustomPagination.tsx
+++ b/src/components/view/CustomPagination.tsx
@@ -24,6 +24,13 @@ const Pagination = styled(AntdPagination)`
}
}
+ .ant-pagination-jump-next {
+ margin-inline-end: 0 !important;
+ height: 40px !important;
+ width: 40px !important;
+ line-height: 38px !important;
+ }
+
.ant-pagination-item-active {
background: #2c7873 !important;
@@ -50,6 +57,7 @@ export const CustomPagination = (props: PaginationProps) => (
);
diff --git a/src/styles/_default.scss b/src/styles/_default.scss
index c4a6580..7a0986b 100644
--- a/src/styles/_default.scss
+++ b/src/styles/_default.scss
@@ -547,16 +547,16 @@ a {
text-decoration: none;
width: 100%;
cursor: pointer;
- border-radius: 8px;
- background: #2C7873;
- box-shadow: 0px 2px 4px 0px rgba(252, 214, 70, 0.16);
- display: flex;
- gap: 10px;
- height: 54px;
+ border-radius: 8px !important;
+ background: #2C7873 !important;
+ box-shadow: 0px 2px 4px 0px rgba(252, 214, 70, 0.16) !important;
+ display: flex !important;
+ gap: 10px !important;
+ height: 54px !important;
padding: 8px 31px;
justify-content: center;
- align-items: center;
- color: $white;
+ align-items: center !important;
+ color: $white !important;
@include rem(15);
font-style: normal;
font-weight: 400;
diff --git a/src/utils/filter.ts b/src/utils/filter.ts
index 3e7ae04..7cee4ce 100644
--- a/src/utils/filter.ts
+++ b/src/utils/filter.ts
@@ -2,18 +2,18 @@ import { SearchData } from '../types/tags';
import { AdditionalFilter, Filter, GeneralFilter } from '../types/experts';
import { DEFAULT_PAGE } from '../constants/common';
-export const getDefaultFilter = (searchData: SearchData | null, pageSize?: number): Filter => {
- const themesTagIds = searchData?.themesGroups?.reduce
((result, { tags }) => {
- const t = tags?.map(({ id }) => id) || [];
-
- return t ? [
- ...result,
- ...t
- ] : result;
- }, []);
+export const getDefaultFilter = (pageSize?: number): Filter => {
+ // const themesTagIds = searchData?.themesGroups?.reduce((result, { tags }) => {
+ // const t = tags?.map(({ id }) => id) || [];
+ //
+ // return t ? [
+ // ...result,
+ // ...t
+ // ] : result;
+ // }, []);
return {
- themesTagIds,
+ themesTagIds: [],
priceFrom: null,
priceTo: null,
durationFrom: null,
@@ -24,13 +24,12 @@ export const getDefaultFilter = (searchData: SearchData | null, pageSize?: numbe
};
type FilterProps = {
- searchData: SearchData | null,
pageSize?: number,
searchParams?: { [key: string]: string | string[] | undefined }
}
-export const getFilter = ({ searchData, searchParams, pageSize }: FilterProps): Filter => {
- const filter = getDefaultFilter(searchData, pageSize);
+export const getFilter = ({ searchParams, pageSize }: FilterProps): Filter => {
+ const filter = getDefaultFilter(pageSize);
if (searchParams) {
const { themesTagIds, priceFrom, priceTo, durationFrom, durationTo, page, pageSize } = searchParams;