From 8b6c0b07dedbc6f5545ab58f1c245888634291d7 Mon Sep 17 00:00:00 2001 From: soheil khaledabadi Date: Fri, 4 Sep 2026 17:34:52 +0330 Subject: [PATCH] fix: remove expired status from profile filter, show order code - Drop the now-unused "expired" filter option/status (the API never returns expired services anymore). - Show the order code next to each service in the config card and in the service details modal. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01KMLvfLviDB12t4U9UijE4k --- .../profile/section/components/ConfigFilterBar.tsx | 6 ------ src/pages/profile/section/components/ConfigItem.tsx | 13 ++++++++++++- .../section/components/ModalConfigDetails.tsx | 7 +++++++ src/types/props.d.ts | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/pages/profile/section/components/ConfigFilterBar.tsx b/src/pages/profile/section/components/ConfigFilterBar.tsx index ead9a3d..000da35 100644 --- a/src/pages/profile/section/components/ConfigFilterBar.tsx +++ b/src/pages/profile/section/components/ConfigFilterBar.tsx @@ -1,7 +1,6 @@ import { IoAppsOutline, IoCheckmarkCircle, - IoCloseCircle, IoTimeOutline, } from "react-icons/io5"; import { Config } from "../../../../types/props"; @@ -20,11 +19,6 @@ const STATUS_META: Record< icon: , activeClass: "!bg-green-600 !text-white", }, - expired: { - label: "منقضی شده", - icon: , - activeClass: "!bg-rose-600 !text-white", - }, pending: { label: "در انتظار ثبت", icon: , diff --git a/src/pages/profile/section/components/ConfigItem.tsx b/src/pages/profile/section/components/ConfigItem.tsx index e0514b6..7de72f3 100644 --- a/src/pages/profile/section/components/ConfigItem.tsx +++ b/src/pages/profile/section/components/ConfigItem.tsx @@ -114,6 +114,7 @@ const ConfigItem = ({ isOpen={isOpen} setIsOpen={setIsOpen} dateBuy={dateBuy} + orderId={orderId} isDisabled={isDisabled} nameConfig={configName} isShowTraffic={isShowTraffic} @@ -166,9 +167,19 @@ const ConfigItem = ({ className={`w-full h-full p-3 rounded-md text-xs md:text-base gap-2 flex justify-between items-center flex-wrap text-secondTheme bg-gray-900 shadow-md shadow-gray-900 ${isDisabled ? "filter blur-sm" : "" }`} > -

تاریخ خرید : {dateBuy}

+
+

تاریخ خرید : {dateBuy}

+ {orderId && ( +

کد سفارش : #{orderId}

+ )} +
  • {configName} + {orderId && ( + + کد سفارش: #{orderId} + + )}
  • {isDns ? ( diff --git a/src/pages/profile/section/components/ModalConfigDetails.tsx b/src/pages/profile/section/components/ModalConfigDetails.tsx index 8c64acb..4c87387 100644 --- a/src/pages/profile/section/components/ModalConfigDetails.tsx +++ b/src/pages/profile/section/components/ModalConfigDetails.tsx @@ -18,6 +18,7 @@ const ModalConfigDetails = ({ setIsOpen, isDisabled, dateBuy, + orderId, nameConfig, isShowTraffic, textCopy, @@ -36,6 +37,7 @@ const ModalConfigDetails = ({ setIsOpen: Dispatch>; isDisabled: boolean; dateBuy: string; + orderId?: number; nameConfig: string; isShowTraffic: boolean; textCopy: string; @@ -86,6 +88,11 @@ const ModalConfigDetails = ({

    تاریخ خرید : {dateBuy} + {orderId && ( + + کد سفارش : #{orderId} + + )}

    {isDisabled || useMaxTraffic ? ( diff --git a/src/types/props.d.ts b/src/types/props.d.ts index 0323682..f0649ac 100644 --- a/src/types/props.d.ts +++ b/src/types/props.d.ts @@ -233,7 +233,7 @@ type Config = { username?: string | null; category_id: number; is_expired: boolean; - status?: "active" | "expired" | "pending"; + status?: "active" | "pending"; use_max_traffic: boolean; primary_ipv4?: string | null; secondary_ipv4?: string | null;