Skip to content

Commit

Permalink
fix: merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
nada-deriv committed Sep 19, 2024
2 parents bd7b3df + a63c186 commit a5ddfee
Show file tree
Hide file tree
Showing 99 changed files with 932 additions and 799 deletions.
41 changes: 24 additions & 17 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@deriv-com/analytics": "^1.16.1",
"@deriv-com/api-hooks": "^1.4.9",
"@deriv-com/translations": "^1.3.7",
"@deriv-com/ui": "^1.29.0",
"@deriv-com/ui": "^1.35.5",
"@deriv-com/utils": "^0.0.28",
"@deriv/quill-icons": "^1.23.8",
"@sendbird/chat": "^4.11.3",
Expand Down Expand Up @@ -116,4 +116,4 @@
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5"
}
}
}
4 changes: 2 additions & 2 deletions src/components/AdvertiserName/AdvertiserNameStats.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
gap: 1rem;
}

& div:not(.deriv-tooltip-container):not(.deriv-tooltip-container *) {
& div:not(.deriv-tooltip) {
display: flex;
align-items: center;
gap: 0.8rem;
Expand All @@ -27,7 +27,7 @@
}
@include desktop {
&:nth-child(2) {
& div {
& div:not(.deriv-tooltip) {
padding-right: 0;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/AdvertiserName/AdvertiserNameStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { useModalManager } from '@/hooks';
import { getCurrentRoute } from '@/utils';
import { LabelPairedThumbsUpSmRegularIcon } from '@deriv/quill-icons';
import { Localize, useTranslations } from '@deriv-com/translations';
import { Text, useDevice } from '@deriv-com/ui';
import { Text, Tooltip, useDevice } from '@deriv-com/ui';
import { BlockUserCountModal } from '../Modals';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import BlockUserCount from './BlockUserCount';
import './AdvertiserNameStats.scss';

Expand Down Expand Up @@ -99,9 +98,10 @@ const AdvertiserNameStats = ({ advertiserStats }: { advertiserStats: DeepPartial
</div>
</div>
<div>
<TooltipMenuIcon
<Tooltip
as='button'
className='advertiser-name-stats__tooltip'
hideTooltip={!isDesktop}
onClick={() => {
isDesktop ? undefined : showModal('BlockUserCountModal');
}}
Expand All @@ -111,7 +111,7 @@ const AdvertiserNameStats = ({ advertiserStats }: { advertiserStats: DeepPartial
<Text color='less-prominent' size='sm'>
{recommendedAverage || 0}%
</Text>
</TooltipMenuIcon>
</Tooltip>
</div>
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdvertiserName/BlockDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const BlockDropdown = ({ id, onClickBlocked }: TBlockDropdownProps) => {
return (
<div className='block-dropdown'>
<Dropdown
dropdownIcon={<LabelPairedEllipsisVerticalXlRegularIcon data-testid='dt_block_dropdown_icon' />}
chevronIcon={<LabelPairedEllipsisVerticalXlRegularIcon data-testid='dt_block_dropdown_icon' />}
list={[
{
text: localize('Block'),
Expand Down
13 changes: 8 additions & 5 deletions src/components/AdvertiserName/BlockUserCount.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
.block-user-count {
& .deriv-tooltip-container {
display: flex;
align-items: center;
gap: 0.1rem;
}
&__tooltip {
padding: 0 0.8rem;
display: flex;
Expand All @@ -28,4 +23,12 @@
&__button {
padding: 0;
}

& .deriv-tooltip {
padding: 0.8rem;

@include mobile-or-tablet-screen {
display: none;
}
}
}
9 changes: 4 additions & 5 deletions src/components/AdvertiserName/BlockUserCount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { TLocalize } from 'types';
import { useModalManager } from '@/hooks';
import { LabelPairedCircleUserSlashSmRegularIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { Text, useDevice } from '@deriv-com/ui';
import { Text, Tooltip, useDevice } from '@deriv-com/ui';
import { BlockUserCountModal } from '../Modals';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import './BlockUserCount.scss';

type TBlockUserCount = {
Expand Down Expand Up @@ -32,21 +31,21 @@ const BlockUserCount = ({ count }: TBlockUserCount) => {
const { isDesktop, isMobile } = useDevice();
return (
<div className='block-user-count'>
<TooltipMenuIcon
<Tooltip
as='button'
className='block-user-count__tooltip'
data-testid='dt_block_user_count_button'
onClick={() => {
isDesktop ? undefined : showModal('BlockUserCountModal');
}}
tooltipContent={getMessage(localize, count)}
tooltipContent={<Text size='xs'>{getMessage(localize, count)}</Text>}
>
<LabelPairedCircleUserSlashSmRegularIcon />

<Text color='less-prominent' size={isMobile ? 'xs' : 'sm'}>
{count ?? 0}
</Text>
</TooltipMenuIcon>
</Tooltip>
{!!isModalOpenFor('BlockUserCountModal') && (
<BlockUserCountModal isModalOpen message={getMessage(localize, count)} onRequestClose={hideModal} />
)}
Expand Down
4 changes: 2 additions & 2 deletions src/components/AdvertsTableRow/AdvertsTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,15 @@ const AdvertsTableRow = memo((props: TAdvertsTableRowRenderer) => {
className='lg:min-w-[7.5rem]'
disabled={isAdvertiserBarred}
onClick={() => {
if (!isPoaVerified || !isPoiVerified) {
if (!isAdvertiser && (!isPoaVerified || !isPoiVerified)) {
const searchParams = new URLSearchParams(location.search);
searchParams.set('poi_poa_verified', 'false');
history.replace({
pathname: location.pathname,
search: searchParams.toString(),
});
} else {
if (!isAdvertiser) setSelectedAdvertId(advertId);
setSelectedAdvertId(advertId);
showModal(isAdvertiser ? 'BuySellForm' : 'NicknameModal');
}
}}
Expand Down
11 changes: 3 additions & 8 deletions src/components/AppFooter/AccountLimits.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import { ACCOUNT_LIMITS } from '@/constants';
import { LegacyAccountLimitsIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import { Tooltip } from '@deriv-com/ui';

const AccountLimits = () => {
const { localize } = useTranslations();

return (
<TooltipMenuIcon
as='a'
className='app-footer__icon'
href={ACCOUNT_LIMITS}
tooltipContent={localize('Account limits')}
>
<Tooltip as='a' className='app-footer__icon' href={ACCOUNT_LIMITS} tooltipContent={localize('Account limits')}>
<LegacyAccountLimitsIcon iconSize='xs' />
</TooltipMenuIcon>
</Tooltip>
);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/AppFooter/ChangeTheme.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { LegacyThemeLightIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import { Tooltip } from '@deriv-com/ui';

const ChangeTheme = () => {
const { localize } = useTranslations();

return (
// TODO need to add theme logic
// TODO update the component's tests after adding the logic
<TooltipMenuIcon as='button' className='app-footer__icon' tooltipContent={localize('Change theme')}>
<Tooltip as='button' className='app-footer__icon' tooltipContent={localize('Change theme')}>
<LegacyThemeLightIcon iconSize='xs' />
</TooltipMenuIcon>
</Tooltip>
);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/AppFooter/Deriv.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { DERIV_COM } from '@/constants';
import { LegacyDerivIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import { Tooltip } from '@deriv-com/ui';

const Deriv = () => {
const { localize } = useTranslations();

return (
<TooltipMenuIcon
<Tooltip
as='a'
className='app-footer__icon'
href={DERIV_COM}
target='_blank'
tooltipContent={localize('Go to deriv.com')}
>
<LegacyDerivIcon iconSize='xs' />
</TooltipMenuIcon>
</Tooltip>
);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/AppFooter/FullScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { useFullScreen } from '@/hooks';
import { LegacyFullscreen1pxIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import { Tooltip } from '@deriv-com/ui';

const FullScreen = () => {
const { toggleFullScreenMode } = useFullScreen();
const { localize } = useTranslations();

return (
<TooltipMenuIcon
<Tooltip
as='button'
className='app-footer__icon'
onClick={toggleFullScreenMode}
tooltipContent={localize('Full screen')}
>
<LegacyFullscreen1pxIcon iconSize='xs' />
</TooltipMenuIcon>
</Tooltip>
);
};

Expand Down
6 changes: 3 additions & 3 deletions src/components/AppFooter/HelpCentre.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { HELP_CENTRE } from '@/constants';
import { LegacyHelpCentreIcon } from '@deriv/quill-icons';
import { useTranslations } from '@deriv-com/translations';
import { TooltipMenuIcon } from '../TooltipMenuIcon';
import { Tooltip } from '@deriv-com/ui';

const HelpCentre = () => {
const { localize } = useTranslations();

return (
<TooltipMenuIcon
<Tooltip
as='a'
className='app-footer__icon'
href={HELP_CENTRE}
target='_blank'
tooltipContent={localize('Help centre')}
>
<LegacyHelpCentreIcon iconSize='xs' />
</TooltipMenuIcon>
</Tooltip>
);
};

Expand Down
7 changes: 3 additions & 4 deletions src/components/AppFooter/LanguageSettings.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { useMemo } from 'react';
import { LANGUAGES } from '@/constants';
import { useTranslations } from '@deriv-com/translations';
import { Text } from '@deriv-com/ui';
import { Text, Tooltip } from '@deriv-com/ui';
import { LocalStorageUtils } from '@deriv-com/utils';
import { TooltipMenuIcon } from '../TooltipMenuIcon';

type TLanguageSettings = {
openLanguageSettingModal: () => void;
Expand All @@ -19,7 +18,7 @@ const LanguageSettings = ({ openLanguageSettingModal }: TLanguageSettings) => {
);

return (
<TooltipMenuIcon
<Tooltip
as='button'
className='app-footer__language'
onClick={openLanguageSettingModal}
Expand All @@ -29,7 +28,7 @@ const LanguageSettings = ({ openLanguageSettingModal }: TLanguageSettings) => {
<Text size='xs' weight='bold'>
{currentLang}
</Text>
</TooltipMenuIcon>
</Tooltip>
);
};

Expand Down
Loading

0 comments on commit a5ddfee

Please sign in to comment.