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

feat: Wallets Onboarding #9162

Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
24d6270
fix: inital commit
aizad-deriv Jun 28, 2023
50dbe5f
Merge branch 'feature/wallets_with_traders_hub' of github.com:aizad-d…
aizad-deriv Jun 30, 2023
178313d
feat: added onboarding wallets
aizad-deriv Jun 30, 2023
d20a31c
chore: merge to master
aizad-deriv Jun 30, 2023
6e2dac4
feat: added guided tour steps
aizad-deriv Jun 30, 2023
ce3acc9
Merge branch 'feature/wallets_with_traders_hub' of github.com:aizad-d…
aizad-deriv Jul 3, 2023
9502d27
fix: updated wallet onboarding steps props and callback fn to make it…
aizad-deriv Jul 4, 2023
3134722
chore: updated stuff here
aizad-deriv Jul 5, 2023
11bbb2c
Merge branch 'feature/wallets_with_traders_hub' of github.com:aizad-d…
aizad-deriv Jul 5, 2023
37fa919
fix: update pr with latest
aizad-deriv Jul 6, 2023
d010bbb
fix: merge stuff
aizad-deriv Jul 6, 2023
6cf0df2
fix: remove debug
aizad-deriv Jul 6, 2023
1932e51
fix: missing etherium icon
aizad-deriv Jul 7, 2023
f1b8e12
chore: merged
aizad-deriv Jul 7, 2023
d6cfad0
fix: added changes
aizad-deriv Jul 7, 2023
a04b96e
fix: icon name properly
aizad-deriv Jul 7, 2023
104311d
fix: implement suggested comments
aizad-deriv Jul 10, 2023
416b48d
Merge branch 'feature/wallets_with_traders_hub' of github.com:aizad-d…
aizad-deriv Jul 10, 2023
79dccaa
fix: revert changes on icon file
aizad-deriv Jul 10, 2023
806b2f2
fix: revert changes on icon file
aizad-deriv Jul 10, 2023
804f4ac
fix: revert changes on icon file
aizad-deriv Jul 10, 2023
af79701
fix: revert changes on icon file
aizad-deriv Jul 10, 2023
0b27d58
fix: committed suggestions v2
aizad-deriv Jul 10, 2023
6d04fd8
fix: circle ci error
aizad-deriv Jul 10, 2023
00169f8
fix: circle ci error pt.2
aizad-deriv Jul 10, 2023
814fc51
fix: onboarding wallets
aizad-deriv Jul 10, 2023
691f167
fix: modal open issue and cleanup component
aizad-deriv Jul 14, 2023
09a2086
chore: fix conflicts
aizad-deriv Jul 14, 2023
aec42c3
fix: circle ci issue
aizad-deriv Jul 14, 2023
d357998
fix: circle ci issue v2
aizad-deriv Jul 14, 2023
8586df1
fix: small changes on the design
aizad-deriv Jul 14, 2023
1cbf024
fix: resolve comments
aizad-deriv Jul 14, 2023
bfdcca2
chore: merge changes
aizad-deriv Jul 14, 2023
222c378
fix: updated step 1
aizad-deriv Jul 17, 2023
620719b
fix: remove the last step
aizad-deriv Jul 17, 2023
3ef3623
fix: align x button
aizad-deriv Jul 17, 2023
6827e32
feat: onboarding v2
aizad-deriv Jul 18, 2023
fa41982
chore: added logic to the steps
aizad-deriv Jul 18, 2023
51852aa
fix: address comments
aizad-deriv Jul 20, 2023
ad15a99
fix: change scrolling behaviour and tweak stylings to existing parent…
aizad-deriv Jul 21, 2023
0a1558f
Merge pull request #41 from aizad-deriv/aizad/WALL-1213/onboarding-wa…
aizad-deriv Jul 21, 2023
0483932
chore: resolve issues
aizad-deriv Jul 21, 2023
198b198
fix: scroll issue
aizad-deriv Jul 21, 2023
5b4e0fa
fix: commit suggestions
aizad-deriv Jul 24, 2023
edc3bb5
fix: tweak style of wallet container
aizad-deriv Jul 24, 2023
8385fa0
fix: tweak some settings to make it look better
aizad-deriv Jul 24, 2023
fcaa079
Merge branch 'feature/wallets_with_traders_hub' of github.com:aizad-d…
aizad-deriv Jul 24, 2023
aad1563
fix: retrigger vercel
aizad-deriv Jul 24, 2023
6c8b0cb
fix: remove unnecessary code
aizad-deriv Jul 24, 2023
d9ccdb3
fix: minor amendments
aizad-deriv Jul 25, 2023
a03a700
fix: fix css for trading app card component
aizad-deriv Jul 27, 2023
2ee5aa8
Merge branch 'feature/wallets_with_traders_hub' of github.com:aizad-d…
aizad-deriv Jul 28, 2023
5f79a60
fix: padding for cfd step and deriv platform
aizad-deriv Jul 28, 2023
573d950
Merge branch 'feature/wallets_with_traders_hub' into aizad/WALL-6/onb…
mahdiyeh-deriv Aug 2, 2023
6307b6f
chore: update code
aizad-deriv Aug 2, 2023
6fc544f
Merge branch 'aizad/WALL-6/onboarding-wallets' of github.com:aizad-de…
aizad-deriv Aug 2, 2023
e5743fa
fix: update code
aizad-deriv Aug 3, 2023
d40707a
chore: update code
aizad-deriv Aug 7, 2023
7d17e57
chore: updated code
aizad-deriv Aug 8, 2023
fdd546d
fix: updated code
aizad-deriv Aug 9, 2023
5371cef
chore: refactor some code within onboarding
aizad-deriv Aug 9, 2023
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
17 changes: 10 additions & 7 deletions packages/appstore/src/components/containers/trading-app-card.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
.trading-app-card {
display: inline-flex;
align-items: center;
padding-bottom: 2rem;

&__content {
display: flex;
align-items: center;
gap: 1.6rem;
}

&__icon {
&--container {
display: inline-flex;
align-items: center;
justify-content: center;
height: 100%;
padding: 0 0 2rem;
&__clickable {
cursor: pointer;
}
Expand All @@ -19,27 +23,26 @@
display: inline-flex;
justify-content: space-between;
align-items: center;
gap: 2rem;
width: 100%;
height: 100%;
padding: 0 0 2rem;
margin-left: 1.6rem;
}

&__details {
user-select: none;
display: inline-flex;
flex-direction: column;
justify-content: center;
min-height: 8rem;
height: 100%;
padding: 0 2rem 0 0;
width: 100%;
&__short-code {
padding: 0.4rem;
height: fit-content;
width: fit-content;
margin-left: 1rem;
background-color: var(--icon-grey-background);
border-radius: 4px;
border-radius: $BORDER_RADIUS;
}
}

Expand Down
138 changes: 74 additions & 64 deletions packages/appstore/src/components/containers/trading-app-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,80 +98,90 @@ const TradingAppCard = ({

return (
<div className='trading-app-card' key={`trading-app-card__${current_language}`}>
<div
className={classNames('trading-app-card__icon--container', {
'trading-app-card__icon--container__clickable': clickable_icon,
})}
>
<TradigPlatformIconProps icon={icon} onClick={clickable_icon ? openStaticPage : undefined} size={48} />
</div>
<div className={classNames('trading-app-card__container', { 'trading-app-card--divider': has_divider })}>
<div className='trading-app-card__details'>
<div>
<div className='trading-app-card__content' id={`trading-app-card__${icon.toLowerCase()}`}>
<div
className={classNames('trading-app-card__icon--container', {
'trading-app-card__icon--container__clickable': clickable_icon,
})}
>
<TradigPlatformIconProps
icon={icon}
onClick={clickable_icon ? openStaticPage : undefined}
size={48}
/>
</div>
<div
className={classNames('trading-app-card__container', { 'trading-app-card--divider': has_divider })}
>
<div className='trading-app-card__details'>
<React.Fragment>
{is_wallet ? (
<Text className='title' size='xs' line_height='s' color='prominent'>
{is_wallet_demo && sub_title ? `${sub_title} ${localize('Demo')}` : sub_title}
</Text>
) : (
<Text className='title' size='xs' line_height='s' color='prominent'>
{!is_real && sub_title ? `${sub_title} ${localize('Demo')}` : sub_title}
</Text>
)}
{!is_wallet && short_code_and_region && (
<Text
weight='bolder'
size='xxxs'
line_height='s'
className='trading-app-card__details__short-code'
>
{short_code_and_region}
</Text>
)}
</React.Fragment>
{is_wallet ? (
<Text className='title' size='xs' line_height='s' color='prominent'>
{is_wallet_demo && sub_title ? `${sub_title} ${localize('Demo')}` : sub_title}
<Text
className='title'
size='xs'
line_height='s'
weight='bold'
color={action_type === 'trade' ? 'prominent' : 'general'}
>
{is_wallet_demo && !sub_title && !is_deriv_platform
? `${name} ${localize('Demo')}`
: name}
</Text>
) : (
<Text className='title' size='xs' line_height='s' color='prominent'>
{!is_real && sub_title ? `${sub_title} ${localize('Demo')}` : sub_title}
</Text>
)}
{!is_wallet && short_code_and_region && (
<Text
weight='bolder'
size='xxxs'
className='title'
size='xs'
line_height='s'
className='trading-app-card__details__short-code'
weight='bold'
color={action_type === 'trade' ? 'prominent' : 'general'}
>
{short_code_and_region}
{!is_real && !sub_title && !is_deriv_platform ? `${name} ${localize('Demo')}` : name}
</Text>
)}
</div>
{is_wallet ? (
<Text
className='title'
size='xs'
line_height='s'
weight='bold'
color={action_type === 'trade' ? 'prominent' : 'general'}
>
{is_wallet_demo && !sub_title && !is_deriv_platform ? `${name} ${localize('Demo')}` : name}
</Text>
) : (
<Text
className='title'
size='xs'
line_height='s'
weight='bold'
color={action_type === 'trade' ? 'prominent' : 'general'}
>
{!is_real && !sub_title && !is_deriv_platform ? `${name} ${localize('Demo')}` : name}
<Text className='description' color={'general'} size='xxs' line_height='m'>
{app_desc}
</Text>
)}
<Text className='description' color={'general'} size='xxs' line_height='m'>
{app_desc}
</Text>
{mt5_acc_auth_status && (
<StatusBadge
className='trading-app-card__acc_status_badge'
account_status={mt5_acc_auth_status}
icon={badge_icon}
text={badge_text}
{mt5_acc_auth_status && (
<StatusBadge
className='trading-app-card__acc_status_badge'
account_status={mt5_acc_auth_status}
icon={badge_icon}
text={badge_text}
/>
)}
</div>
<div className='trading-app-card__actions'>
<TradingAppCardActions
action_type={action_type}
link_to={link_to}
onAction={onAction}
is_external={is_external}
new_tab={new_tab}
is_buttons_disabled={!!mt5_acc_auth_status}
is_account_being_created={!!is_account_being_created}
is_real={is_real}
/>
)}
</div>
<div className='trading-app-card__actions'>
<TradingAppCardActions
action_type={action_type}
link_to={link_to}
onAction={onAction}
is_external={is_external}
new_tab={new_tab}
is_buttons_disabled={!!mt5_acc_auth_status}
is_account_being_created={!!is_account_being_created}
is_real={is_real}
/>
</div>
</div>
</div>
</div>
Expand Down
8 changes: 6 additions & 2 deletions packages/appstore/src/components/containers/wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import classNames from 'classnames';
import WalletHeader from 'Components/wallet-header';
import WalletContent from 'Components/wallet-content';
import { CSSTransition } from 'react-transition-group';
import { observer, useStore } from '@deriv/stores';
import { TWalletAccount } from 'Types';
import './wallet.scss';

type TWallet = {
wallet_account: TWalletAccount;
};

const Wallet = ({ wallet_account }: TWallet) => {
const Wallet = observer(({ wallet_account }: TWallet) => {
const { ui } = useStore();
const { setIsWalletSwitching } = ui;
const headerRef = React.useRef<HTMLDivElement>(null);

return (
Expand All @@ -24,6 +27,7 @@ const Wallet = ({ wallet_account }: TWallet) => {
if (headerRef?.current) {
headerRef.current.style.scrollMargin = '20px';
headerRef.current.scrollIntoView({ behavior: 'smooth' });
setIsWalletSwitching(false);
}
}}
classNames='wallet__content-transition'
Expand All @@ -33,6 +37,6 @@ const Wallet = ({ wallet_account }: TWallet) => {
</CSSTransition>
</div>
);
};
});

export default Wallet;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const WalletModal = observer(() => {
const {
client: { balance, currency, landing_company_shortcode: shortcode, is_authorize, switchAccount },
ui: { is_dark_mode_on, is_wallet_modal_visible, is_mobile, setIsWalletModalVisible },
traders_hub: { active_modal_tab, active_modal_wallet_id, setWalletModalActiveTab },
traders_hub: { active_modal_tab, active_modal_wallet_id, setWalletModalActiveTab, is_wallet_tour_open },
} = store;

const wallet = useActiveWallet();
Expand All @@ -20,11 +20,11 @@ const WalletModal = observer(() => {
let timeout_id: NodeJS.Timeout;
if (is_wallet_modal_visible && wallet?.loginid !== active_modal_wallet_id) {
/** Adding a delay as per requirement because the modal must appear first, then switch the account */
timeout_id = setTimeout(() => switchAccount(active_modal_wallet_id), 700);
timeout_id = setTimeout(() => is_wallet_modal_visible && switchAccount(active_modal_wallet_id), 700);
}

return () => clearTimeout(timeout_id);
}, [active_modal_wallet_id, is_wallet_modal_visible, switchAccount, wallet?.loginid]);
}, [active_modal_wallet_id, is_wallet_modal_visible, switchAccount, wallet?.loginid, is_wallet_tour_open]);

const is_demo = wallet?.is_demo || false;
const wallet_type = is_demo ? 'demo' : 'real';
Expand Down
10 changes: 8 additions & 2 deletions packages/appstore/src/components/wallet-header/wallet-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ type TWalletHeader = {
};

const WalletHeader = observer(({ wallet_account }: TWalletHeader) => {
const { client, traders_hub } = useStore();
const { ui, client, traders_hub } = useStore();
const { switchAccount, loginid } = client;
const { setIsWalletSwitching } = ui;
const is_active = wallet_account.is_selected;
// const [is_loading, setIsLoading] = useState(false);
const { multipliers_account_status } = traders_hub;
Expand All @@ -25,7 +26,12 @@ const WalletHeader = observer(({ wallet_account }: TWalletHeader) => {

const onArrowClickHandler = async () => {
// setIsLoading(true);
if (loginid !== wallet_account.loginid) await switchAccount(wallet_account.loginid);
if (loginid !== wallet_account.loginid) {
setIsWalletSwitching(true);
await switchAccount(wallet_account.loginid);
} else {
setIsWalletSwitching(false);
}
// setIsLoading(false);
};

Expand Down
Loading