diff --git a/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx b/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx index 737c4286df..9ebbe3c94d 100644 --- a/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx +++ b/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx @@ -18,6 +18,7 @@ import { CheckCircle } from 'components/Icons' import DeltaTokenAmount from 'components/WalletPopup/Transactions/DeltaTokenAmount' import { LimitOrderStatus } from 'components/swapv2/LimitOrder/type' import { APP_PATHS } from 'constants/index' +import { NETWORKS_INFO } from 'constants/networks' import useTheme from 'hooks/useTheme' function InboxItemBridge({ @@ -44,11 +45,14 @@ function InboxItemBridge({ takingAmountRate, chainId: rawChainId, } = templateBody?.order || {} + const isReorg = templateBody.isReorg const isFilled = status === LimitOrderStatus.FILLED const isPartialFilled = status === LimitOrderStatus.PARTIALLY_FILLED const chainId = rawChainId && rawChainId !== '{{.chainId}}' ? (Number(rawChainId) as ChainId) : undefined - const statusMessage = isFilled + const statusMessage = isReorg + ? t`Reverted` + : isFilled ? t`100% Filled` : isPartialFilled ? t`${filledPercent} Filled ${increasedFilledPercent}` @@ -56,7 +60,7 @@ function InboxItemBridge({ const navigate = useNavigate() const onClick = () => { - navigate(APP_PATHS.LIMIT) + navigate(`${APP_PATHS.LIMIT}/${NETWORKS_INFO[+templateBody.order.chainId as ChainId]?.route}`) onRead(announcement, statusMessage) } diff --git a/src/components/Announcement/PrivateAnnoucement/NotificationCenter/LimitOrder.tsx b/src/components/Announcement/PrivateAnnoucement/NotificationCenter/LimitOrder.tsx index b46b03ccb0..5a9b59807d 100644 --- a/src/components/Announcement/PrivateAnnoucement/NotificationCenter/LimitOrder.tsx +++ b/src/components/Announcement/PrivateAnnoucement/NotificationCenter/LimitOrder.tsx @@ -9,6 +9,7 @@ import { AnnouncementTemplateLimitOrder } from 'components/Announcement/type' import Logo from 'components/Logo' import { LimitOrderStatus } from 'components/swapv2/LimitOrder/type' import { APP_PATHS } from 'constants/index' +import { NETWORKS_INFO } from 'constants/networks' import useTheme from 'hooks/useTheme' import { formatTime } from 'utils/time' @@ -36,12 +37,17 @@ export default function AnnouncementItem({ chainId: rawChainId, takerAssetLogoURL, } = templateBody?.order || {} + const isReorg = templateBody.isReorg const isFilled = status === LimitOrderStatus.FILLED const isPartialFilled = status === LimitOrderStatus.PARTIALLY_FILLED const chainId = rawChainId && rawChainId !== '{{.chainId}}' ? (Number(rawChainId) as ChainId) : undefined const theme = useTheme() - const statusMessage = isFilled ? ( + const statusMessage = isReorg ? ( + + reverted ({filledPercent} filled) + + ) : isFilled ? ( successfully filled @@ -57,7 +63,7 @@ export default function AnnouncementItem({ const navigate = useNavigate() return ( - navigate(APP_PATHS.LIMIT)}> + navigate(`${APP_PATHS.LIMIT}/${NETWORKS_INFO[chainId || ChainId.MAINNET].route}`)}> <InboxIcon type={templateType} chainId={chainId} /> diff --git a/src/components/Announcement/type.ts b/src/components/Announcement/type.ts index aaeabef73b..ef631ffa3d 100644 --- a/src/components/Announcement/type.ts +++ b/src/components/Announcement/type.ts @@ -67,6 +67,7 @@ type PoolPositionAnnouncement = { export type AnnouncementTemplateLimitOrder = { order: LimitOrderAnnouncement popupType: PopupType + isReorg: boolean } export type AnnouncementTemplateCrossChain = { transaction: CrossChainTransfer; popupType: PopupType } export type AnnouncementTemplateBridge = { transaction: MultichainTransfer; popupType: PopupType } diff --git a/src/pages/NotificationCenter/PrivateAnnouncement.tsx b/src/pages/NotificationCenter/PrivateAnnouncement.tsx index ff528fd835..f05816e153 100644 --- a/src/pages/NotificationCenter/PrivateAnnouncement.tsx +++ b/src/pages/NotificationCenter/PrivateAnnouncement.tsx @@ -46,7 +46,6 @@ export default function GeneralAnnouncement({ type }: { type?: PrivateAnnounceme isLoading: isLoadingAll, } = useGetPrivateAnnouncementsQuery({ page, pageSize: ITEMS_PER_PAGE }, { skip: !!templateIds }) - console.log(type, respNotificationByType, dataAllNotification) const [ackAnnouncement] = useAckPrivateAnnouncementsByIdsMutation() const [clearAllAnnouncement] = useClearAllPrivateAnnouncementByIdMutation()