This repository was archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 230
mitchell/Finalized new virtual signup flow #6560
Merged
mamali-fs
merged 17 commits into
binary-com:master
from
mitchell-deriv:Finalized_new_virtual_signup_flow
Jun 13, 2021
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f8846d5
changed element to display none
mitchell-deriv 2b752fc
Merge branch 'master' of github.com:binary-com/binary-static
mitchell-deriv 4e5c30a
Merge branch 'master' of github.com:binary-com/binary-static
mitchell-deriv 7bc5c2d
new virtual signuop flow for cr
mitchell-deriv 136b398
added svgs for welcome page
mitchell-deriv 365db4d
merging
mitchell-deriv 5fd9d44
added redirection if not cr client
mitchell-deriv 55150ea
added and styled sub options
mitchell-deriv be24fcc
git status
mitchell-deriv f66294b
added more styling to welcome page
mitchell-deriv 4b1da8c
added redirection to mt5 for au users
mitchell-deriv 18e7303
Merge branch 'master' of github.com:binary-com/binary-static into Fin…
mitchell-deriv 7538068
did review changes
mitchell-deriv cb736dd
changing file namings as per comments
mitchell-deriv 917d1c4
Merge branch 'master' of github.com:binary-com/binary-static into Fin…
mitchell-deriv f463c82
increased assets font
mitchell-deriv c8bc975
changed sub-options color to black
mitchell-deriv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
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.
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.
This file contains hidden or 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 hidden or 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
84 changes: 84 additions & 0 deletions
84
src/javascript/app/pages/user/new_account/welcome_onboarding.js
This file contains hidden or 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,84 @@ | ||
const BinarySocket = require('../../../base/socket'); | ||
const BinaryPjax = require('../../../base/binary_pjax'); | ||
const Client = require('../../../base/client'); | ||
const getElementById = require('../../../../_common/common_functions').getElementById; | ||
const showLoadingImage = require('../../../../_common/utility').showLoadingImage; | ||
const ClientBase = require('../../../../_common/base/client_base'); | ||
const urlFor = require('../../../../_common/url').urlFor; | ||
|
||
const WelcomePageOnboarding = (() => { | ||
|
||
let welcome_container, | ||
is_virtual, | ||
upgrade_info, | ||
cfd, | ||
d_options, | ||
not_sure; | ||
|
||
const init = () => { | ||
upgrade_info = ClientBase.getBasicUpgradeInfo(); | ||
is_virtual = Client.get('is_virtual'); | ||
welcome_container = getElementById('welcome_container'); | ||
not_sure = getElementById('default'); | ||
cfd = getElementById('cfd'); | ||
d_options = getElementById('d_ptions'); | ||
}; | ||
|
||
const getCanUpgrade = (upgrade_type, { can_upgrade_to } = upgrade_info) => can_upgrade_to.includes(upgrade_type); | ||
|
||
const onLoad = () => { | ||
BinarySocket.wait('authorize', 'landing_company', 'get_settings', 'get_account_status').then(() => { | ||
init(); | ||
|
||
if (Client.hasAccountType('real')) { | ||
BinaryPjax.load(Client.defaultRedirectUrl()); | ||
showLoadingImage(welcome_container, 'dark'); | ||
} | ||
if (!getCanUpgrade('svg')) { | ||
BinaryPjax.load(Client.defaultRedirectUrl()); | ||
} | ||
not_sure.addEventListener('click', onClickNotSure); | ||
|
||
cfd.addEventListener('click', onClickCFD); | ||
|
||
d_options.addEventListener('click', onClickDigitalOptions); | ||
}); | ||
}; | ||
|
||
const onClickNotSure = () => { | ||
BinaryPjax.load(Client.defaultRedirectUrl()); | ||
}; | ||
|
||
const onClickCFD = () => { | ||
if (is_virtual && upgrade_info.can_upgrade_to.length) { | ||
if (getCanUpgrade('svg')) { | ||
BinaryPjax.load(urlFor('/user/metatrader')); | ||
} | ||
} else { | ||
BinaryPjax.load(Client.defaultRedirectUrl()); | ||
} | ||
}; | ||
|
||
const onClickDigitalOptions = () => { | ||
if (is_virtual && upgrade_info.can_upgrade_to.length){ | ||
if (getCanUpgrade('svg')) { | ||
BinaryPjax.load(`${urlFor('trading')}?market=forex&formname=risefall`); | ||
} | ||
} else { | ||
BinaryPjax.load(Client.defaultRedirectUrl()); | ||
} | ||
}; | ||
|
||
const onUnload = () => { | ||
cfd.removeEventListener('click', onClickCFD); | ||
d_options.removeEventListener('click', onClickDigitalOptions); | ||
not_sure.removeEventListener('click', onClickNotSure); | ||
}; | ||
|
||
return { | ||
onLoad, | ||
onUnload, | ||
}; | ||
})(); | ||
|
||
module.exports = WelcomePageOnboarding; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,78 @@ | ||
import React from 'react'; | ||
import { SeparatorLine } from '../../_common/components/separator_line.jsx'; | ||
|
||
const WelcomePageOnboarding = () => { | ||
|
||
const dropdown = 'images/pages/welcome/ddown.svg'; | ||
const options = [ | ||
{ | ||
icon : 'images/pages/welcome/cfd.svg', | ||
title : it.L('[_1]CFD[_2]','<strong>', '</strong>'), | ||
desc : it.L('[_1]Maximise returns[_2] by [_3]risking more[_4] than you put in.', '<strong>', '</strong>','<strong>', '</strong>'), | ||
url : it.url_for('user/metatrader'), | ||
action_id : 'cfd', | ||
sub_options: ['Forex', 'Synthetics', 'Stocks and indices', 'Cryptocurrencies', 'Commodities'], | ||
}, | ||
{ | ||
icon : 'images/pages/welcome/doptions.svg', | ||
title : it.L('[_1]Digital Options[_1]','<strong>', '</strong>'), | ||
desc : it.L('Earn [_1]fixed returns[_2] by [_3]risking only[_4] what you put in.', '<strong>', '</strong>', '<strong>', '</strong>'), | ||
url : it.url_for('trading'), | ||
action_id : 'd_ptions', | ||
sub_options: ['Forex', 'Synthetics', 'Stocks and indices', 'Commodities'], | ||
}, | ||
{ | ||
icon : 'images/pages/welcome/notsure.svg', | ||
title : it.L('[_1]Not Sure?[_1]' ,'<strong>', '</strong>'), | ||
desc : it.L('Let us introduce you to trading on Binary.'), | ||
url : it.url_for('trading'), | ||
action_id: 'default', | ||
}, | ||
]; | ||
|
||
return ( | ||
<div id='welcome_container' className='center-text welcome-content'> | ||
<h1>{it.L('Where would you like to start?')}</h1> | ||
<SeparatorLine className='gr-padding-5' invisible /> | ||
<div className='welcome-content-container'> | ||
{options.map(option => (<RenderOption | ||
key={option.title} | ||
option={option} | ||
dropdown={dropdown} | ||
/>))} | ||
</div> | ||
<SeparatorLine className='gr-padding-30' invisible /> | ||
</div> | ||
|
||
); | ||
}; | ||
|
||
const RenderOption = ({ option, dropdown }) => ( | ||
<div className='gr-12 gr-12-p gr-12-m gr-parent'> | ||
<a | ||
className='box border-gray welcome-content-box' | ||
id={option.action_id} | ||
href='javascript:;' | ||
> | ||
<div className='welcome-content-box-icon-container'> | ||
<img key={option.icon} className='welcome-content-box-icon' src={it.url_for(option.icon)} /> | ||
</div> | ||
<div className='welcome-content-box-desc'> | ||
<p id='upgrade_text' className={`${option.action_id}`}>{option.title}</p> | ||
<p >{option.desc}</p> | ||
<div className='welcome-content-box-sub-options'> | ||
{option.sub_options && option.sub_options.map((icon) => | ||
<span key={icon} alt={icon}>{icon}</span> | ||
)} | ||
</div> | ||
</div> | ||
<div className='welcome-content-box-arrow'> | ||
<div className='welcome-content-box-arrow-image'> | ||
<img src={it.url_for(dropdown)} /> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
); | ||
|
||
export default WelcomePageOnboarding; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.