-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ameerul /Bug 76978 Blocked advertiser list is not loading after barre…
…d one user and showing console error (#6565) * added error handling if user is barred and wants to get blocked advertisers list * updated ui for error message and added new component to handle errors in table * changed mobile margin for error message * added new icon for blocked advertisers barred * removed commented code
- Loading branch information
1 parent
76c1500
commit 2d4ff76
Showing
6 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/components/src/components/icon/common/ic-blocked-advertisers-barred.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ages/p2p/src/components/my-profile/block-user/block-user-table/block-user-table-error.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React from 'react'; | ||
import { observer } from 'mobx-react-lite'; | ||
import PropTypes from 'prop-types'; | ||
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'; | ||
|
||
const BlockUserTableError = ({ error_message }) => { | ||
const { my_profile_store } = useStores(); | ||
|
||
return ( | ||
<React.Fragment> | ||
<DesktopWrapper> | ||
<div className='block-user__table--error'> | ||
<Icon | ||
className='block-user__table--error-icon' | ||
icon='IcBlockedAdvertisersBarred' | ||
height={128} | ||
width={128} | ||
/> | ||
<Text | ||
align='center' | ||
className='block-user__table--error-text' | ||
line_height='m' | ||
size='s' | ||
weight='bold' | ||
> | ||
<Localize i18n_default_text={error_message} /> | ||
</Text> | ||
</div> | ||
</DesktopWrapper> | ||
<MobileWrapper> | ||
<MobileFullPageModal | ||
body_className='block-user__table--error' | ||
height_offset='80px' | ||
is_modal_open | ||
page_header_text={localize('Blocked advertisers')} | ||
pageHeaderReturnFn={() => my_profile_store.setActiveTab(my_profile_tabs.MY_STATS)} | ||
> | ||
<Icon | ||
icon='IcBlockedAdvertisersBarred' | ||
className='block-user__table--error-icon' | ||
height={128} | ||
width={128} | ||
/> | ||
<Text | ||
align='center' | ||
className='block-user__table--error-text' | ||
line_height='m' | ||
size='s' | ||
weight='bold' | ||
> | ||
<Localize i18n_default_text={error_message} /> | ||
</Text> | ||
</MobileFullPageModal> | ||
</MobileWrapper> | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
BlockUserTableError.propTypes = { | ||
error_message: PropTypes.string, | ||
}; | ||
|
||
export default observer(BlockUserTableError); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters