From 329bd0eafe1ef6ed7eb84f5283fedd133e238a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyauheni-kryzhyk-deriv=E2=80=9D?= <“yauheni@deriv.me”> Date: Fri, 28 Oct 2022 14:19:58 +0300 Subject: [PATCH 1/4] yauheni/74116/formsubheader ts mifration --- .../{form-sub-header.spec.js => form-sub-header.spec.tsx} | 4 ++-- .../{form-sub-header.jsx => form-sub-header.tsx} | 8 +++++++- packages/account/src/Components/form-sub-header/index.js | 3 --- packages/account/src/Components/form-sub-header/index.ts | 3 +++ .../Sections/Profile/PersonalDetails/personal-details.jsx | 5 +---- packages/components/stories/icon/icons.js | 3 +-- 6 files changed, 14 insertions(+), 12 deletions(-) rename packages/account/src/Components/form-sub-header/__tests__/{form-sub-header.spec.js => form-sub-header.spec.tsx} (89%) rename packages/account/src/Components/form-sub-header/{form-sub-header.jsx => form-sub-header.tsx} (86%) delete mode 100644 packages/account/src/Components/form-sub-header/index.js create mode 100644 packages/account/src/Components/form-sub-header/index.ts diff --git a/packages/account/src/Components/form-sub-header/__tests__/form-sub-header.spec.js b/packages/account/src/Components/form-sub-header/__tests__/form-sub-header.spec.tsx similarity index 89% rename from packages/account/src/Components/form-sub-header/__tests__/form-sub-header.spec.js rename to packages/account/src/Components/form-sub-header/__tests__/form-sub-header.spec.tsx index b881b5baff2a..dcce80c2d066 100644 --- a/packages/account/src/Components/form-sub-header/__tests__/form-sub-header.spec.js +++ b/packages/account/src/Components/form-sub-header/__tests__/form-sub-header.spec.tsx @@ -1,10 +1,10 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; -import { FormSubHeader } from '../form-sub-header'; +import { FormSubHeader, TFormSubHeader } from '../form-sub-header'; describe('Testing FormSubHeader component', () => { it('should render properties', () => { - const props = { + const props: TFormSubHeader = { title: 'test-title', subtitle: 'test-subtitle', description: 'lorem ipsum', diff --git a/packages/account/src/Components/form-sub-header/form-sub-header.jsx b/packages/account/src/Components/form-sub-header/form-sub-header.tsx similarity index 86% rename from packages/account/src/Components/form-sub-header/form-sub-header.jsx rename to packages/account/src/Components/form-sub-header/form-sub-header.tsx index 5e0a32bc2c8f..747613640a3a 100644 --- a/packages/account/src/Components/form-sub-header/form-sub-header.jsx +++ b/packages/account/src/Components/form-sub-header/form-sub-header.tsx @@ -2,7 +2,13 @@ import classNames from 'classnames'; import React from 'react'; import { Text } from '@deriv/components'; -export const FormSubHeader = ({ title, subtitle, description }) => { +export type TFormSubHeader = { + description?: string; + subtitle?: string; + title: string; +}; + +export const FormSubHeader = ({ description, subtitle, title }: TFormSubHeader) => { const title_as_class = title.replace(/\s+/g, '-').toLowerCase(); return ( diff --git a/packages/account/src/Components/form-sub-header/index.js b/packages/account/src/Components/form-sub-header/index.js deleted file mode 100644 index 25b7a78b341a..000000000000 --- a/packages/account/src/Components/form-sub-header/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import { FormSubHeader } from './form-sub-header.jsx'; - -export default FormSubHeader; diff --git a/packages/account/src/Components/form-sub-header/index.ts b/packages/account/src/Components/form-sub-header/index.ts new file mode 100644 index 000000000000..48f2cc87eeb4 --- /dev/null +++ b/packages/account/src/Components/form-sub-header/index.ts @@ -0,0 +1,3 @@ +import { FormSubHeader } from './form-sub-header'; + +export default FormSubHeader; diff --git a/packages/account/src/Sections/Profile/PersonalDetails/personal-details.jsx b/packages/account/src/Sections/Profile/PersonalDetails/personal-details.jsx index 29f7c81e7875..daba24c00a60 100644 --- a/packages/account/src/Sections/Profile/PersonalDetails/personal-details.jsx +++ b/packages/account/src/Sections/Profile/PersonalDetails/personal-details.jsx @@ -1084,10 +1084,7 @@ export const PersonalDetailsForm = ({ <>
- +
diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 909eeb8ed34e..5f0415e45363 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -147,7 +147,6 @@ export const icons = 'IcCashierPaymentAgent', 'IcCashierPaypalDark', 'IcCashierPaypalLight', - 'IcCashierPaymentAgent', 'IcCashierPerfectMoneyDark', 'IcCashierPerfectMoneyLight', 'IcCashierPermatabankDark', @@ -877,4 +876,4 @@ export const icons = 'IcWalletZingpayDark', 'IcWalletZingpayLight', ], -}; +} From 590b381059f3d4109961db877e9583638a5133a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyauheni-kryzhyk-deriv=E2=80=9D?= <“yauheni@deriv.me”> Date: Mon, 31 Oct 2022 15:47:13 +0300 Subject: [PATCH 2/4] icons semicolon fix --- packages/components/stories/icon/icons.js | 31 +++++++++++------------ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 5f0415e45363..7448e4a1c02b 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -1,8 +1,7 @@ // auto-generated file. DO NOT MODIFY. -export const icons = -{ - 'brand': [ +export const icons = { + brand: [ 'IcBrandBinarybot', 'IcBrandDbot', 'IcBrandDerivApps', @@ -15,7 +14,7 @@ export const icons = 'IcBrandDxtrade', 'IcBrandSmarttrader', ], - 'cashier': [ + cashier: [ 'IcCashierAdd', 'IcCashierAirTmDark', 'IcCashierAirTmLight', @@ -196,7 +195,7 @@ export const icons = 'IcCashierZenithbankLight', 'IcCashier', ], - 'common': [ + common: [ 'IcAccountCross', 'IcAccountDontGetScam', 'IcAccountError', @@ -481,7 +480,7 @@ export const icons = 'IcZoomIn', 'IcZoomOut', ], - 'contract': [ + contract: [ 'IcContractBarrier', 'IcContractBuyPrice', 'IcContractCommission', @@ -497,7 +496,7 @@ export const icons = 'IcContractStartTime', 'IcContractTarget', ], - 'currency': [ + currency: [ 'IcCurrencyAud', 'IcCurrencyBch', 'IcCurrencyBtc', @@ -520,7 +519,7 @@ export const icons = 'IcCurrencyUst', 'IcCurrencyVirtual', ], - 'dxtrade': [ + dxtrade: [ 'IcDxtradeDerivX', 'IcDxtradeDerived', 'IcDxtradeDerivxPlatform', @@ -537,7 +536,7 @@ export const icons = 'IcDxtradeOnePassword', 'IcDxtradeSyntheticPlatform', ], - 'flag': [ + flag: [ 'IcFlagDe', 'IcFlagEn', 'IcFlagEs', @@ -553,7 +552,7 @@ export const icons = 'IcFlagZhCn', 'IcFlagZhTw', ], - 'mt5': [ + mt5: [ 'IcMt5CfdPlatform', 'IcMt5Cfds', 'IcMt5Derived', @@ -580,7 +579,7 @@ export const icons = 'IcMt5SyntheticPlatform', 'IcMt5TradeTypes', ], - 'option': [ + option: [ 'IcOptionCallPutReset', 'IcOptionCallPutSpread', 'IcOptionCloseToLow', @@ -598,7 +597,7 @@ export const icons = 'IcOptionTouchNotouch', 'IcOptionUpDownAsian', ], - 'stock': [ + stock: [ 'IcStockAdidasSalomon', 'IcStockAlibaba', 'IcStockAlphabet', @@ -648,7 +647,7 @@ export const icons = 'IcStockWaltDisney', 'IcStockZoom', ], - 'tradetype': [ + tradetype: [ 'IcTradetypeAsiand', 'IcTradetypeAsianu', 'IcTradetypeCallBarrier', @@ -683,7 +682,7 @@ export const icons = 'IcTradetypeTicklow', 'IcTradetypeUpordown', ], - 'underlying': [ + underlying: [ 'IcUnderlying1HZ100V', 'IcUnderlying1HZ10V', 'IcUnderlying1HZ200V', @@ -840,7 +839,7 @@ export const icons = 'IcUnderlyingWLDUSD', 'IcUnderlyingWLDXAU', ], - 'wallet': [ + wallet: [ 'IcWalletClearFunds', 'IcWalletCreditDebitDark', 'IcWalletCreditDebitLight', @@ -876,4 +875,4 @@ export const icons = 'IcWalletZingpayDark', 'IcWalletZingpayLight', ], -} +}; From 7e45d9d48be94180472cd3abbe602b9399e31533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyauheni-kryzhyk-deriv=E2=80=9D?= <“yauheni@deriv.me”> Date: Mon, 31 Oct 2022 15:52:54 +0300 Subject: [PATCH 3/4] icons auto generate fix --- packages/components/stories/icon/icons.js | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 7448e4a1c02b..5f0415e45363 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -1,7 +1,8 @@ // auto-generated file. DO NOT MODIFY. -export const icons = { - brand: [ +export const icons = +{ + 'brand': [ 'IcBrandBinarybot', 'IcBrandDbot', 'IcBrandDerivApps', @@ -14,7 +15,7 @@ export const icons = { 'IcBrandDxtrade', 'IcBrandSmarttrader', ], - cashier: [ + 'cashier': [ 'IcCashierAdd', 'IcCashierAirTmDark', 'IcCashierAirTmLight', @@ -195,7 +196,7 @@ export const icons = { 'IcCashierZenithbankLight', 'IcCashier', ], - common: [ + 'common': [ 'IcAccountCross', 'IcAccountDontGetScam', 'IcAccountError', @@ -480,7 +481,7 @@ export const icons = { 'IcZoomIn', 'IcZoomOut', ], - contract: [ + 'contract': [ 'IcContractBarrier', 'IcContractBuyPrice', 'IcContractCommission', @@ -496,7 +497,7 @@ export const icons = { 'IcContractStartTime', 'IcContractTarget', ], - currency: [ + 'currency': [ 'IcCurrencyAud', 'IcCurrencyBch', 'IcCurrencyBtc', @@ -519,7 +520,7 @@ export const icons = { 'IcCurrencyUst', 'IcCurrencyVirtual', ], - dxtrade: [ + 'dxtrade': [ 'IcDxtradeDerivX', 'IcDxtradeDerived', 'IcDxtradeDerivxPlatform', @@ -536,7 +537,7 @@ export const icons = { 'IcDxtradeOnePassword', 'IcDxtradeSyntheticPlatform', ], - flag: [ + 'flag': [ 'IcFlagDe', 'IcFlagEn', 'IcFlagEs', @@ -552,7 +553,7 @@ export const icons = { 'IcFlagZhCn', 'IcFlagZhTw', ], - mt5: [ + 'mt5': [ 'IcMt5CfdPlatform', 'IcMt5Cfds', 'IcMt5Derived', @@ -579,7 +580,7 @@ export const icons = { 'IcMt5SyntheticPlatform', 'IcMt5TradeTypes', ], - option: [ + 'option': [ 'IcOptionCallPutReset', 'IcOptionCallPutSpread', 'IcOptionCloseToLow', @@ -597,7 +598,7 @@ export const icons = { 'IcOptionTouchNotouch', 'IcOptionUpDownAsian', ], - stock: [ + 'stock': [ 'IcStockAdidasSalomon', 'IcStockAlibaba', 'IcStockAlphabet', @@ -647,7 +648,7 @@ export const icons = { 'IcStockWaltDisney', 'IcStockZoom', ], - tradetype: [ + 'tradetype': [ 'IcTradetypeAsiand', 'IcTradetypeAsianu', 'IcTradetypeCallBarrier', @@ -682,7 +683,7 @@ export const icons = { 'IcTradetypeTicklow', 'IcTradetypeUpordown', ], - underlying: [ + 'underlying': [ 'IcUnderlying1HZ100V', 'IcUnderlying1HZ10V', 'IcUnderlying1HZ200V', @@ -839,7 +840,7 @@ export const icons = { 'IcUnderlyingWLDUSD', 'IcUnderlyingWLDXAU', ], - wallet: [ + 'wallet': [ 'IcWalletClearFunds', 'IcWalletCreditDebitDark', 'IcWalletCreditDebitLight', @@ -875,4 +876,4 @@ export const icons = { 'IcWalletZingpayDark', 'IcWalletZingpayLight', ], -}; +} From b808b1032fc0bba40a1199916d9e701e5f67d312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyauheni-kryzhyk-deriv=E2=80=9D?= <“yauheni@deriv.me”> Date: Mon, 31 Oct 2022 15:58:53 +0300 Subject: [PATCH 4/4] icons auto generate fix --- packages/components/stories/icon/icons.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/components/stories/icon/icons.js b/packages/components/stories/icon/icons.js index 5f0415e45363..909eeb8ed34e 100644 --- a/packages/components/stories/icon/icons.js +++ b/packages/components/stories/icon/icons.js @@ -147,6 +147,7 @@ export const icons = 'IcCashierPaymentAgent', 'IcCashierPaypalDark', 'IcCashierPaypalLight', + 'IcCashierPaymentAgent', 'IcCashierPerfectMoneyDark', 'IcCashierPerfectMoneyLight', 'IcCashierPermatabankDark', @@ -876,4 +877,4 @@ export const icons = 'IcWalletZingpayDark', 'IcWalletZingpayLight', ], -} +};