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

Niloofar / Popup message when partner first time log in to the account #6

Merged
merged 2 commits into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/components/src/components/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ import './common/ic-windows.svg';
import './common/ic-wip.svg';
import './common/ic-zoom-in.svg';
import './common/ic-zoom-out.svg';
import './common/statement.svg';
import './common/transfer.svg';
import './common/withdrawal.svg';
import './contract/ic-contract-barrier.svg';
import './contract/ic-contract-buy-price.svg';
import './contract/ic-contract-commission.svg';
Expand Down
3 changes: 3 additions & 0 deletions packages/components/stories/icon/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ export const icons =
'IcWip',
'IcZoomIn',
'IcZoomOut',
'Statement',
'Transfer',
'Withdrawal',
],
'contract': [
'IcContractBarrier',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,12 @@ const AccountSwitcher = props => {
is_eu={props.is_eu}
redirectAccount={() => {
// TODO add the redirect here
const has_logged_in_before = localStorage.getItem('new_partner_logged_in');
if (!has_logged_in_before) {
closeAccountsDialog();
localStorage.setItem('new_partner_logged_in', true);
props.toggleNewAffiliateAccountModal();
}
}}
selected_loginid={props.account_loginid}
/>
Expand Down Expand Up @@ -1005,6 +1011,7 @@ AccountSwitcher.propTypes = {
switchAccount: PropTypes.func,
resetVirtualBalance: PropTypes.func,
toggleAccountsDialog: PropTypes.func,
toggleNewAffiliateAccountModal: PropTypes.func,
togglePositionsDrawer: PropTypes.func,
toggleSetCurrencyModal: PropTypes.func,
trading_platform_available_accounts: PropTypes.array,
Expand Down Expand Up @@ -1069,6 +1076,7 @@ const account_switcher = withRouter(
should_show_real_accounts_list: ui.should_show_real_accounts_list,
toggleShouldShowRealAccountsList: ui.toggleShouldShowRealAccountsList,
trading_platform_available_accounts: client.trading_platform_available_accounts,
toggleNewAffiliateAccountModal: client.toggleNewAffiliateAccountModal,
}))(AccountSwitcher)
);

Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default class ClientStore extends BaseStore {

@observable mt5_trading_servers = [];
@observable dxtrade_trading_servers = [];
@observable is_new_affiliate_account_modal_visible = false;

is_mt5_account_list_updated = false;

Expand Down Expand Up @@ -972,6 +973,11 @@ export default class ClientStore extends BaseStore {
this.selectCurrency('');
}

@action.bound
toggleNewAffiliateAccountModal() {
this.is_new_affiliate_account_modal_visible = !this.is_new_affiliate_account_modal_visible;
}

@action.bound
responseAuthorize(response) {
this.accounts[this.loginid].email = response.authorize.email;
Expand Down
58 changes: 58 additions & 0 deletions packages/reports/src/Components/new-affiliate-account-modal.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import React from 'react';
import { Icon, Modal, Text, Button } from '@deriv/components';
import { localize } from '@deriv/translations';
import { connect } from 'Stores/connect';
import PropTypes from 'prop-types';
import '../sass/app/_common/components/new-affiliate-account-modal.scss';
akmal-deriv marked this conversation as resolved.
Show resolved Hide resolved

const affiliateAccountOptions = [
{ icon: 'withdrawal', title: localize('Withdrawals') },
{ icon: 'transfer', title: localize(`Inter-account transfers`) },
{ icon: 'statement', title: localize('View statement') },
];

const NewAffiliateAccountModal = ({ is_new_affiliate_account_modal_visible, toggleNewAffiliateAccountModal }) => {
return (
<Modal
is_open={is_new_affiliate_account_modal_visible}
toggleModal={toggleNewAffiliateAccountModal}
width='44rem'
>
<Modal.Body>
<Text as='h2' weight='bold'>
{localize('Here’s what you can do with your new Affiliate account')}
</Text>

<div className='new-affiliate-account-modal__body'>
{affiliateAccountOptions.map(({ icon, title }, idx) => (
<div key={idx} className='new-affiliate-account-modal__option'>
<Icon icon={icon} size={48} />
<Text as='p' size='xs' align='center'>
{title}
</Text>
</div>
))}
</div>
</Modal.Body>

<Modal.Footer className='new-affiliate-account-modal__footer'>
<Button
className='new-affiliate-account-modal__button'
text={localize('OK')}
primary
onClick={toggleNewAffiliateAccountModal}
/>
</Modal.Footer>
</Modal>
);
};

NewAffiliateAccountModal.propTypes = {
is_new_affiliate_account_modal_visible: PropTypes.bool,
toggleNewAffiliateAccountModal: PropTypes.func,
};

export default connect(({ client }) => ({
is_new_affiliate_account_modal_visible: client.is_new_affiliate_account_modal_visible,
toggleNewAffiliateAccountModal: client.toggleNewAffiliateAccountModal,
}))(NewAffiliateAccountModal);
2 changes: 2 additions & 0 deletions packages/reports/src/Containers/reports.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { getSelectedRoute, getStaticUrl } from '@deriv/shared';
import { localize } from '@deriv/translations';
import { connect } from 'Stores/connect';
import 'Sass/app/modules/reports.scss';
import NewAffiliateAccountModal from 'Components/new-affiliate-account-modal';

const Reports = ({
history,
Expand Down Expand Up @@ -121,6 +122,7 @@ const Reports = ({
</MobileWrapper>
</PageOverlay>
</div>
<NewAffiliateAccountModal />
</FadeWrapper>
);
};
Expand Down
18 changes: 18 additions & 0 deletions