fix: set 100 MVR for default wallet topup amount 🔧

This commit is contained in:
2025-09-20 14:25:48 +05:00
parent f2a17d522b
commit 19043aa692
3 changed files with 151 additions and 151 deletions

View File

@@ -1,4 +1,3 @@
import { cn } from "@/lib/utils";
import { Minus, Plus } from "lucide-react"; import { Minus, Plus } from "lucide-react";
import { useEffect } from "react"; import { useEffect } from "react";
import { import {
@@ -8,18 +7,19 @@ import {
Label, Label,
NumberField, NumberField,
} from "react-aria-components"; } from "react-aria-components";
import { cn } from "@/lib/utils";
export default function NumberInput({ export default function NumberInput({
maxAllowed, maxAllowed,
label, label,
value, value = 100,
onChange, onChange,
className, className,
isDisabled, isDisabled,
}: { }: {
maxAllowed?: number; maxAllowed?: number;
label: string; label: string;
value: number; value?: number;
onChange: (value: number) => void; onChange: (value: number) => void;
className?: string; className?: string;
isDisabled?: boolean; isDisabled?: boolean;
@@ -31,6 +31,7 @@ export default function NumberInput({
} }
} }
}, [maxAllowed, value, onChange]); }, [maxAllowed, value, onChange]);
return ( return (
<NumberField <NumberField
isDisabled={isDisabled} isDisabled={isDisabled}

View File

@@ -39,8 +39,7 @@ export function Wallet({ walletBalance }: { walletBalance: number }) {
<Drawer open={isOpen} onOpenChange={setIsOpen}> <Drawer open={isOpen} onOpenChange={setIsOpen}>
<DrawerTrigger asChild> <DrawerTrigger asChild>
<Button onClick={() => setIsOpen(!isOpen)} variant="outline"> <Button onClick={() => setIsOpen(!isOpen)} variant="outline">
{walletBalance}{" "} {walletBalance} MVR
MVR
<Wallet2 /> <Wallet2 />
</Button> </Button>
</DrawerTrigger> </DrawerTrigger>

View File

@@ -10,7 +10,7 @@ export const discountPercentageAtom = atom(75);
export const numberOfDevicesAtom = atom(1); export const numberOfDevicesAtom = atom(1);
export const numberOfDaysAtom = atom(30); export const numberOfDaysAtom = atom(30);
export const numberOfMonths = atom(1); export const numberOfMonths = atom(1);
export const walletTopUpValue = atom(1); export const walletTopUpValue = atom(100);
export const formulaResultAtom = atom(""); export const formulaResultAtom = atom("");
export const deviceCartAtom = atom<Device[]>([]); export const deviceCartAtom = atom<Device[]>([]);
export const cartDrawerOpenAtom = atom(false); export const cartDrawerOpenAtom = atom(false);