Skip to content

Commit

Permalink
fix: modals
Browse files Browse the repository at this point in the history
  • Loading branch information
farrah-deriv committed Feb 9, 2023
1 parent 25e1024 commit 1388950
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const DailyLimitModal = () => {

return (
<Modal
exit_classname='daily-limit-modal--exit'
is_open={my_profile_store.is_daily_limit_modal_open}
small
has_close_icon={false}
Expand Down Expand Up @@ -36,9 +37,7 @@ const DailyLimitModal = () => {
text={localize('Yes, continue')}
onClick={() => {
my_profile_store.setIsDailyLimitModalOpen(false);

clearTimeout(delay);
const delay = setTimeout(() => my_profile_store.setIsLoadingModalOpen(true), 250);
my_profile_store.setIsLoadingModalOpen(true);
my_profile_store.upgradeDailyLimit();
}}
primary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.daily-limit-modal--exit {
display: none;
}
1 change: 1 addition & 0 deletions packages/p2p/src/components/daily-limit-modal/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import DailyLimitModal from './daily-limit-modal.jsx';
import './daily-limit-modal.scss';

export default DailyLimitModal;
1 change: 1 addition & 0 deletions packages/p2p/src/components/loading-modal/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import LoadingModal from './loading-modal.jsx';
import './loading-modal.scss';

export default LoadingModal;
8 changes: 7 additions & 1 deletion packages/p2p/src/components/loading-modal/loading-modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import { Loading, Modal } from '@deriv/components';

const LoadingModal = ({ is_loading_modal_open }) => {
return (
<Modal has_close_icon={false} is_open={is_loading_modal_open} small width='440px'>
<Modal
exit_classname='loading-modal--exit'
has_close_icon={false}
is_open={is_loading_modal_open}
small
width='440px'
>
<Loading is_fullscreen={false} />
</Modal>
);
Expand Down
3 changes: 3 additions & 0 deletions packages/p2p/src/components/loading-modal/loading-modal.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.loading-modal--exit {
display: none;
}
3 changes: 1 addition & 2 deletions packages/p2p/src/stores/my-profile-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,7 @@ export default class MyProfileStore extends BaseStore {

requestWS({ p2p_advertiser_update: 1, upgrade_limits: 1 }).then(response => {
if (response) {
clearTimeout(delay);
const delay = setTimeout(() => this.setIsLoadingModalOpen(false), 250);
this.setIsLoadingModalOpen(false);

if (response.error) {
clearTimeout(wait);
Expand Down

0 comments on commit 1388950

Please sign in to comment.