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

carol/ Blocked user #5848

Merged
merged 9 commits into from
Jun 28, 2022
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { observer } from 'mobx-react-lite';
import { DesktopWrapper, Icon, MobileFullPageModal, MobileWrapper, Text } from '@deriv/components';
import { my_profile_tabs } from 'Constants/my-profile-tabs';
import { Localize, localize } from 'Components/i18next';
import { useStores } from 'Stores';
import './block-user-empty.scss';

const BlockUserEmpty = () => {
const { my_profile_store } = useStores();
Expand Down Expand Up @@ -46,4 +46,4 @@ const BlockUserEmpty = () => {
);
};

export default BlockUserEmpty;
export default observer(BlockUserEmpty);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import BlockUserEmpty from './block-user-empty.jsx';
import './block-user-empty.scss';

export default BlockUserEmpty;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import BlockUserModal from './block-user-modal.jsx';

export default BlockUserModal;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useStores } from 'Stores';
import MyProfileForm from './my-profile-form';
import MyProfileStats from './my-profile-stats';
import PaymentMethods from './payment-methods';
import BlockUserEmpty from 'Components/advertiser-page/block-user/block-user-empty';
import BlockUserEmpty from 'Components/block-user/block-user-empty';

const MyProfileContent = () => {
const { my_profile_store } = useStores();
Expand Down
7 changes: 7 additions & 0 deletions packages/p2p/src/stores/general-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class GeneralStore extends BaseStore {
@observable advertiser_id = null;
@observable inactive_notification_count = 0;
@observable is_advertiser = false;
@observable is_advertiser_blocked = null;
@observable is_blocked = false;
@observable is_listed = false;
@observable is_loading = false;
Expand Down Expand Up @@ -323,6 +324,11 @@ export default class GeneralStore extends BaseStore {
this.is_advertiser = is_advertiser;
}

@action.bound
setIsAdvertiserBlocked(is_advertiser_blocked) {
this.is_advertiser_blocked = is_advertiser_blocked;
}

@action.bound
setIsBlocked(is_blocked) {
this.is_blocked = is_blocked;
Expand Down Expand Up @@ -465,6 +471,7 @@ export default class GeneralStore extends BaseStore {
if (!response.error) {
this.setAdvertiserId(p2p_advertiser_info.id);
this.setIsAdvertiser(!!p2p_advertiser_info.is_approved);
this.setIsAdvertiserBlocked(!!p2p_advertiser_info.is_blocked);
this.setIsListed(!!p2p_advertiser_info.is_listed);
this.setNickname(p2p_advertiser_info.name);
this.setUserBlockedUntil(p2p_advertiser_info.blocked_until);
Expand Down