diff --git a/package.json b/package.json index 47efdd8..7d2e7c3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "enduser.salona", "private": true, - "version": "0.1.0", + "version": "0.2.0", "type": "module", "scripts": { "dev": "vite", diff --git a/src/App.css b/src/App.css index 5183207..df70129 100644 --- a/src/App.css +++ b/src/App.css @@ -9,6 +9,18 @@ font-style: normal; font-display: swap; } +@font-face { + font-family: 'Boblious'; + src: url('./assets/fonts/Boblious.ttf'); +} +@font-face { + font-family: 'Hayat'; + src: url('./assets/fonts/Hayat.ttf'); +} +@font-face { + font-family: 'DigiMadasi'; + src: url('./assets/fonts/DigiMadasi.ttf'); +} @layer base { :root { --background: 0 0% 100%; diff --git a/src/assets/fonts/Boblious.ttf b/src/assets/fonts/Boblious.ttf new file mode 100644 index 0000000..4d8b0fd Binary files /dev/null and b/src/assets/fonts/Boblious.ttf differ diff --git a/src/assets/fonts/DigiMadasi.ttf b/src/assets/fonts/DigiMadasi.ttf new file mode 100644 index 0000000..83680d8 Binary files /dev/null and b/src/assets/fonts/DigiMadasi.ttf differ diff --git a/src/assets/fonts/Hayat.ttf b/src/assets/fonts/Hayat.ttf new file mode 100644 index 0000000..5d0bf0a Binary files /dev/null and b/src/assets/fonts/Hayat.ttf differ diff --git a/src/assets/images/loyalty-cards/cosmetic1.png b/src/assets/images/loyalty-cards/cosmetic1.png new file mode 100644 index 0000000..1a5310f Binary files /dev/null and b/src/assets/images/loyalty-cards/cosmetic1.png differ diff --git a/src/assets/images/loyalty-cards/cosmetic2.png b/src/assets/images/loyalty-cards/cosmetic2.png new file mode 100644 index 0000000..7a44dc7 Binary files /dev/null and b/src/assets/images/loyalty-cards/cosmetic2.png differ diff --git a/src/assets/images/loyalty-cards/cosmetic3.png b/src/assets/images/loyalty-cards/cosmetic3.png new file mode 100644 index 0000000..35b3e59 Binary files /dev/null and b/src/assets/images/loyalty-cards/cosmetic3.png differ diff --git a/src/assets/images/loyalty-cards/cosmetic4.png b/src/assets/images/loyalty-cards/cosmetic4.png new file mode 100644 index 0000000..e490f34 Binary files /dev/null and b/src/assets/images/loyalty-cards/cosmetic4.png differ diff --git a/src/assets/images/loyalty-cards/loyaltyTopBg.png b/src/assets/images/loyalty-cards/loyaltyTopBg.png new file mode 100644 index 0000000..7cafda8 Binary files /dev/null and b/src/assets/images/loyalty-cards/loyaltyTopBg.png differ diff --git a/src/components/PageLoading.tsx b/src/components/PageLoading.tsx new file mode 100644 index 0000000..24c1b02 --- /dev/null +++ b/src/components/PageLoading.tsx @@ -0,0 +1,24 @@ +import React from 'react'; +import logo from '@/assets/images/logo.png'; + +type Props = { + show: boolean; + loadingText?: string; +}; + +export const PageLoading: React.FC = ({ + show, + loadingText = 'در حال بارگذاری اطلاعات', +}) => { + if (!show) return <>; + return ( +
+ .... +

{loadingText}

+
+ ); +}; diff --git a/src/pages/loyalty-cards/+components/Echo.tsx b/src/pages/loyalty-cards/+components/Echo.tsx new file mode 100644 index 0000000..369abaa --- /dev/null +++ b/src/pages/loyalty-cards/+components/Echo.tsx @@ -0,0 +1,89 @@ +import logo from '@/assets/images/logo.png'; +import { ILoyaltyCard } from '@/utils/types'; +import cosmetic1 from '@/assets/images/loyalty-cards/cosmetic1.png'; + +const Echo = (data: ILoyaltyCard) => { + return ( +
+
+ +

+ Loyalty Card +

+

+ {data.customer_name} +

+
+
+ {data.predicted_number_of_visits - data.number_of_visits <= 0 ? ( +
+ نوبت های این کارت به اتمام رسیده است +
+ ) : ( +
+ + {data.predicted_number_of_visits - data.number_of_visits}{' '} + + حضور دیگر مانده تا + دریافت جایزه +
+ )} +
+ جایزه: + {data.description_of_discount} +
+
+
= 6 + ? Math.ceil(data.predicted_number_of_visits / 2) + : 4 + }, minmax(0, 1fr))`, + }} + > + {Array.from( + { length: data.predicted_number_of_visits }, + (_, index) => { + if (index < data.number_of_visits) { + return ( +
+ +
+ ); + } + return ( +
+ +
+ ); + }, + )} +
+ {data.extera_description && ( +
+ توضیحات اضافی: + {data.extera_description} +
+ )} +
+
+ ); +}; + +export default Echo; diff --git a/src/pages/loyalty-cards/+components/Enchant.tsx b/src/pages/loyalty-cards/+components/Enchant.tsx new file mode 100644 index 0000000..70376b6 --- /dev/null +++ b/src/pages/loyalty-cards/+components/Enchant.tsx @@ -0,0 +1,85 @@ +import { ILoyaltyCard } from '@/utils/types'; +import cosmetic4 from '@/assets/images/loyalty-cards/cosmetic4.png'; + +const Enchant = (data: ILoyaltyCard) => { + return ( +
+
+

+ Loyalty Card +

+

{data.customer_name}

+
+
+ {data.predicted_number_of_visits - data.number_of_visits <= 0 ? ( +
+ نوبت های این کارت به اتمام رسیده است +
+ ) : ( +
+ + {data.predicted_number_of_visits - data.number_of_visits}{' '} + + حضور دیگر مانده تا + دریافت جایزه +
+ )} +
+ جایزه: + {data.description_of_discount} +
+
+
= 6 + ? Math.ceil(data.predicted_number_of_visits / 2) + : 4 + }, minmax(0, 1fr))`, + }} + > + {Array.from( + { length: data.predicted_number_of_visits }, + (_, index) => { + if (index < data.number_of_visits) { + return ( +
+ +
+ ); + } + return ( +
+ +
+ ); + }, + )} +
+ {data.extera_description && ( +
+ توضیحات اضافی: + {data.extera_description} +
+ )} +
+
+ ); +}; + +export default Enchant; diff --git a/src/pages/loyalty-cards/+components/LoyaltyCardListItem.tsx b/src/pages/loyalty-cards/+components/LoyaltyCardListItem.tsx index e204c12..52b872c 100644 --- a/src/pages/loyalty-cards/+components/LoyaltyCardListItem.tsx +++ b/src/pages/loyalty-cards/+components/LoyaltyCardListItem.tsx @@ -1,5 +1,5 @@ import { ILoyaltyCard } from '@/utils/types'; -import { EyeIcon, IdCardIcon } from 'lucide-react'; +import { EyeIcon, IdCardIcon, PhoneCallIcon } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { AccordionItem, @@ -7,6 +7,9 @@ import { AccordionContent, } from '@/components/ui/accordion'; import { formatPersianDate } from '@/utils/date-time'; +import { Link } from 'react-router-dom'; +import ROUTES_OBJECT from '@/routes/RoutesObject'; +import { HoverTooltip } from '@/components/ui/tooltip'; type Props = { data: ILoyaltyCard; @@ -22,23 +25,38 @@ const LoyaltyCardListItem = ({ data }: Props) => {
کارت وفاداری
-
+
-

- {data.customer_name} -

-
+
{data.predicted_number_of_visits - data.number_of_visits}{' '} حضور دیگر مانده تا دریافت{' '} جایزه
+
+

آرایشگر:

+
+

{data.artist.name}

+

{data.artist.phone_number}

+
+ + + + + +
+
-
- + - +