From c4ca28e91da2e10da8d4f86f21991a778a011286 Mon Sep 17 00:00:00 2001 From: fahad yaseen Date: Fri, 21 Feb 2025 18:31:33 +0500 Subject: [PATCH] fix: Added UI-Fix: On Store profile view page , add relevant icons against the data like Add a dollar sign ($) icon next to monetary values (e.g. pricing, min-order amount --- .../profile/restaurant/main/index.tsx | 194 ++++++++++-------- 1 file changed, 104 insertions(+), 90 deletions(-) diff --git a/enatega-multivendor-admin/lib/ui/screen-components/protected/restaurant/profile/restaurant/main/index.tsx b/enatega-multivendor-admin/lib/ui/screen-components/protected/restaurant/profile/restaurant/main/index.tsx index 6ffd0efa..f00b0323 100644 --- a/enatega-multivendor-admin/lib/ui/screen-components/protected/restaurant/profile/restaurant/main/index.tsx +++ b/enatega-multivendor-admin/lib/ui/screen-components/protected/restaurant/profile/restaurant/main/index.tsx @@ -1,90 +1,104 @@ -import React, { useContext } from 'react'; -import { ProfileLogoSVG } from '@/lib/utils/assets/svgs/profile'; -import { IInfoItemProps } from '@/lib/utils/interfaces/profile/restaurant.profile.interface'; -import { Avatar } from 'primereact/avatar'; -import { ProfileContext } from '@/lib/context/restaurant/profile.context'; -import RestaurantProfileSkeleton from '@/lib/ui/useable-components/custom-skeletons/restaurant.profile.skeleton'; -import Image from 'next/image'; -import { useTranslations } from 'next-intl'; - -const InfoItem: React.FC = ({ label, value }) => ( -
-

{label}

-

{value || 'N/A'}

-
-); - -const RestaurantMain: React.FC = () => { - // Hooks - const t = useTranslations(); - - // Context - const { restaurantProfileResponse } = useContext(ProfileContext); - const restaurant = restaurantProfileResponse?.data?.restaurant; - - if (restaurantProfileResponse.loading) return ; - - return ( -
-
-
- -
-

{t('Store Name')}

-

{restaurant?.name || 'N/A'}

-
-
-
-
- - -
-

{t('Images')}

-
- {restaurant?.image ? ( - {t('Store - ) : ( - - )} - {restaurant?.logo ? ( - {t('Store - ) : ( - - )} -
-
- - - - - - - -
-
-
- ); -}; - -export default RestaurantMain; +import React, { useContext } from 'react'; +import { ProfileLogoSVG } from '@/lib/utils/assets/svgs/profile'; +import { IInfoItemProps } from '@/lib/utils/interfaces/profile/restaurant.profile.interface'; +import { Avatar } from 'primereact/avatar'; +import { ProfileContext } from '@/lib/context/restaurant/profile.context'; +import RestaurantProfileSkeleton from '@/lib/ui/useable-components/custom-skeletons/restaurant.profile.skeleton'; +import Image from 'next/image'; +import { useTranslations } from 'next-intl'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faClock, faDollarSign } from '@fortawesome/free-solid-svg-icons'; + +const InfoItem: React.FC = ({ label, value }) => { + // Conditionally render icons based on label + let icon = null; + if (label === 'Delivery Time' || label === 'Min Order') { + icon = ; + } else if (label === 'Service Charges') { + icon = ; + } + return ( +
+

{label}

+

+ {icon} + {value || 'N/A'} +

+
+ ); +}; + +const RestaurantMain: React.FC = () => { + // Hooks + const t = useTranslations(); + + // Context + const { restaurantProfileResponse } = useContext(ProfileContext); + const restaurant = restaurantProfileResponse?.data?.restaurant; + + if (restaurantProfileResponse.loading) return ; + + return ( +
+
+
+ +
+

{t('Store Name')}

+

{restaurant?.name || 'N/A'}

+
+
+
+
+ + +
+

{t('Images')}

+
+ {restaurant?.image ? ( + {t('Store + ) : ( + + )} + {restaurant?.logo ? ( + {t('Store + ) : ( + + )} +
+
+ + + + + + + +
+
+
+ ); +}; + +export default RestaurantMain;