From 67ab3c7228acad48aaaf8067fbc4491d314f5dc9 Mon Sep 17 00:00:00 2001 From: Michio Date: Thu, 31 Aug 2023 19:33:45 +0330 Subject: [PATCH 1/3] chore: fix active link in internal links --- src/features/components/atoms/link/internal.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/features/components/atoms/link/internal.tsx b/src/features/components/atoms/link/internal.tsx index e1c7173dcce..4e2eed6e224 100644 --- a/src/features/components/atoms/link/internal.tsx +++ b/src/features/components/atoms/link/internal.tsx @@ -1,4 +1,4 @@ -import React from 'react' +import React, { useEffect, useState } from 'react' import { Link } from 'gatsby' import language_config from '../../../../../i18n-config.js' import { LinkProps } from '.' @@ -66,6 +66,8 @@ const Internal = ({ link_rel, active_urls, }: InternalProps) => { + const [is_active, setIsActive] = useState(false) + let rawLocale = 'en' if (isBrowser()) { rawLocale = localStorage.getItem('i18n') ?? 'en' @@ -77,7 +79,9 @@ const Internal = ({ const to = is_non_localized || is_default ? url.to : `/${path}${url.to}` - const is_active = isActiveLink(url.to, active_urls) + useEffect(() => { + setIsActive(isActiveLink(url.to, active_urls)) + }, [active_urls, url.to]) return ( Date: Thu, 31 Aug 2023 20:01:08 +0330 Subject: [PATCH 2/3] chore: fix prime logo --- .../navigation/payment-agent-nav/index.tsx | 15 +++++++-------- src/features/pages/partners/deriv-prime/index.tsx | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/features/components/templates/navigation/payment-agent-nav/index.tsx b/src/features/components/templates/navigation/payment-agent-nav/index.tsx index 812cedf151b..a238a7a8518 100644 --- a/src/features/components/templates/navigation/payment-agent-nav/index.tsx +++ b/src/features/components/templates/navigation/payment-agent-nav/index.tsx @@ -13,7 +13,7 @@ import Flex from 'features/components/atoms/flex-box' import { getLocationPathname } from 'common/utility' import useScrollToElement from 'features/hooks/use-scroll-to-element' -const PaymentAgentAffiliateNav = () => { +const PaymentAgentAffiliateNav = ({ is_prime_page = false }: { is_prime_page?: boolean }) => { const path_name = getLocationPathname() const clickToScrollHandler = useScrollToElement('getintouch') @@ -67,15 +67,14 @@ const PaymentAgentAffiliateNav = () => { - + {is_prime_page ? ( + + ) : ( + + )} )} items={affiliateNavItems} diff --git a/src/features/pages/partners/deriv-prime/index.tsx b/src/features/pages/partners/deriv-prime/index.tsx index 47128ea9b0c..6ad431f5874 100644 --- a/src/features/pages/partners/deriv-prime/index.tsx +++ b/src/features/pages/partners/deriv-prime/index.tsx @@ -26,7 +26,7 @@ const DerivPrime = () => { - + From 927c785342def7ea6c427bf213270f5194a1a4f2 Mon Sep 17 00:00:00 2001 From: Hasan Mobarak <126637868+hasan-deriv@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:28:02 +0800 Subject: [PATCH 3/3] Hasan/Pr 00 table refactor (#5515) * fix: fixed table layout and typescript issue * fix: added layout to faq table --- src/features/components/atoms/table/base/index.tsx | 4 +++- .../components/atoms/table/shadow-table/index.tsx | 2 +- .../deriv-prime/browse-our-faq/faq-commercial-plan.tsx | 1 + .../partners/deriv-prime/commercial-plan/index.tsx | 1 + src/features/styles/theme/table.scss | 10 +++++----- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/features/components/atoms/table/base/index.tsx b/src/features/components/atoms/table/base/index.tsx index a1721bdf05e..7a5a4fd6b32 100644 --- a/src/features/components/atoms/table/base/index.tsx +++ b/src/features/components/atoms/table/base/index.tsx @@ -8,6 +8,7 @@ import { ClassProps } from 'features/types' export interface TableProps extends BoxProps, ClassProps { striped?: boolean + layout?: 'fixed' | 'auto' data: T[] columns: Array> } @@ -16,6 +17,7 @@ function BaseTable({ data, columns, striped, + layout, className, ...rest }: TableProps) { @@ -24,7 +26,7 @@ function BaseTable({ className={dclsx('table-responsive', { ['table-striped']: striped }, className)} {...rest} > - +
diff --git a/src/features/components/atoms/table/shadow-table/index.tsx b/src/features/components/atoms/table/shadow-table/index.tsx index 9f5264194e3..a9a8f51dae8 100644 --- a/src/features/components/atoms/table/shadow-table/index.tsx +++ b/src/features/components/atoms/table/shadow-table/index.tsx @@ -2,7 +2,7 @@ import React from 'react' import BaseTable, { TableProps } from '../base' import dclsx from 'features/utils/dclsx' -const ShadowTable = ({ className, ...rest }: TableProps) => { +function ShadowTable({ className, ...rest }: TableProps) { return } diff --git a/src/features/pages/partners/deriv-prime/browse-our-faq/faq-commercial-plan.tsx b/src/features/pages/partners/deriv-prime/browse-our-faq/faq-commercial-plan.tsx index 0feb8927b2b..640bd62994e 100644 --- a/src/features/pages/partners/deriv-prime/browse-our-faq/faq-commercial-plan.tsx +++ b/src/features/pages/partners/deriv-prime/browse-our-faq/faq-commercial-plan.tsx @@ -23,6 +23,7 @@ const FAQCommercialPlan = () => { data={data} columns={column_data} striped + layout="fixed" className={commercial_table_faq} /> diff --git a/src/features/pages/partners/deriv-prime/commercial-plan/index.tsx b/src/features/pages/partners/deriv-prime/commercial-plan/index.tsx index 0c736dc7660..381dbf8eeb7 100644 --- a/src/features/pages/partners/deriv-prime/commercial-plan/index.tsx +++ b/src/features/pages/partners/deriv-prime/commercial-plan/index.tsx @@ -27,6 +27,7 @@ const CommercialPlan = () => { data={data} columns={column_data} striped + layout="fixed" className={commercial_table} /> diff --git a/src/features/styles/theme/table.scss b/src/features/styles/theme/table.scss index 4383f215d3e..ce7d9401f4b 100644 --- a/src/features/styles/theme/table.scss +++ b/src/features/styles/theme/table.scss @@ -9,6 +9,11 @@ .table { inline-size: 100%; background-color: transparent; + th, td { + line-height: 1.8; + } +} +.table-layout-fixed { table-layout: fixed; } .table-shadow { @@ -29,9 +34,4 @@ background-color: $color-white-1; } } -} - -th, td { - line-height: 1.8!important; - } \ No newline at end of file