diff --git a/src/app/[name]/about/AboutPage.tsx b/src/app/[name]/about/AboutPage.tsx index ae373f3..b7fd4e8 100644 --- a/src/app/[name]/about/AboutPage.tsx +++ b/src/app/[name]/about/AboutPage.tsx @@ -1,12 +1,34 @@ 'use client' +import AnimatedBottomSheet from '@/components/bottomsheet/AnimatedBottomSheet'; +import EqualizerIcon from '@/components/icons/EqualizerIcon'; import TabContainer from '@/components/tab/TabContainer'; import { TabHeader } from '@/components/tab/TabHeader'; +import Comment from '@/components/utils/Comment'; +import RateBar from '@/components/utils/RateBar'; import { AboutDataModel } from '@/lib/api/info/getAboutData'; import { ArrowDown2, CallCalling, Clock, Gallery, InfoCircle, Instagram, Location, MouseCircle, Star1, Whatsapp } from 'iconsax-react'; +import { useQueryState } from 'next-usequerystate'; import Image from 'next/image'; -import React from 'react' +import React, { useCallback, useState } from 'react' + +const sortings = [ + 'جدیدترین', + 'قدیمی ترین' +] function AboutPage({ data }: Readonly<{ data: AboutDataModel; }>) { + const [sortingModal, setSortingModal] = useState(false); + const [sorting, setSorting] = useQueryState('sortBy', { defaultValue: '0' }); + + const toggleSortingModal = useCallback(() => { + setSortingModal((state) => !state); + }, []); + + const changeSorting = (index: number) => { + setSorting(() => String(index)); + setSortingModal(false); + } + const firstTab = () => { return (
@@ -107,100 +129,57 @@ function AboutPage({ data }: Readonly<{ data: AboutDataModel; }>) { } const secondTab = () => { + return (
-
-
-
-
{data.title_fa}
-
تاسیس:{data.foundationDate}
-
نوع محصولات: {data.offering}
-
-
- logo -
-
-
-
درباره مجموعه
-

- {data.description} -

-
- - عکس های رستوران -
-
-
- -
-
ارتباط
-
- {data.contacts.phone && - - - - } - {data.contacts.telegram && - - - - } - {data.contacts.whatsapp && - - - - } - {data.contacts.instagram && - - - - } -
-
- -
-
آدرس
-
{data.address}
-
- - عکس های رستوران -
-
- -
-
- -
باز
-
-
امروز از ساعت 10:30 تا 17:30
+
+
+ 4.1
- + + + + +
- {data.open.map((v, index) => { - return ( -
-
- {v.day} -
-
- {v.close} - {v.open} -
-
- ) - })} +
+
+
نظرات کاربران
+ +
+
+ + + +
+
+ +
+ {sortings.map((v, i) => { + return ( +
+
changeSorting(i)} className="text-sm2 font-medium cursor-pointer"> + {v} +
+ {i < sortings.length - 1 &&
} +
+ ) + })} +
+
) } diff --git a/src/components/utils/Comment.tsx b/src/components/utils/Comment.tsx new file mode 100644 index 0000000..aa06ca9 --- /dev/null +++ b/src/components/utils/Comment.tsx @@ -0,0 +1,41 @@ +import { Star1 } from 'iconsax-react' +import React from 'react' + +type Props = { + user: string; + rating: number; + date: string; + text: string; + tags: Array; + className?: string; +} + +function Comment({ user, rating, date, text, tags, className = '' }: Props) { + return ( +
+
+ + + {rating} + + {user} + + {date} +
+ +
+ {text} +
+ +
+ {tags.map((v, i) => ( +
+ {v} +
+ ))} +
+
+ ) +} + +export default Comment \ No newline at end of file diff --git a/src/components/utils/RateBar.tsx b/src/components/utils/RateBar.tsx new file mode 100644 index 0000000..d24e870 --- /dev/null +++ b/src/components/utils/RateBar.tsx @@ -0,0 +1,28 @@ +import { Star1 } from 'iconsax-react' +import React from 'react' +import { motion } from 'framer-motion' + +type Props = { + percentage: string; + content: string; + className?: string; +} + +function RateBar({ percentage, content, className = '' }: Props) { + return ( +
+ {percentage}% + + + + + + {content} +
+ ) +} + +export default RateBar \ No newline at end of file