diff --git a/apps/backend-serverless/src/utilities/clients/create-loyalty-response.utility.ts b/apps/backend-serverless/src/utilities/clients/create-loyalty-response.utility.ts index 79139841..de481ae7 100644 --- a/apps/backend-serverless/src/utilities/clients/create-loyalty-response.utility.ts +++ b/apps/backend-serverless/src/utilities/clients/create-loyalty-response.utility.ts @@ -23,15 +23,18 @@ export const createLoyaltyResponse = async (merchant: Merchant): Promise} /> - {process.env.NEXT_PUBLIC_FEATURE_FLAG == 'true' && ( - } - text="Loyalty" - /> - )} + } + text="Loyalty" + disabled={process.env.NEXT_PUBLIC_FEATURE_FLAG == 'true'} + /> } text="Merchant" /> } text="Support" /> diff --git a/apps/merchant-ui/src/components/DefaultLayoutNavigationLink.tsx b/apps/merchant-ui/src/components/DefaultLayoutNavigationLink.tsx index 66dd7c9f..a237b7e2 100755 --- a/apps/merchant-ui/src/components/DefaultLayoutNavigationLink.tsx +++ b/apps/merchant-ui/src/components/DefaultLayoutNavigationLink.tsx @@ -1,3 +1,4 @@ +import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'; import * as NavigationMenu from '@radix-ui/react-navigation-menu'; import Link from 'next/link'; import { useRouter } from 'next/router'; @@ -10,51 +11,72 @@ interface Props { icon: JSX.Element; text: string; renderInRhs?: JSX.Element; + disabled?: boolean; } -export function DefaultLayoutNavigationLink(props: Props) { +export function DefaultLayoutNavigationLink({ disabled = false, ...props }: Props) { const router = useRouter(); const isSelected = router.asPath.startsWith(props.href); + const handleOnClick = (e: React.MouseEvent) => { + if (disabled) { + e.preventDefault(); + } + }; + return ( - - {cloneElement(props.icon, { - className: twMerge( - 'fill-slate-400', - 'h-6', - 'transition-colors', - 'w-6', - isSelected && 'fill-indigo-600', - props.icon.props.className, - ), - })} -
+ + + + {cloneElement(props.icon, { + className: twMerge( + 'fill-slate-400', + 'h-6', + 'transition-colors', + 'w-6', + isSelected && 'fill-indigo-600', + disabled && 'fill-gray-400', // Apply disabled styling to icon + props.icon.props.className + ), + })} +
+ {props.text} +
+ {props.renderInRhs &&
{props.renderInRhs}
} + +
+ {disabled && ( + +

Coming Soon

+
)} - > - {props.text} -
- {props.renderInRhs &&
{props.renderInRhs}
} - + +
); diff --git a/apps/merchant-ui/src/components/ui/tooltip.tsx b/apps/merchant-ui/src/components/ui/tooltip.tsx new file mode 100644 index 00000000..d8442a86 --- /dev/null +++ b/apps/merchant-ui/src/components/ui/tooltip.tsx @@ -0,0 +1,28 @@ +import * as TooltipPrimitive from '@radix-ui/react-tooltip'; +import * as React from 'react'; + +import { cn } from '@/lib/utils'; + +const TooltipProvider = TooltipPrimitive.Provider; + +const Tooltip = TooltipPrimitive.Root; + +const TooltipTrigger = TooltipPrimitive.Trigger; + +const TooltipContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, sideOffset = 4, ...props }, ref) => ( + +)); +TooltipContent.displayName = TooltipPrimitive.Content.displayName; + +export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }; diff --git a/apps/payment-ui/src/components/PayToLabel/index.tsx b/apps/payment-ui/src/components/PayToLabel/index.tsx index 23fbe573..6609ab9c 100644 --- a/apps/payment-ui/src/components/PayToLabel/index.tsx +++ b/apps/payment-ui/src/components/PayToLabel/index.tsx @@ -4,6 +4,7 @@ import { getPaymentDetails, getProductDetails, } from '@/features/payment-details/paymentDetailsSlice'; +import Image from 'next/image'; import { useEffect, useState } from 'react'; import { useSelector } from 'react-redux'; import { CartAmountDisplay, CartAmountLoading } from './CartAmountDisplay'; @@ -53,7 +54,6 @@ export const PayToLabel = () => { } } - const hasProductDetails = productDetails.length > 0; const showTierDiscount = loyaltyDetails?.loyaltyProgram === 'tiers' && customerTier && discount > 0 && customer.customerOwns; const showTierUpgrade = @@ -79,10 +79,8 @@ export const PayToLabel = () => { return (
- {/* */} - - {/* */} - + + {loyaltyDetails?.points.pointsBack && loyaltyDetails?.loyaltyProgram === 'points' && (

Points Back

@@ -92,7 +90,7 @@ export const PayToLabel = () => {
)} - {/* {hasProductDetails && ( + {productDetails.length > 0 && (

NFT Rewards

@@ -111,7 +109,7 @@ export const PayToLabel = () => { )}
- )} */} + )}
diff --git a/yarn.lock b/yarn.lock index 9425b15f..e9cd3293 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5159,7 +5159,7 @@ "@radix-ui/react-use-layout-effect" "1.0.1" "@radix-ui/react-visually-hidden" "1.0.3" -"@radix-ui/react-tooltip@^1.0.5": +"@radix-ui/react-tooltip@^1.0.6": version "1.0.6" resolved "https://registry.yarnpkg.com/@radix-ui/react-tooltip/-/react-tooltip-1.0.6.tgz#87a7786cd9f2b4de957ac645afae1575339c58b0" integrity sha512-DmNFOiwEc2UDigsYj6clJENma58OelxD24O4IODoZ+3sQc3Zb+L8w1EP+y9laTuKCLAysPw4fD6/v0j4KNV8rg==