Skip to content

Commit

Permalink
Merge pull request deriv-com#44 from deriv-com/sandeep/fix-icons
Browse files Browse the repository at this point in the history
sandeep/refactor: 🔥 updated icons from quill-icons and localization
  • Loading branch information
sandeep-deriv authored Aug 26, 2024
2 parents 26968f7 + 63355a0 commit d988166
Show file tree
Hide file tree
Showing 176 changed files with 342 additions and 328 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@deriv-com/utils": "latest",
"@deriv/deriv-charts": "^2.1.23",
"@deriv/js-interpreter": "^3.0.0",
"@deriv/quill-icons": "~1.23.10",
"@deriv/quill-icons": "~1.23.12",
"@svgr/core": "^8.1.0",
"@tanstack/react-query": "^5.29.2",
"blockly": "^10.4.3",
Expand Down
8 changes: 3 additions & 5 deletions src/components/download/download.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { observer } from 'mobx-react-lite';
import { useStore } from '@/hooks/useStore';
import { downloadFile, getSuccessJournalMessage, TTransaction } from '@/utils/download';
import { Icon, localize } from '@/utils/tmp/dummy';
import { localize } from '@/utils/tmp/dummy';
import { Localize } from '@deriv-com/translations';
import { Button } from '@deriv-com/ui';
import Popover from '../shared_ui/popover';

Expand Down Expand Up @@ -96,16 +97,13 @@ const Download = observer(({ tab }: TDownloadProps) => {
id='download-button'
disabled={disabled}
className='download__button'
icon={
<Icon icon='IcDbotDownload' color={disabled ? 'disabled' : undefined} className='download__icon' />
}
onClick={clickFunction}
variant='outlined'
color='black'
size='sm'
textSize='sm'
>
{localize('Download')}
<Localize i18n_default_text='Download' />
</Button>
</Popover>
);
Expand Down
10 changes: 7 additions & 3 deletions src/components/flyout/flyout-block-group.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import classNames from 'classnames';
import { Localize } from '@/utils/tmp/dummy';
import { LabelPairedPlusLgFillIcon } from '@deriv/quill-icons';
import { Button, Text } from '@deriv-com/ui';
import FlyoutBlock from './flyout-block';

Expand All @@ -23,11 +24,14 @@ const FlyoutBlockGroup = ({ onInfoClick, block_node, is_active, should_hide_disp
id={`db-flyout__add--${block_type}`}
data-testid={`dt_flyout__add_${block_type}`}
className='flyout__button-add flyout__button-add--hide'
has_effect
is_plus
onClick={() => window.Blockly.derivWorkspace.addBlockNode(block_node)}
type='button'
/>
variant='outlined'
color='black'
size='sm'
>
<LabelPairedPlusLgFillIcon height='24px' width='24px' />
</Button>
</div>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/flyout/help-contents/flyout-help-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { observer } from 'mobx-react-lite';
import { useStore } from '@/hooks/useStore';
import { help_content_config, help_content_types } from '@/utils/help-content/help-content.config';
import { localize } from '@/utils/tmp/dummy';
import { LabelPairedArrowLeftCaptionRegularIcon } from '@deriv/quill-icons';
import { localize } from '@deriv-com/translations';
import { Button, Text } from '@deriv-com/ui';
import FlyoutBlock from '../flyout-block';
import FlyoutImage from './flyout-img';
Expand Down
40 changes: 20 additions & 20 deletions src/components/run-panel/run-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Transactions from '@/components/transactions';
import { DBOT_TABS } from '@/constants/bot-contents';
import { popover_zindex } from '@/constants/z-indexes';
import { useStore } from '@/hooks/useStore';
import { Localize, localize } from '@/utils/tmp/dummy';
import { Localize, localize } from '@deriv-com/translations';
import { Button, Modal, Text } from '@deriv-com/ui';
import ThemedScrollbars from '../shared_ui/themed-scrollbars';

Expand Down Expand Up @@ -130,13 +130,13 @@ const DrawerContent = ({ active_index, is_drawer_open, active_tour, setActiveTab
return (
<>
<Tabs active_index={active_index} onTabItemClick={setActiveTabIndex} top>
<div id='db-run-panel-tab__summary' label={localize('Summary')}>
<div id='db-run-panel-tab__summary' label={<Localize i18n_default_text='Summary' />}>
<Summary is_drawer_open={is_drawer_open} />
</div>
<div id='db-run-panel-tab__transactions' label={localize('Transactions')}>
<div id='db-run-panel-tab__transactions' label={<Localize i18n_default_text='Transactions' />}>
<Transactions is_drawer_open={is_drawer_open} />
</div>
<div id='db-run-panel-tab__journal' label={localize('Journal')}>
<div id='db-run-panel-tab__journal' label={<Localize i18n_default_text='Journal' />}>
<Journal />
</div>
</Tabs>
Expand All @@ -157,7 +157,9 @@ const DrawerFooter = ({ is_clear_stat_disabled, onClearStatClick }: TDrawerFoote
size='sm'
textSize='sm'
>
<span>{localize('Reset')}</span>
<span>
<Localize i18n_default_text='Reset' />
</span>
</Button>
</div>
);
Expand Down Expand Up @@ -189,40 +191,38 @@ const StatisticsInfoModal = ({
<div className={classNames('statistics__modal-body', { 'statistics__modal-body--mobile': is_mobile })}>
<ThemedScrollbars className='statistics__modal-scrollbar'>
<Text as='p' weight='bold' className='statistics__modal-body--content no-margin'>
{localize('Total stake')}
<Localize i18n_default_text='Total stake' />
</Text>
<Text as='p'>
<Localize i18n_default_text='Total stake since you last cleared your stats.' />
</Text>
<Text as='p'>{localize('Total stake since you last cleared your stats.')}</Text>
<Text as='p' weight='bold' className='statistics__modal-body--content'>
{localize('Total payout')}
<Localize i18n_default_text='Total payout' />
</Text>
<Text as='p'>{localize('Total payout since you last cleared your stats.')}</Text>
<Text as='p' weight='bold' className='statistics__modal-body--content'>
{localize('No. of runs')}
<Localize i18n_default_text='No. of runs' />
</Text>
<Text as='p'>
{localize(
'The number of times your bot has run since you last cleared your stats. Each run includes the execution of all the root blocks.'
)}
<Localize i18n_default_text='The number of times your bot has run since you last cleared your stats. Each run includes the execution of all the root blocks.' />
</Text>
<Text as='p' weight='bold' className='statistics__modal-body--content'>
{localize('Contracts lost')}
<Localize i18n_default_text='Contracts lost' />
</Text>
<Text as='p'>
{localize('The number of contracts you have lost since you last cleared your stats.')}
<Localize i18n_default_text='The number of contracts you have lost since you last cleared your stats.' />
</Text>
<Text as='p' weight='bold' className='statistics__modal-body--content'>
{localize('Contracts won')}
<Localize i18n_default_text='Contracts won' />
</Text>
<Text as='p'>
{localize('The number of contracts you have won since you last cleared your stats.')}
<Localize i18n_default_text='The number of contracts you have won since you last cleared your stats.' />
</Text>
<Text as='p' weight='bold' className='statistics__modal-body--content'>
{localize('Total profit/loss')}
<Localize i18n_default_text='Total profit/loss' />
</Text>
<Text as='p'>
{localize(
'Your total profit/loss since you last cleared your stats. It is the difference between your total payout and your total stake.'
)}
<Localize i18n_default_text='Your total profit/loss since you last cleared your stats. It is the difference between your total payout and your total stake.' />
</Text>
</ThemedScrollbars>
</div>
Expand Down
18 changes: 13 additions & 5 deletions src/components/shared_ui/popover/popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import React, { RefObject } from 'react';
import classNames from 'classnames';
import { ArrowContainer, Popover as TinyPopover } from 'react-tiny-popover';
import { useHover, useHoverCallback } from '@/hooks/useHover';
import { Icon } from '@/utils/tmp/dummy';
import {
LabelPairedCircleDotCaptionFillIcon,
LabelPairedCircleInfoCaptionRegularIcon,
LegacyWarningIcon,
} from '@deriv/quill-icons';
import { Text, useDevice } from '@deriv-com/ui';
import { TPopoverProps } from '../types';

Expand Down Expand Up @@ -189,7 +193,7 @@ const Popover = ({
>
{!disable_message_icon && icon === 'info' && (
<i className='dc-popover__bubble__icon'>
<Icon icon='IcInfoBlue' />
<LabelPairedCircleInfoCaptionRegularIcon />
</i>
)}
{(has_error && (
Expand All @@ -214,9 +218,13 @@ const Popover = ({
message ? 'dc-popover__target__icon' : 'dc-popover__target__icon--disabled'
}
>
{icon === 'info' && <Icon icon='IcInfoOutline' className={icon_class_name} />}
{icon === 'question' && <Icon icon='IcUnknown' className={icon_class_name} />}
{icon === 'dot' && <Icon icon='IcCircle' className={icon_class_name} size={4} />}
{icon === 'info' && (
<LabelPairedCircleInfoCaptionRegularIcon className={icon_class_name} />
)}
{icon === 'question' && <LegacyWarningIcon className={icon_class_name} />}
{icon === 'dot' && (
<LabelPairedCircleDotCaptionFillIcon className={icon_class_name} />
)}
{icon === 'counter' && <span className={icon_class_name}>{counter}</span>}
</i>
)}
Expand Down
6 changes: 3 additions & 3 deletions src/components/shared_ui/tooltip/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { useHover } from '@/hooks/useHover';
import { Icon } from '@/utils/tmp/dummy';
import { LabelPairedCircleInfoCaptionRegularIcon } from '@deriv/quill-icons';

type TTooltip = {
alignment: string;
Expand Down Expand Up @@ -33,9 +34,8 @@ const Tooltip = ({
>
{icon === 'info' && (
<React.Fragment>
<Icon icon='IcInfoOutline' className={icon_class} ref={hover_ref} />
<Icon
icon='IcInfoBlue'
<LabelPairedCircleInfoCaptionRegularIcon className={icon_class} ref={hover_ref} />
<LabelPairedCircleInfoCaptionRegularIcon
className={classNames(`${classNameIcon}-balloon-icon`, 'dc-tooltip__balloon-icon', {
'dc-tooltip__balloon-icon--show': show_tooltip_balloon_icon_on_hover,
})}
Expand Down
10 changes: 6 additions & 4 deletions src/components/summary/summary-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { observer } from 'mobx-react-lite';
import { getCardLabels, getContractTypeDisplay } from '@/components/shared';
import ContractCard from '@/components/shared_ui/contract-card';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import { Localize } from '@deriv-com/translations';
import { Text } from '@deriv-com/ui';

const SummaryCard = observer(({ contract_info, is_contract_loading }: TSummaryCardProps) => {
Expand Down Expand Up @@ -96,9 +96,11 @@ const SummaryCard = observer(({ contract_info, is_contract_loading }: TSummaryCa
)}
{!is_contract_loading && !contract_info && (
<Text as='p' LineHeight='md' size='sm' weight='lighter'>
{localize('When you’re ready to trade, hit ')}
<strong>{localize('Run')}</strong>
{localize('. You’ll be able to track your bot’s performance here.')}
<Localize i18n_default_text='When you’re ready to trade, hit ' />
<strong>
<Localize i18n_default_text='Run' />
</strong>
<Localize i18n_default_text='. You’ll be able to track your bot’s performance here.' />
</Text>
)}
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/components/transactions/transactions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { contract_stages } from '@/constants/contract-stage';
import { transaction_elements } from '@/constants/transactions';
import { useNewRowTransition } from '@/hooks/useNewRowTransition';
import { useStore } from '@/hooks/useStore';
import { DataList, Icon } from '@/utils/tmp/dummy';
import { DataList } from '@/utils/tmp/dummy';
import { DerivLightEmptyCardboardBoxIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Button, Text } from '@deriv-com/ui';
Expand Down Expand Up @@ -116,7 +116,6 @@ const Transactions = observer(({ is_drawer_open }: TTransactions) => {
onClick={() => {
toggleTransactionDetailsModal(true);
}}
icon={<Icon icon='IcDbotViewDetail' size={18} />}
variant='outlined'
color='black'
size='sm'
Expand Down
35 changes: 0 additions & 35 deletions src/constants/dashboard.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { localize } from '@/utils/tmp/dummy';

export const STRATEGY = {
OPEN: 'open',
EDIT: 'edit',
Expand All @@ -9,36 +7,3 @@ export const STRATEGY = {
PREVIEW_LIST: 'list',
INIT: 'init',
};

export const MENU_DESKTOP = [
{
type: STRATEGY.OPEN,
icon: 'IcOpen',
},
{
type: STRATEGY.SAVE,
icon: 'IcSave',
},
{
type: STRATEGY.DELETE,
icon: 'IcTrash',
},
];

export const CONTEXT_MENU_MOBILE = [
{
type: STRATEGY.OPEN,
icon: 'IcOpen',
label: localize('Open'),
},
{
type: STRATEGY.SAVE,
icon: 'IcSave',
label: localize('Save'),
},
{
type: STRATEGY.DELETE,
icon: 'IcTrash',
label: localize('Delete'),
},
];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';
import { config } from '../constants/config';
import ApiHelpers from '../services/api/api-helpers';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

window.Blockly.Blocks.procedures_callnoreturn = {
init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

window.Blockly.Blocks.procedures_callreturn = {
init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';
import { removeExtraInput } from '../../../utils';
import { plusIconLight } from '../../images';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';
import { plusIconDark } from '../../images';

window.Blockly.Blocks.procedures_defreturn = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

/**
* Block for conditionally returning a value from a procedure.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';
import { runGroupedEvents, runIrreversibleEvents } from '../../../utils';
import { plusIconDark } from '../../images';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

window.Blockly.Blocks.lists_getIndex = {
init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

window.Blockly.Blocks.lists_getSublist = {
init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

window.Blockly.Blocks.lists_indexOf = {
init() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

window.Blockly.Blocks.lists_isEmpty = {
init() {
Expand Down
Loading

0 comments on commit d988166

Please sign in to comment.