-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from shontzu-deriv/shontzu/TRAH-3015/ui-for-s…
…eamless-MT5-mobile-login-integration [TRAH] shontzu/TRAH-3015/ui-for-seamless-MT5-mobile-login-integration
- Loading branch information
Showing
10 changed files
with
285 additions
and
78 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* This file contains the URLs for different platforms and environments. | ||
* urlConfig will be sent as a proposal to the backend. | ||
*/ | ||
|
||
/** | ||
* URLs for the cTrader platform. | ||
*/ | ||
export const ctrader_links = { | ||
android: 'https://play.google.com/store/apps/details?id=com.deriv.ct', | ||
ios: 'https://apps.apple.com/us/app/deriv-ctrader/id6466996509', | ||
live: 'https://ct.deriv.com', | ||
staging: 'https://ct-uat.deriv.com', | ||
windows: 'https://getctrader.com/deriv/ctrader-deriv-setup.exe', | ||
mac: 'https://getctradermac.com/deriv/ctrader-deriv-setup.dmg', | ||
}; | ||
|
||
/** | ||
* URLs for the dxTrade platform. | ||
*/ | ||
export const dxtrade_links = { | ||
android: 'https://play.google.com/store/apps/details?id=com.deriv.dx', | ||
huawei: 'https://appgallery.huawei.com/app/C104633219', | ||
ios: 'https://apps.apple.com/us/app/deriv-x/id1563337503', | ||
demo: 'https://dx-demo.deriv.com', | ||
live: 'https://dx.deriv.com', | ||
}; | ||
|
||
/** | ||
* URLs for the mt5 platform. | ||
*/ | ||
export const white_label_links = { | ||
android: 'https://download.mql5.com/cdn/mobile/mt5/android?server=Deriv-Demo,Deriv-Server,Deriv-Server-02', | ||
huawei: 'https://appgallery.huawei.com/#/app/C102015329', | ||
ios: 'https://download.mql5.com/cdn/mobile/mt5/ios?server=Deriv-Demo,Deriv-Server,Deriv-Server-02', | ||
linux: 'https://www.metatrader5.com/en/terminal/help/start_advanced/install_linux', | ||
macos: 'https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/MetaTrader5.dmg', | ||
windows: 'https://download.mql5.com/cdn/web/deriv.com.limited/mt5/deriv5setup.exe', | ||
webtrader_url: 'https://mt5-real01-web-svg.deriv.com/terminal', | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { getDeeplinkUrl, getMobileAppInstallerUrl, getWebtraderUrl } from '@cfd/constants'; | ||
import { Text } from '@deriv-com/ui'; | ||
|
||
import { IconComponent } from '@/components'; | ||
import { THooks } from '@/types'; | ||
import { isSafariBrowser } from '@/utils'; | ||
|
||
export const MT5MobileRedirectOption = ({ details }: { details: THooks.MT5AccountsList }) => { | ||
const getMobileUrl = () => { | ||
window.location.replace(getDeeplinkUrl({ details })); | ||
|
||
const timeout = setTimeout(async () => { | ||
const url = await getMobileAppInstallerUrl({ details }); | ||
if (url) window.location.replace(url); | ||
}, 1500); | ||
|
||
if (!isSafariBrowser() || (isSafariBrowser() && /Version\/17/.test(navigator.userAgent))) { | ||
window.onblur = () => { | ||
clearTimeout(timeout); | ||
}; | ||
} | ||
}; | ||
|
||
return ( | ||
<div className='flex flex-col gap-4 align-center'> | ||
<a | ||
className='flex justify-between w-full gap-2 p-8 bg-gray-200 rounded-md text-decoration-none' | ||
href={getWebtraderUrl({ details })} | ||
rel='noopener noreferrer' | ||
target='_blank' | ||
> | ||
<div className='flex justify-between w-full gap-5 align-center'> | ||
<IconComponent height={16} icon='Laptop' width={16} /> | ||
<Text align='left' className='flex-1' size='xs' weight='bold'> | ||
MetaTrader5 web terminal | ||
</Text> | ||
<IconComponent height={16} icon='ChevronRight' width={16} /> | ||
</div> | ||
</a> | ||
<button | ||
className='flex justify-between w-full gap-2 p-8 bg-blue-600 rounded-md align-center text-decoration-none' | ||
onClick={getMobileUrl} | ||
> | ||
<div className='flex justify-between w-full gap-5 align-center'> | ||
<IconComponent height={16} icon='Mobile' width={16} /> | ||
<Text align='left' className='flex-1 text-white' size='xs' weight='bold'> | ||
Trade with MT5 mobile app | ||
</Text> | ||
<IconComponent height={16} icon='ChevronRight' width={16} /> | ||
</div> | ||
</button> | ||
|
||
<Text as='p' size='2xs'> | ||
Note: Don't have the MT5 app? Tap the <span>Trade with MT5 mobile app</span> button to download. | ||
Once you have installed the app, return to this screen and hit the same button to log in. | ||
</Text> | ||
</div> | ||
); | ||
}; |
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
Oops, something went wrong.