Skip to content

Commit 02c0356

Browse files
Merge branch 'master' into FEQ-2382-keep-the-filter-options-in-buy-sell-page
2 parents 190e5ed + 23fbf8e commit 02c0356

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1248
-24
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@deriv-com/api-hooks": "^1.3.7",
2020
"@deriv-com/translations": "^1.2.4",
2121
"@deriv-com/ui": "^1.29.0",
22-
"@deriv-com/utils": "^0.0.26",
22+
"@deriv-com/utils": "^0.0.28",
2323
"@deriv/deriv-api": "^1.0.15",
2424
"@deriv/quill-design": "^1.2.24",
2525
"@deriv/quill-icons": "^1.22.10",

src/assets/blog.svg

Lines changed: 2 additions & 0 deletions
Loading

src/assets/find-ad.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/introducing-deriv-p2p.svg

Lines changed: 9 additions & 0 deletions
Loading

src/assets/pay-user.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/receive-payment.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/received-fund.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/release-fund.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/scam-advance-payment.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/scam-pot.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/scam-sms.svg

Lines changed: 1 addition & 0 deletions
Loading

src/assets/use-deriv-p2p.svg

Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.video-player-modal {
2+
background-color: #000;
3+
border-radius: 0.8rem;
4+
width: 64rem;
5+
height: 38rem;
6+
7+
@include mobile {
8+
width: calc(100vw - 3.2rem);
9+
height: 23rem;
10+
}
11+
12+
&__close-btn {
13+
position: absolute;
14+
right: 0.8rem;
15+
16+
@include desktop {
17+
cursor: pointer;
18+
}
19+
}
20+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { LabelPairedCircleXmarkMdFillIcon } from '@deriv/quill-icons';
2+
import { Modal } from '@deriv-com/ui';
3+
import './VideoPlayerModal.scss';
4+
5+
type TVideoPlayerModalProps = {
6+
isModalOpen: boolean;
7+
onRequestClose: () => void;
8+
title: string;
9+
url: string;
10+
};
11+
12+
const VideoPlayerModal = ({ isModalOpen, onRequestClose, title, url }: TVideoPlayerModalProps) => {
13+
return (
14+
<Modal
15+
ariaHideApp={false}
16+
className='video-player-modal'
17+
isOpen={isModalOpen}
18+
onRequestClose={onRequestClose}
19+
shouldCloseOnOverlayClick
20+
>
21+
<Modal.Body>
22+
<LabelPairedCircleXmarkMdFillIcon
23+
className='video-player-modal__close-btn'
24+
data-testid='dt_video_player_modal_close_btn'
25+
fill='#ffffff'
26+
onClick={onRequestClose}
27+
/>
28+
<iframe height='100%' src={url} title={title} width='100%' />
29+
</Modal.Body>
30+
</Modal>
31+
);
32+
};
33+
34+
export default VideoPlayerModal;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { HOW_TO_USE_DERIV_P2P_URL } from '@/constants';
2+
import { render, screen } from '@testing-library/react';
3+
import VideoPlayerModal from '../VideoPlayerModal';
4+
5+
const mockProps = {
6+
isModalOpen: true,
7+
onRequestClose: jest.fn(),
8+
title: 'How to use the Deriv P2P app',
9+
url: HOW_TO_USE_DERIV_P2P_URL,
10+
};
11+
12+
describe('<VideoPlayerModal />', () => {
13+
it('should render the modal', () => {
14+
render(<VideoPlayerModal {...mockProps} />);
15+
16+
expect(screen.getByTestId('dt_video_player_modal_close_btn')).toBeInTheDocument();
17+
expect(screen.getByTitle('How to use the Deriv P2P app')).toHaveAttribute('src', mockProps.url);
18+
});
19+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as VideoPlayerModal } from './VideoPlayerModal';

src/components/Modals/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ export * from './PreferredCountriesModal';
3030
export * from './RadioGroupFilterModal';
3131
export * from './RatingModal';
3232
export * from './ShareAdsModal';
33+
export * from './VideoPlayerModal';

src/constants/url.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const MY_ADS_URL = '/my-ads';
66
export const MY_PROFILE_URL = '/my-profile';
77
export const ADVERTISER_URL = '/advertiser';
88
export const ENDPOINT = '/endpoint';
9+
export const GUIDE_URL = '/guide';
910

1011
// TODO move these to deriv-utils library
1112
export const ACCOUNT_LIMITS = `${URLConstants.derivAppProduction}/account/account-limits`;
@@ -50,3 +51,11 @@ export const getOauthUrl = () => {
5051

5152
return oauthUrl;
5253
};
54+
55+
export const INTRODUCING_DERIV_P2P_URL =
56+
'https://player.vimeo.com/video/715973569?color&autopause=0&loop=0&muted=0&title=0&portrait=0&autoplay=1&byline=0#t=';
57+
58+
export const HOW_TO_USE_DERIV_P2P_URL =
59+
'https://player.vimeo.com/video/715982928?color&autopause=0&loop=0&muted=0&title=0&portrait=0&autoplay=1&byline=0#t=';
60+
61+
export const HOW_TO_PROTECT_YOURSELF_URL = 'https://blog.deriv.com/posts/how-to-protect-yourself-on-p2p-platforms/';

src/pages/advertiser/screens/Advertiser/Advertiser.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.advertiser {
22
position: absolute;
3-
top: 12rem;
3+
top: 1rem;
44
background-color: #fff;
55
width: 95.2rem;
66

77
@include mobile {
8-
top: 8rem;
8+
top: 0;
99
overflow: overlay;
1010
height: calc(100vh - 4rem);
1111
width: 100%;

src/pages/buy-sell/screens/BuySellHeader/BuySellHeader.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
}
3535

3636
&__tabs {
37-
@include mobile {
38-
padding: 1.6rem;
39-
}
40-
4137
& .derivs-primary-tabs {
4238
height: 4rem;
4339
width: 18rem;
@@ -55,6 +51,7 @@
5551
display: flex;
5652
flex-direction: row;
5753
gap: 1rem;
54+
align-items: center;
5855

5956
@include mobile {
6057
width: 100%;

src/pages/buy-sell/screens/BuySellHeader/BuySellHeader.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { Search } from '@/components';
44
import { FilterModal } from '@/components/Modals';
55
import { getSortByList } from '@/constants';
66
import { useIsAdvertiserBarred, useModalManager } from '@/hooks/custom-hooks';
7+
import { GuideTooltip } from '@/pages/guide/components';
78
import { useBuySellFiltersStore } from '@/stores';
9+
import { TSortByValues } from '@/utils';
810
import { getLocalizedTabs } from '@/utils/tabs';
911
import { LabelPairedBarsFilterMdBoldIcon, LabelPairedBarsFilterSmBoldIcon } from '@deriv/quill-icons';
1012
import { useTranslations } from '@deriv-com/translations';
@@ -40,16 +42,19 @@ const BuySellHeader = ({ activeTab, setActiveTab, setIsFilterModalOpen, setSearc
4042
})}
4143
data-testid='dt_buy_sell_header'
4244
>
43-
<Tabs
44-
TitleFontSize={isMobile ? 'md' : 'sm'}
45-
activeTab={getLocalizedTabs(localize)[activeTab]}
46-
onChange={setActiveTab}
47-
variant='primary'
48-
wrapperClassName='buy-sell-header__tabs'
49-
>
50-
<Tab title={localize('Buy')} />
51-
<Tab title={localize('Sell')} />
52-
</Tabs>
45+
<div className='buy-sell-header__row justify-between'>
46+
<Tabs
47+
TitleFontSize={isMobile ? 'md' : 'sm'}
48+
activeTab={getLocalizedTabs(localize)[activeTab]}
49+
onChange={setActiveTab}
50+
variant='primary'
51+
wrapperClassName='buy-sell-header__tabs'
52+
>
53+
<Tab title={localize('Buy')} />
54+
<Tab title={localize('Sell')} />
55+
</Tabs>
56+
{isMobile && <GuideTooltip />}
57+
</div>
5358
<div className='buy-sell-header__row'>
5459
<div className='flex flex-row-reverse lg:flex-row gap-4'>
5560
<CurrencyDropdown selectedCurrency={filteredCurrency} setSelectedCurrency={setFilteredCurrency} />

src/pages/endpoint/screens/Endpoint/Endpoint.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.endpoint {
22
position: absolute;
3-
top: 8rem;
3+
top: 1rem;
44
left: 0;
55
background: #fff;
66
width: 100%;

0 commit comments

Comments
 (0)