-
{type}
+
{type}
- Daily limit
-
+
+
+
+
{dailyLimit}
- Available
-
+
+
+
+
{available}
diff --git a/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.scss b/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.scss
index 75bf0688..a0ddfa4f 100644
--- a/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.scss
+++ b/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.scss
@@ -26,4 +26,11 @@
}
}
}
+
+ &__button {
+ &--submitting {
+ //TODO: add this variant to deriv-com/ui
+ background-color: #4bb4b3 !important;
+ }
+ }
}
diff --git a/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.tsx b/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.tsx
index 6a511ba4..09f982e2 100644
--- a/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.tsx
+++ b/src/pages/my-profile/screens/MyProfileAdDetails/MyProfileAdDetails.tsx
@@ -2,6 +2,7 @@ import { Dispatch, SetStateAction, useEffect, useMemo, useState } from 'react';
import { FullPageMobileWrapper } from '@/components';
import { api } from '@/hooks';
import { useQueryString } from '@/hooks/custom-hooks';
+import { LabelPairedCheckMdFillIcon } from '@deriv/quill-icons';
import { Localize, useTranslations } from '@deriv-com/translations';
import { Button, Loader, Text, TextArea, useDevice } from '@deriv-com/ui';
import './MyProfileAdDetails.scss';
@@ -49,7 +50,7 @@ const MyProfileAdDetailsTextArea = ({
const MyProfileAdDetails = () => {
const { data: advertiserInfo, isLoading } = api.advertiser.useGetInfo();
- const { mutate: updateAdvertiser } = api.advertiser.useUpdate();
+ const { isPending, mutate: updateAdvertiser } = api.advertiser.useUpdate();
const [contactInfo, setContactInfo] = useState('');
const [advertDescription, setAdvertDescription] = useState('');
const { isMobile } = useDevice();
@@ -116,7 +117,14 @@ const MyProfileAdDetails = () => {
setContactInfo={setContactInfo}
/>
-
diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss
index ccdf90bb..92243ac1 100644
--- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss
+++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.scss
@@ -6,14 +6,16 @@
height: calc(100vh - 30rem);
max-height: 100%;
}
+
+ &__row {
+ border-bottom: 1px solid #f2f3f4;
+ }
}
&__row {
&:last-child {
position: relative;
}
- &:not(:last-child) {
- border-bottom: 1px solid #f2f3f4;
- }
+ border-bottom: 1px solid #f2f3f4;
}
}
diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.tsx b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.tsx
index 8586a172..a6fe2382 100644
--- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.tsx
+++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTable/MyProfileCounterpartiesTable.tsx
@@ -1,7 +1,8 @@
-import { useEffect } from 'react';
+import { Dispatch, SetStateAction, useEffect, useState } from 'react';
import { api } from '@/hooks';
+import { DerivLightIcBlockedAdvertisersBarredIcon } from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
-import { Loader, Table, Text } from '@deriv-com/ui';
+import { Loader, Table, Text, useDevice } from '@deriv-com/ui';
import { MyProfileCounterpartiesEmpty } from '../MyProfileCounterpartiesEmpty';
import { MyProfileCounterpartiesTableRow } from '../MyProfileCounterpartiesTableRow';
import './MyProfileCounterpartiesTable.scss';
@@ -16,17 +17,23 @@ type TMyProfileCounterpartiesTableRowRendererProps = {
id?: string;
is_blocked: boolean;
name?: string;
+ setErrorMessage: Dispatch
>;
};
const MyProfileCounterpartiesTableRowRenderer = ({
id,
is_blocked: isBlocked,
name,
+ setErrorMessage,
}: TMyProfileCounterpartiesTableRowRendererProps) => (
-
+
);
-//TODO: rewrite the implementation in accordance with @deriv-com/ui table component
const MyProfileCounterpartiesTable = ({
dropdownValue,
searchValue,
@@ -42,12 +49,17 @@ const MyProfileCounterpartiesTable = ({
is_blocked: dropdownValue === 'blocked' ? 1 : 0,
trade_partners: 1,
});
+ const [errorMessage, setErrorMessage] = useState('');
+ const { isMobile } = useDevice();
useEffect(() => {
if (data.length > 0) {
setShowHeader(true);
}
- }, [data, setShowHeader]);
+ if (errorMessage) {
+ setShowHeader(false);
+ }
+ }, [data, errorMessage, setShowHeader]);
if (isLoading) {
return ;
@@ -62,6 +74,17 @@ const MyProfileCounterpartiesTable = ({
);
}
+ if (errorMessage) {
+ return (
+
+
+
+ {errorMessage}
+
+
+ );
+ }
+
return (
(
)}
tableClassname='my-profile-counterparties-table'
diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss
index a691e367..bff4fded 100644
--- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss
+++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.scss
@@ -12,5 +12,9 @@
align-items: center;
gap: 0.8rem;
cursor: pointer;
+
+ &--barred {
+ cursor: not-allowed;
+ }
}
}
diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.tsx b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.tsx
index 1f3d51b0..c47f8201 100644
--- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.tsx
+++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/MyProfileCounterpartiesTableRow.tsx
@@ -1,9 +1,10 @@
-import { memo } from 'react';
+import { Dispatch, memo, SetStateAction } from 'react';
+import clsx from 'clsx';
import { useHistory } from 'react-router-dom';
import { UserAvatar } from '@/components';
import { BlockUnblockUserModal } from '@/components/Modals';
import { ADVERTISER_URL } from '@/constants';
-import { useModalManager } from '@/hooks/custom-hooks';
+import { useIsAdvertiserBarred, useModalManager } from '@/hooks/custom-hooks';
import { Button, Text, useDevice } from '@deriv-com/ui';
import './MyProfileCounterpartiesTableRow.scss';
@@ -11,19 +12,30 @@ type TMyProfileCounterpartiesTableRowProps = {
id: string;
isBlocked: boolean;
nickname: string;
+ setErrorMessage: Dispatch>;
};
-const MyProfileCounterpartiesTableRow = ({ id, isBlocked, nickname }: TMyProfileCounterpartiesTableRowProps) => {
+const MyProfileCounterpartiesTableRow = ({
+ id,
+ isBlocked,
+ nickname,
+ setErrorMessage,
+}: TMyProfileCounterpartiesTableRowProps) => {
const { isMobile } = useDevice();
const history = useHistory();
const { hideModal, isModalOpenFor, showModal } = useModalManager();
+ const isAdvertiserBarred = useIsAdvertiserBarred();
return (
<>
history.push(`${ADVERTISER_URL}/${id}`, { from: 'MyProfile' })}
+ className={clsx('my-profile-counterparties-table-row__nickname-wrapper', {
+ 'my-profile-counterparties-table-row__nickname-wrapper--barred': isAdvertiserBarred,
+ })}
+ onClick={() => {
+ isAdvertiserBarred ? undefined : history.push(`${ADVERTISER_URL}/${id}`, { from: 'MyProfile' });
+ }}
>
{nickname}
@@ -46,6 +58,7 @@ const MyProfileCounterpartiesTableRow = ({ id, isBlocked, nickname }: TMyProfile
isBlocked={isBlocked}
isModalOpen={!!isModalOpenFor('BlockUnblockUserModal')}
onRequestClose={hideModal}
+ setErrorMessage={setErrorMessage}
/>
>
);
diff --git a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/__tests__/MyProfileCounterpartiesTableRow.spec.tsx b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/__tests__/MyProfileCounterpartiesTableRow.spec.tsx
index 3fb4b5b5..c1713ca4 100644
--- a/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/__tests__/MyProfileCounterpartiesTableRow.spec.tsx
+++ b/src/pages/my-profile/screens/MyProfileCounterparties/MyProfileCounterpartiesTableRow/__tests__/MyProfileCounterpartiesTableRow.spec.tsx
@@ -6,6 +6,7 @@ const mockProps = {
id: 'id1',
isBlocked: false,
nickname: 'nickname',
+ setErrorMessage: jest.fn(),
};
const mockPush = jest.fn();
diff --git a/src/pages/my-profile/screens/MyProfileStats/MyProfileStatsItem.tsx b/src/pages/my-profile/screens/MyProfileStats/MyProfileStatsItem.tsx
index 08ceadbe..39db5a27 100644
--- a/src/pages/my-profile/screens/MyProfileStats/MyProfileStatsItem.tsx
+++ b/src/pages/my-profile/screens/MyProfileStats/MyProfileStatsItem.tsx
@@ -40,6 +40,7 @@ const MyProfileStatsItem = ({
{shouldShowDuration && (
onClickLabel(false)}>
@@ -53,7 +54,11 @@ const MyProfileStatsItem = ({
|{' '}
onClickLabel(true)}>
-
+