forked from deriv-com/p2p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyAds.tsx
48 lines (44 loc) · 1.42 KB
/
MyAds.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import {
AwarenessBanner,
OutsideBusinessHoursHint,
PNVBanner,
TemporarilyBarredHint,
Verification,
} from '@/components';
import {
useGetBusinessHours,
useGetPhoneNumberVerification,
useIsAdvertiser,
useIsAdvertiserBarred,
useIsAdvertiserNotVerified,
} from '@/hooks/custom-hooks';
import { Loader } from '@deriv-com/ui';
import { MyAdsTable } from './MyAdsTable';
import './MyAds.scss';
const MyAds = () => {
const isAdvertiserBarred = useIsAdvertiserBarred();
const { isScheduleAvailable } = useGetBusinessHours();
const isAdvertiserNotVerified = useIsAdvertiserNotVerified();
const isAdvertiser = useIsAdvertiser();
const { isGetSettingsLoading, shouldShowVerification } = useGetPhoneNumberVerification();
if (isGetSettingsLoading) {
return <Loader />;
}
if (isAdvertiserNotVerified)
return (
<div className='overflow-y-auto h-[calc(100%-11rem)]'>
<AwarenessBanner />
<Verification />;
</div>
);
return (
<div className='flex flex-col h-full my-ads'>
{isAdvertiserBarred && <TemporarilyBarredHint />}
{!isScheduleAvailable && !isAdvertiserBarred && <OutsideBusinessHoursHint />}
{isAdvertiser && shouldShowVerification && <PNVBanner />}
<AwarenessBanner />
<MyAdsTable />
</div>
);
};
export default MyAds;