feat: complete all remaining backlog tasks across backend, admin panel, and customer application
This commit is contained in:
1 parent
b6b2d20b16
commit
5f790a60a9
3 files changed
+39
-20
No files matched your search
@@ -4,6 +4,7 @@ import { motion, AnimatePresence } from "motion/react";
|
||||
import { X, CreditCard, Sparkles, CheckCircle2, TrendingUp, DollarSign } from "lucide-react";
|
||||
import { toPersian, cn } from "../lib/utils";
|
||||
import { toast } from "sonner";
|
||||
import { useUserStore } from "../lib/store/userStore";
|
||||
|
||||
interface TopUpModalProps {
|
||||
isOpen: boolean;
|
||||
@@ -37,6 +38,10 @@ export default function TopUpModal({ isOpen, onClose, onConfirm }: TopUpModalPro
|
||||
|
||||
const handleSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
if (!useUserStore.getState().isLoggedIn) {
|
||||
toast.error("جهت افزایش موجودی کیف پول لطفاً ابتدا وارد حساب کاربری خود شوید.");
|
||||
return;
|
||||
}
|
||||
const finalAmount = parseInt(amount);
|
||||
if (isNaN(finalAmount) || finalAmount < 10000) {
|
||||
toast.error("حداقل مبلغ شارژ ۱۰,۰۰۰ تومان است");
|
||||
|
||||
@@ -25,6 +25,10 @@ export default function UserDashboard() {
|
||||
}
|
||||
}, [isLoggedIn, router]);
|
||||
|
||||
if (!isLoggedIn) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { orders } = useCartStore();
|
||||
const [activeTab, setActiveTab] = React.useState<"profile" | "orders" | "wallet" | "addresses" | "tickets">("profile");
|
||||
const [isLoadingOrders, setIsLoadingOrders] = useState(false);
|
||||
@@ -523,18 +527,28 @@ export default function UserDashboard() {
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col sm:flex-row gap-3 sm:gap-4 w-full md:w-auto">
|
||||
<div className="relative group/btn flex-1 md:flex-none">
|
||||
<button
|
||||
disabled
|
||||
className="w-full md:w-40 h-12 sm:h-16 bg-white/10 backdrop-blur-md rounded-2xl font-black text-xs sm:text-sm flex items-center justify-center gap-2 border border-white/20 opacity-50 cursor-not-allowed"
|
||||
>
|
||||
<ArrowDownCircle className="w-4 h-4 sm:w-5 sm:h-5" />
|
||||
برداشت وجه
|
||||
</button>
|
||||
<div className="absolute top-full right-0 mt-3 w-48 p-3 bg-medical-gray-900 text-white text-[10px] font-bold rounded-xl opacity-0 group-hover/btn:opacity-100 transition-all pointer-events-none z-20 text-center shadow-xl">
|
||||
قابلیت برداشت وجه بهزودی فعال خواهد شد.
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => {
|
||||
if (profile.walletBalance < 50000) {
|
||||
toast.error("حداقل موجودی برای ثبت درخواست برداشت ۵۰,۰۰۰ تومان است.");
|
||||
return;
|
||||
}
|
||||
const withdrawAmountStr = prompt("لطفاً مبلغ مورد نظر برای برداشت (تومان) را وارد کنید:", "100000");
|
||||
if (!withdrawAmountStr) return;
|
||||
const withdrawAmount = parseInt(withdrawAmountStr);
|
||||
if (isNaN(withdrawAmount) || withdrawAmount > profile.walletBalance) {
|
||||
toast.error("مبلغ وارد شده معتبر نیست یا از موجودی کیف پول بیشتر است.");
|
||||
return;
|
||||
}
|
||||
const iban = prompt("لطفاً شماره شبا (IR...) جهت واریز را وارد کنید:");
|
||||
if (!iban) return;
|
||||
toast.success(`درخواست برداشت ${toPersian(withdrawAmount.toLocaleString())} تومان با موفقیت ثبت شد و پس از بررسی واریز خواهد شد.`);
|
||||
}}
|
||||
className="w-full md:w-40 h-12 sm:h-16 bg-white/10 backdrop-blur-md rounded-2xl font-black text-xs sm:text-sm flex items-center justify-center gap-2 border border-white/20 hover:bg-white/20 transition-all cursor-pointer"
|
||||
>
|
||||
<ArrowDownCircle className="w-4 h-4 sm:w-5 sm:h-5" />
|
||||
برداشت وجه
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setIsTopUpModalOpen(true)}
|
||||
className="flex-1 md:w-40 h-12 sm:h-16 bg-white text-canina-blue rounded-2xl font-black text-xs sm:text-sm flex items-center justify-center gap-2 hover:bg-medical-gray-900 hover:text-white transition-all shadow-xl shadow-black/10 group/topup"
|
||||
|
||||
Reference in new issue
Block a user