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

Fix: Replaced svgs that have existing icons in quill icons #40

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions src/components/AdvertiserName/AdvertiserNameStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import clsx from 'clsx';
import { DeepPartial, TAdvertiserStats } from 'types';
import { OnlineStatusIcon, OnlineStatusLabel, StarRating } from '@/components';
import { getCurrentRoute } from '@/utils';
import { LabelPairedCircleUserSlashSmRegularIcon, LabelPairedThumbsUpSmRegularIcon } from '@deriv/quill-icons';
import { Text, useDevice } from '@deriv-com/ui';
import ThumbUpIcon from '../../public/ic-thumb-up.svg?react';
import BlockedUserOutlineIcon from '../../public/ic-user-blocked-outline.svg?react';
import './AdvertiserNameStats.scss';

/**
Expand Down Expand Up @@ -72,7 +71,7 @@ const AdvertiserNameStats = ({ advertiserStats }: { advertiserStats: DeepPartial
</div>
</div>
<div>
<ThumbUpIcon />
<LabelPairedThumbsUpSmRegularIcon />
<Text color='less-prominent' size='sm'>
{recommendedAverage || 0}%
</Text>
Expand All @@ -81,7 +80,7 @@ const AdvertiserNameStats = ({ advertiserStats }: { advertiserStats: DeepPartial
)}
{isMyProfile && (
<div>
<BlockedUserOutlineIcon />
<LabelPairedCircleUserSlashSmRegularIcon />
<Text color='less-prominent' size='sm'>
{blockedByCount || 0}
</Text>
Expand Down
5 changes: 2 additions & 3 deletions src/components/Clipboard/Clipboard.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//TODO: to be replaced with derivcom component
import { useEffect, useRef, useState } from 'react';
import { useCopyToClipboard } from 'usehooks-ts';
import { LegacyCopy1pxIcon, LegacyWonIcon } from '@deriv/quill-icons';
import { Tooltip } from '@deriv-com/ui';
import CheckmarkCircle from '../../public/ic-checkmark-circle.svg?react';
import CopyIcon from '../../public/ic-clipboard.svg?react';
import './Clipboard.scss';

type TClipboardProps = {
Expand Down Expand Up @@ -35,7 +34,7 @@ const Clipboard = ({ textCopy }: TClipboardProps) => {
return (
<Tooltip message={isCopied ? 'Copied!' : 'Copy'} position='top'>
<button className='clipboard' onClick={onClick}>
{isCopied ? <CheckmarkCircle /> : <CopyIcon />}
{isCopied ? <LegacyWonIcon iconSize='xs' /> : <LegacyCopy1pxIcon iconSize='xs' />}
</button>
</Tooltip>
);
Expand Down
13 changes: 7 additions & 6 deletions src/components/Modals/ShareAdsModal/ShareAdsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import { Clipboard } from '@/components';
import { ADVERTISER_URL, BUY_SELL, RATE_TYPE } from '@/constants';
import { api } from '@/hooks';
import { useCopyToClipboard } from '@/hooks/custom-hooks';
import { LegacyShare1pxIcon, LegacyShareLink1pxIcon, LegacyWonIcon } from '@deriv/quill-icons';
import { Button, Divider, Modal, Text, useDevice } from '@deriv-com/ui';
//TODO: replace below icons with the one from quill once available
import CheckmarkCircle from '../../../public/ic-checkmark-circle.svg?react';
import ShareIcon from '../../../public/ic-share.svg?react';
import ShareLinkIcon from '../../../public/ic-share-link.svg?react';
import ShareMyAdsCard from './ShareAdsCard';
import ShareMyAdsSocials from './ShareAdsSocials';
import './ShareAdsModal.scss';
Expand Down Expand Up @@ -119,7 +116,7 @@ const ShareAdsModal = ({ id, isModalOpen, onRequestClose }: TShareAdsModalProps)
textSize='md'
variant='outlined'
>
<ShareIcon />
<LegacyShare1pxIcon iconSize='xs' />
Share link
</Button>
<Button
Expand All @@ -129,7 +126,11 @@ const ShareAdsModal = ({ id, isModalOpen, onRequestClose }: TShareAdsModalProps)
textSize='md'
variant='outlined'
>
{isCopied ? <CheckmarkCircle /> : <ShareLinkIcon />}
{isCopied ? (
<LegacyWonIcon iconSize='xs' />
) : (
<LegacyShareLink1pxIcon iconSize='xs' />
)}
Copy link
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Modals/ShareAdsModal/ShareAdsSocials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
SocialFacebookBrandIcon,
SocialGoogleBrandIcon,
SocialTelegramBrandIcon,
SocialWhatsappBrandIcon,
} from '@deriv/quill-icons';
import WhatsappIcon from '../../../public/ic-whatsapp-filled.svg?react';
import './ShareAdsSocials.scss';

type TShareMyAdsSocialsProps = {
Expand All @@ -16,7 +16,7 @@ type TShareMyAdsSocialsProps = {
//TODO: fix the icon classnames once the icons are available in quillicons
const getShareButtons = (advertUrl: string) => [
{
icon: <WhatsappIcon className='h-[34px] w-[34px]' />,
icon: <SocialWhatsappBrandIcon height={36} width={36} />,
messagePropName: 'title',
ShareButton: WhatsappShareButton,
text: 'WhatsApp',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TFormState, THooks, TPaymentMethod, TSelectedPaymentMethod } from 'types';
import { Dropdown } from '@/components';
import { LegacyCloseCircle1pxIcon } from '@deriv/quill-icons';
import { Button, Input, Text } from '@deriv-com/ui';
import CloseCircle from '../../../public/ic-close-circle.svg?react';

type TPaymentMethodFormAutocompleteProps = {
actionType: TFormState['actionType'];
Expand Down Expand Up @@ -29,7 +29,7 @@ const PaymentMethodFormAutocomplete = ({
label='Choose your payment method'
rightPlaceholder={
actionType === 'EDIT' ? null : (
<CloseCircle
<LegacyCloseCircle1pxIcon
className='payment-method-form__icon--close'
data-testid='dt_payment_methods_form_close_icon'
fill='#999999'
Expand Down
12 changes: 9 additions & 3 deletions src/pages/buy-sell/components/SortDropdown/SortDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { MutableOption } from 'types';
import { TSortByValues } from '@/utils';
import { LabelPairedChevronDownMdRegularIcon } from '@deriv/quill-icons';
import { LabelPairedChevronDownMdRegularIcon, LabelPairedSortCaptionRegularIcon } from '@deriv/quill-icons';
import { Button, Dropdown, useDevice } from '@deriv-com/ui';
import SortIcon from '../../../../public/ic-cashier-sort.svg?react';
import './SortDropdown.scss';

type TSortDropdownProps = {
Expand All @@ -20,7 +19,14 @@ const SortDropdown = ({ list, onSelect, setIsFilterModalOpen, value }: TSortDrop
<Button
className='w-[3.2rem] !border-[#d6dadb] border-[1px]'
color='black'
icon={<SortIcon className='absolute' data-testid='dt_sort_dropdown_button' />}
icon={
<LabelPairedSortCaptionRegularIcon
className='absolute'
data-testid='dt_sort_dropdown_button'
height={24}
width={24}
/>
}
onClick={() => setIsFilterModalOpen(true)}
variant='outlined'
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LegacyWarningIcon } from '@deriv/quill-icons';
import { Button, Tooltip } from '@deriv-com/ui';
import AlertIcon from '../../../../public/ic-alert-warning.svg?react';
import './AlertComponent.scss';

type TAlertComponentProps = {
Expand All @@ -10,7 +10,7 @@ const AlertComponent = ({ onClick }: TAlertComponentProps) => (
<div className='alert-component'>
<Tooltip message='Ad not listed' position='bottom'>
<Button className='p-0 hover:bg-none' color='white' onClick={onClick} variant='outlined'>
<AlertIcon data-testid='dt_alert_icon' />
<LegacyWarningIcon data-testid='dt_alert_icon' iconSize='xs' />
</Button>
</Tooltip>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { MutableOption } from 'types';
import { Dropdown, Search } from '@/components';
import { COUNTERPARTIES_DROPDOWN_LIST } from '@/constants';
import { useDevice } from '@/hooks/custom-hooks';
import { LegacySort1pxIcon } from '@deriv/quill-icons';
import { Button, Text } from '@deriv-com/ui';
import SortIcon from '../../../../../public/ic-cashier-sort.svg?react';
import './MyProfileCounterpartiesHeader.scss';

type MyProfileCounterpartiesHeaderProps = {
Expand Down Expand Up @@ -34,7 +34,7 @@ const MyProfileCounterpartiesHeader = ({
<Button
className='my-profile-counterparties-header__sort-icon'
color='black'
icon={<SortIcon />}
icon={<LegacySort1pxIcon iconSize='xs' />}
onClick={onClickFilter}
variant='outlined'
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/orders/screens/OrderDetails/OrderDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { api } from '@/hooks';
import { useExtendedOrderDetails } from '@/hooks/custom-hooks';
import { ExtendedOrderDetails } from '@/hooks/custom-hooks/useExtendedOrderDetails';
import { OrderDetailsProvider } from '@/providers/OrderDetailsProvider';
import { LegacyLiveChatOutlineIcon } from '@deriv/quill-icons';
import { useAuthData } from '@deriv-com/api-hooks';
import { Button, InlineMessage, Loader, Text, useDevice } from '@deriv-com/ui';
import ChatIcon from '../../../../public/ic-chat.svg?react';
import { OrderDetailsCard } from '../../components/OrderDetailsCard';
import { OrderDetailsCardFooter } from '../../components/OrderDetailsCard/OrderDetailsCardFooter';
import { OrdersChatSection } from '../OrdersChatSection';
Expand Down Expand Up @@ -89,7 +89,7 @@ const OrderDetails = () => {
onClick={() => setShowChat(true)}
variant='contained'
>
<ChatIcon className='mt-2' />
<LegacyLiveChatOutlineIcon className='mt-2' iconSize='xs' />
</Button>
</Text>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { useExtendedOrderDetails, useQueryString } from '@/hooks/custom-hooks';
import { ExtendedOrderDetails } from '@/hooks/custom-hooks/useExtendedOrderDetails';
import { OrderRatingButton, OrderStatusTag, OrderTimer } from '@/pages/orders/components';
import { getDistanceToServerTime } from '@/utils';
import { LegacyLiveChatOutlineIcon } from '@deriv/quill-icons';
import { Button, Text, useDevice } from '@deriv-com/ui';
import ChatIcon from '../../../../../public/ic-chat.svg?react';
import './OrdersTableRow.scss';

const OrdersTableRow = ({ ...props }: DeepPartial<THooks.Order.GetList[number]>) => {
Expand Down Expand Up @@ -71,7 +71,7 @@ const OrdersTableRow = ({ ...props }: DeepPartial<THooks.Order.GetList[number]>)
}}
variant='contained'
>
<ChatIcon />
<LegacyLiveChatOutlineIcon iconSize='xs' />
</Button>
</div>
)}
Expand Down
Loading