// material-ui import { Dialog, DialogTitle, DialogContent, Link, Button, Card, Box, Grid } from '@mui/material'; import Typography from '@mui/material/Typography'; import banner from 'assets/images/bg_ml.jpg'; import { Stack } from '../../../node_modules/@mui/material/index'; import { iAmSmartPath, clientId, getBowserType, isAppBowser, iAmSmartCallbackPath } from 'auth/utils' import { IAmSmartButton } from "components/iAmSmartButton"; import * as React from 'react'; import { FormattedMessage, useIntl } from "react-intl"; // ================================|| LOGIN ||================================ // const RegisterCustom = () => { const [isPopUp, setIsPopUp] = React.useState(false); const intl = useIntl(); const { locale } = intl; const registerWithIAmSmart = () => { setIsPopUp(true); } const getQRWithIAmSmart = () => { if ((isAppBowser())) { openApp(); } else { openQR(); } } const openQR = () => { let callbackUrl = "https://" + iAmSmartCallbackPath() + "/iamsmart/registrycallback"; let url = iAmSmartPath + "/api/v1/auth/getQR" + "?clientID=" + clientId + "&responseType=code" + "&source=" + getBowserType() + "&redirectURI=" + encodeURIComponent(callbackUrl) + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") + "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") //+"&state=" + "&brokerPage=false" window.location.assign(url); } const openApp = () => { let callbackUrl = "https://" + iAmSmartCallbackPath() + "/iamsmart/registrycallback"; let url = iAmSmartPath + "/api/v1/auth/getQR" + "?clientID=" + clientId + "&responseType=code" + "&source=" + getBowserType() + "&redirectURI=" + encodeURIComponent(callbackUrl) + "&scope=" + encodeURIComponent("eidapi_auth eidapi_profiles") + "&lang=" + (locale === 'en' ? "en-US" : locale === 'zh-HK' ? "zh-HK" : "zh-CN") //+"&state=" + "&brokerPage=true" window.location.assign(url); } return ( banner
*': { flexGrow: 1, flexBasis: '50%' }, backgroundColor: "secondary" }} > {" " + intl.formatMessage({ id: 'registerTitle2' }) + " "} {intl.formatMessage({ id: 'registerSubTitle' })}
setIsPopUp(false)} PaperProps={{ sx: { minWidth: '40vw', maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' }, maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' } } }} > {"- " + intl.formatMessage({ id: 'userChineseName' })} {"- " + intl.formatMessage({ id: 'userEnglishName' })} {"- " + intl.formatMessage({ id: 'userIDNo' })} {"- " + intl.formatMessage({ id: 'userEmailAddress' })} {"- " + intl.formatMessage({ id: 'userPhoneNumber' })} {"- " + intl.formatMessage({ id: 'userAddress' })}
); }; export default RegisterCustom;