diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 2c6ed536fc..795a6814b0 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -114,7 +114,7 @@ jobs: VITE_TAG: ${{ needs.prepare.outputs.image_tag }} CURRENT_BRANCH: ${{ needs.prepare.outputs.current_branch }} NODE_OPTIONS: '--max_old_space_size=4096' - run: yarn build + run: yarn build-stg - name: Docker build and push uses: docker/build-push-action@v2 diff --git a/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx b/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx index 853f48254c..23898d57d5 100644 --- a/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx +++ b/src/components/Announcement/PrivateAnnoucement/InboxItemLO.tsx @@ -1,6 +1,6 @@ import { ChainId } from '@kyberswap/ks-sdk-core' import { t } from '@lingui/macro' -import { Repeat } from 'react-feather' +import { Repeat, XCircle } from 'react-feather' import { useNavigate } from 'react-router-dom' import { PrivateAnnouncementProp } from 'components/Announcement/PrivateAnnoucement' @@ -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,10 +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 ${increasedFilledPercent}` + : isFilled ? t`100% Filled` : isPartialFilled ? t`${filledPercent} Filled ${increasedFilledPercent}` @@ -55,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) } @@ -68,11 +73,13 @@ function InboxItemBridge({ {!isRead && } - {statusMessage} + {statusMessage} {isFilled ? ( ) : isPartialFilled ? ( + ) : isReorg ? ( + ) : ( )} @@ -87,7 +94,7 @@ function InboxItemBridge({ logoURL={takerAssetLogoURL} /> - {takingAmountRate} {makerAssetSymbol}/{takerAssetSymbol} + {takingAmountRate} {takerAssetSymbol}/{makerAssetSymbol} diff --git a/src/components/Announcement/PrivateAnnoucement/NotificationCenter/LimitOrder.tsx b/src/components/Announcement/PrivateAnnoucement/NotificationCenter/LimitOrder.tsx index b46b03ccb0..591991e81d 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' @@ -33,15 +34,21 @@ export default function AnnouncementItem({ takingAmount, takingAmountRate, filledPercent, + increasedFilledPercent, 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 {increasedFilledPercent} + + ) : isFilled ? ( successfully filled @@ -57,7 +64,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/constants/env.ts b/src/constants/env.ts index abde3ec43e..f8de26a7a4 100644 --- a/src/constants/env.ts +++ b/src/constants/env.ts @@ -124,21 +124,21 @@ const ANNOUNCEMENT_TEMPLATE_IDS: { [key in EnvKeys]: TemplateConfig } = { }, staging: { [PrivateAnnouncementType.PRICE_ALERT]: '30', - [PrivateAnnouncementType.LIMIT_ORDER]: '14,15,16,17', + [PrivateAnnouncementType.LIMIT_ORDER]: '14,15,16,17,31', [PrivateAnnouncementType.BRIDGE_ASSET]: '12,13', [PrivateAnnouncementType.CROSS_CHAIN]: '25,26', [PrivateAnnouncementType.ELASTIC_POOLS]: '20,21', [PrivateAnnouncementType.DIRECT_MESSAGE]: '', - EXCLUDE: '2,11,1,28,29,22,23', + EXCLUDE: '2,11,1,28,29,22,23,27', }, production: { [PrivateAnnouncementType.PRICE_ALERT]: '29', - [PrivateAnnouncementType.LIMIT_ORDER]: '12,13,14,15', + [PrivateAnnouncementType.LIMIT_ORDER]: '12,13,14,15,31', [PrivateAnnouncementType.BRIDGE_ASSET]: '10,11', [PrivateAnnouncementType.CROSS_CHAIN]: '27,28', [PrivateAnnouncementType.ELASTIC_POOLS]: '17,18', [PrivateAnnouncementType.DIRECT_MESSAGE]: '', - EXCLUDE: '2,16,19,9,25,24,21,22', + EXCLUDE: '2,16,19,9,25,24,21,22,25,26,30', }, }