From 4f4ae46411334f447533c59315be11fa545444fe Mon Sep 17 00:00:00 2001 From: hasan-deriv Date: Fri, 15 Sep 2023 16:34:15 +0800 Subject: [PATCH] feat: added hide in condition to markets --- src/features/components/molecules/other-markets-slider/data.ts | 2 ++ .../components/molecules/other-markets-slider/index.tsx | 1 + 2 files changed, 3 insertions(+) diff --git a/src/features/components/molecules/other-markets-slider/data.ts b/src/features/components/molecules/other-markets-slider/data.ts index 7fa1ea84706..e8f59a4fa1d 100644 --- a/src/features/components/molecules/other-markets-slider/data.ts +++ b/src/features/components/molecules/other-markets-slider/data.ts @@ -18,6 +18,7 @@ export type MarketPageType = export type OtherMarketsConfig = { current_market: MarketPageType is_eu: boolean + hide_in: MarketPageType } export type SmartOtherMarketsItem = TSmartContent @@ -117,6 +118,7 @@ export const other_markets_items: SmartOtherMarketsItem[] = [ }, visibility: { current_market: 'commodities', + hide_in: 'etfs', }, }, ] diff --git a/src/features/components/molecules/other-markets-slider/index.tsx b/src/features/components/molecules/other-markets-slider/index.tsx index 953efb76e8a..b6e5e62d377 100644 --- a/src/features/components/molecules/other-markets-slider/index.tsx +++ b/src/features/components/molecules/other-markets-slider/index.tsx @@ -30,6 +30,7 @@ const OtherMarketsSlider = ({ config: { current_market: (market_page) => market_page !== current_market, is_eu: (item_is_eu) => item_is_eu === undefined || is_eu === item_is_eu, + hide_in: (market_page) => market_page === undefined || market_page !== current_market, }, }) const is_no_linkAvailable = !!available_markets?.length