Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Henry/dtra 282/rewrite contract type info component #9352

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f23fa41
fix: initialize
henry-deriv Jun 12, 2023
40398ec
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jun 14, 2023
5bcd845
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jun 14, 2023
a2ff546
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jul 4, 2023
c701b6b
fix: ts migrate and add test coverage to ContractType folder
henry-deriv Jul 4, 2023
83427ac
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jul 4, 2023
fba7a58
fix: remove unused import
henry-deriv Jul 4, 2023
eff7100
fix: TS Error due to name and value not being intrinsic attribute to …
henry-deriv Jul 4, 2023
52c01cf
fix: add test cases
henry-deriv Jul 5, 2023
2e657cb
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jul 5, 2023
62fe2af
fix: code smells
henry-deriv Jul 5, 2023
3c8392f
fix: consistency issue
henry-deriv Jul 5, 2023
bf41388
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jul 5, 2023
fd4b375
fix: code smell
henry-deriv Jul 5, 2023
c2f778e
fix: minor change
henry-deriv Jul 5, 2023
d57cd20
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jul 5, 2023
bc35be6
Merge branch 'master' of github.com:binary-com/deriv-app into henry/t…
henry-deriv Jul 14, 2023
fdd4a4c
fix: rewrite contract-type-info to get rid of visual bug when switchi…
henry-deriv Jul 14, 2023
39e4416
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 14, 2023
e0b1124
fix: remove unused import
henry-deriv Jul 14, 2023
cfdab01
fix: remove unused css
henry-deriv Jul 14, 2023
4dd6725
fix: refactor component
henry-deriv Jul 15, 2023
a7a2f35
fix: small word change
henry-deriv Jul 18, 2023
b314f0f
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 18, 2023
73b55b7
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 20, 2023
f44cee2
fix: resolve comments
henry-deriv Jul 20, 2023
e7b9aa9
fix: resolve comments
henry-deriv Jul 20, 2023
1857bf2
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Jul 20, 2023
bc20a17
fix: empty commit
henry-deriv Jul 21, 2023
03a2d0b
fix: code smells
henry-deriv Jul 21, 2023
f14c077
fix: circleCI
henry-deriv Jul 21, 2023
61f476d
fix: resolve comments
henry-deriv Jul 21, 2023
a3e7d81
fix: missing import
henry-deriv Jul 21, 2023
a8fa242
fix: remove scroll for contract-type-info
henry-deriv Jul 21, 2023
dc7d35f
fix: resolve conflicts
henry-deriv Aug 1, 2023
0ec4f23
fix: resolve conflicts and merge master
henry-deriv Aug 1, 2023
50b98b6
Merge branch 'master' of github.com:binary-com/deriv-app into henry/d…
henry-deriv Aug 1, 2023
13e96e7
fix: resolve conflicts
henry-deriv Aug 10, 2023
ebe5a0b
fix: remove useeffect as per comment
henry-deriv Aug 10, 2023
21049cb
fix: remove css styling
henry-deriv Aug 15, 2023
a0913b5
fix: resolve conflicts
henry-deriv Aug 16, 2023
d43075e
fix: circleCI
henry-deriv Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const VerticalTabHeaderGroup = ({
})}
onClick={handleClick}
>
<HeaderIcon icon={group.icon} is_active={selected} />
<HeaderIcon icon={group.icon ?? ''} is_active={selected} />
<Header text={label} />
{is_collapsible && (
<Icon
Expand All @@ -83,7 +83,7 @@ const VerticalTabHeaderGroup = ({
})}
onClick={handleClick}
>
<HeaderIcon icon={group.icon} is_active={selected} />
<HeaderIcon icon={group.icon ?? ''} is_active={selected} />
<Header text={label} />
{is_collapsible && (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ export type THeader = {
};

export type TItem = {
component?: typeof React.Component;
component?: JSX.Element | null;
count?: number;
default?: boolean;
getTitle?: () => string;
has_side_note?: boolean;
icon: string;
icon?: string;
is_hidden?: boolean;
is_disabled?: boolean;
key?: string;
label?: string;
path?: string;
subitems?: number[];
Expand Down Expand Up @@ -88,7 +89,7 @@ const VerticalTabHeader = ({
'dc-vertical-tab__header--active': is_active,
})}
>
<HeaderIcon icon={item.icon} is_active={is_active} />
<HeaderIcon icon={item.icon ?? ''} is_active={is_active} />
<Header text={label} path={item.path} />
{!!count && <Counter count={count} className='dc-vertical-tab__header__counter' />}
{children}
Expand All @@ -102,7 +103,7 @@ const VerticalTabHeader = ({
})}
onClick={handleClick}
>
<HeaderIcon icon={item.icon} is_active={is_active} />
<HeaderIcon icon={item.icon ?? ''} is_active={is_active} />
<Header text={label} />
{children}
<>{item.component}</>
Expand Down
36 changes: 18 additions & 18 deletions packages/components/stories/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const icons =
'IcAppstoreWalletUsdLight',
'IcAppstoreWalletUsdcLight',
'IcAppstoreWalletUsdtLight',
'IcAppstoreWarning',
'IcAppstoreWarning'
],
'brand': [
'IcBrandDerivEzWordmark',
Expand All @@ -64,7 +64,7 @@ export const icons =
'IcBrandDmt5FinancialStp',
'IcBrandDmt5Financial',
'IcBrandDmt5Synthetics',
'IcBrandDxtradeWordmark',
'IcBrandDxtradeWordmark'
],
'cashier': [
'IcCashierAdd',
Expand Down Expand Up @@ -238,7 +238,7 @@ export const icons =
'IcCashierWyreLight',
'IcCashierZenithbankDark',
'IcCashierZenithbankLight',
'IcCashier',
'IcCashier'
],
'common': [
'IcAccountCross',
Expand Down Expand Up @@ -611,7 +611,7 @@ export const icons =
'IcWip',
'IcZingpay',
'IcZoomIn',
'IcZoomOut',
'IcZoomOut'
],
'contract': [
'IcContractBarrier',
Expand All @@ -629,7 +629,7 @@ export const icons =
'IcContractStartTimeCircle',
'IcContractStartTime',
'IcContractStrike',
'IcContractTarget',
'IcContractTarget'
],
'currency': [
'IcCurrencyAud',
Expand All @@ -653,10 +653,10 @@ export const icons =
'IcCurrencyUsdc',
'IcCurrencyUsdk',
'IcCurrencyUst',
'IcCurrencyVirtual',
'IcCurrencyVirtual'
],
'derivez': [
'IcDerivez',
'IcDerivez'
],
'dxtrade': [
'IcDxtradeDerivX',
Expand All @@ -673,7 +673,7 @@ export const icons =
'IcDxtradeFinancialPlatform',
'IcDxtradeFinancial',
'IcDxtradeOnePassword',
'IcDxtradeSyntheticPlatform',
'IcDxtradeSyntheticPlatform'
],
'flag': [
'IcFlagDe',
Expand All @@ -690,7 +690,7 @@ export const icons =
'IcFlagUk',
'IcFlagVi',
'IcFlagZhCn',
'IcFlagZhTw',
'IcFlagZhTw'
],
'mt5': [
'IcMt5Acuity',
Expand Down Expand Up @@ -719,7 +719,7 @@ export const icons =
'IcMt5SyntheticDashboard',
'IcMt5SyntheticIndices',
'IcMt5SyntheticPlatform',
'IcMt5TradeTypes',
'IcMt5TradeTypes'
],
'option': [
'IcOptionAccumulators',
Expand All @@ -737,7 +737,7 @@ export const icons =
'IcOptionOverUnder',
'IcOptionRaiseFall',
'IcOptionTouchNotouch',
'IcOptionUpDownAsian',
'IcOptionUpDownAsian'
],
'rebranding': [
'IcRebrandingBinaryBot',
Expand All @@ -758,7 +758,7 @@ export const icons =
'IcRebrandingDxtrade',
'IcRebrandingMt5Logo',
'IcRebrandingSmarttraderDashboard',
'IcRebrandingSmarttrader',
'IcRebrandingSmarttrader'
],
'stock': [
'IcStockAdidasSalomon',
Expand Down Expand Up @@ -808,7 +808,7 @@ export const icons =
'IcStockVisa',
'IcStockWallMart',
'IcStockWaltDisney',
'IcStockZoom',
'IcStockZoom'
],
'tradetype': [
'IcTradetypeAccu',
Expand Down Expand Up @@ -848,7 +848,7 @@ export const icons =
'IcTradetypeTurbosshort',
'IcTradetypeUpordown',
'IcTradetypeVanillaLongCall',
'IcTradetypeVanillaLongPut',
'IcTradetypeVanillaLongPut'
],
'underlying': [
'IcUnderlying1HZ100V',
Expand Down Expand Up @@ -1007,7 +1007,7 @@ export const icons =
'IcUnderlyingWLDEUR',
'IcUnderlyingWLDGBP',
'IcUnderlyingWLDUSD',
'IcUnderlyingWLDXAU',
'IcUnderlyingWLDXAU'
],
'wallet': [
'IcWalletClearFunds',
Expand Down Expand Up @@ -1043,6 +1043,6 @@ export const icons =
'IcWalletWebmoneyLight',
'IcWalletWebmoney',
'IcWalletZingpayDark',
'IcWalletZingpayLight',
],
}
'IcWalletZingpayLight'
]
}
2 changes: 1 addition & 1 deletion packages/shared/src/utils/route/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React from 'react';
// TODO: Add test cases for this
type TRoute = {
component?: React.ComponentType;
component?: JSX.Element | null;
default?: boolean;
exact?: boolean;
getTitle?: () => string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { findContractCategory } from 'Modules/Trading/Helpers/contract-type';
import { observer, useStore } from '@deriv/stores';

type TContractType = {
text: string;
text?: string;
value: string;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ContractTypeGlossary = ({ category }: { category: string }) => {
{
type: 'paragraph',
text: localize(
'The spot price may change by the time your order reaches our servers. When this happens, your payout maybe affected.'
'The spot price may change by the time your order reaches our servers. When this happens, your payout may be affected.'
),
},
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Icon, Text } from '@deriv/components';

const Header = ({ onClickGoBack, text_size = 's', title }) => (
type THeader = {
onClickGoBack?: () => void;
text_size?: string;
title: string;
};

const Header = ({ onClickGoBack, text_size = 's', title }: THeader) => (
<div className='contract-type-info__action-bar'>
<span className='contract-type-info__icon' id='dt_contract_info_back_nav' onClick={onClickGoBack}>
<Icon icon='IcArrowLeftBold' />
Expand All @@ -13,10 +18,4 @@ const Header = ({ onClickGoBack, text_size = 's', title }) => (
</div>
);

Header.propTypes = {
onClickGoBack: PropTypes.func,
text_size: PropTypes.string,
title: PropTypes.string,
};

export default Header;
Loading