Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of https://github.com/binary-com/deriv-com
Browse files Browse the repository at this point in the history
  • Loading branch information
aswathy-deriv committed May 31, 2024
2 parents 0027266 + 1b700ff commit 378344e
Show file tree
Hide file tree
Showing 37 changed files with 5,042 additions and 5,719 deletions.
71 changes: 71 additions & 0 deletions .well-known/apple-app-site-association
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"appclips": {
"apps": []
},
"applinks": {
"details": [
{
"appID": "36S5Q8S4V5.com.deriv.app",
"paths": [
"/redirect/derivgo"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.app.dev",
"paths": [
"/redirect/derivgo"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.app.staging",
"paths": [
"/redirect/derivgo"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.dp2p",
"paths": [
"/cashier/p2p",
"/cashier/p2p/advertiser",
"/redirect/p2p"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.sample",
"paths": [
"/redirect"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.blanc",
"paths": [
"/redirect"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.blanc.dev",
"paths": [
"/redirect"
]
},
{
"appID": "36S5Q8S4V5.com.deriv.blanc.stg",
"paths": [
"/redirect"
]
}
]
},
"webcredentials": {
"apps": [
"36S5Q8S4V5.com.deriv.app",
"36S5Q8S4V5.com.deriv.app.dev",
"36S5Q8S4V5.com.deriv.app.staging",
"36S5Q8S4V5.com.deriv.dp2p",
"36S5Q8S4V5.com.deriv.blanc",
"36S5Q8S4V5.com.deriv.blanc.dev",
"36S5Q8S4V5.com.deriv.blanc.stg",
"36S5Q8S4V5.com.deriv.sample"
]
}
}
52 changes: 3 additions & 49 deletions crowdin/messages.json

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 37 additions & 5 deletions scripts/copy-htaccess.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
const fs = require('fs');
const path = require('path');

const region = process.argv[2]
const region = process.argv[2];

function generatePublicPath(region){
return path.join(__dirname, '..', "sites", region, 'public', '.htaccess');
function generatePublicPath(region) {
return path.join(__dirname, '..', 'sites', region, 'public');
}

// Path to your custom .htaccess file in the project root
// Path to your custom .htaccess file and .well-known directory in the project root
const htaccessPath = path.join(__dirname, '..', '.htaccess');
const wellKnownSourcePath = path.join(__dirname, '..', '.well-known');

// Path to the Gatsby public directory
const publicPath = generatePublicPath(region);
const wellKnownDestPath = path.join(publicPath, '.well-known');

fs.copyFile(htaccessPath, publicPath, (err) => {
// Ensure the public directory exists
fs.mkdirSync(publicPath, { recursive: true });

// Function to copy directory recursively
const copyDirectory = (src, dest) => {
const entries = fs.readdirSync(src, { withFileTypes: true });

fs.mkdirSync(dest, { recursive: true });

for (let entry of entries) {
const srcPath = path.join(src, entry.name);
const destPath = path.join(dest, entry.name);

if (entry.isDirectory()) {
copyDirectory(srcPath, destPath);
} else {
fs.copyFileSync(srcPath, destPath);
}
}
};

// Copy .htaccess file
fs.copyFile(htaccessPath, path.join(publicPath, '.htaccess'), (err) => {
if (err) {
console.error('Error copying .htaccess file:', err);
return;
}
console.log('.htaccess file copied successfully.');
});

// Copy .well-known directory
if (fs.existsSync(wellKnownSourcePath)) {
copyDirectory(wellKnownSourcePath, wellKnownDestPath);
console.log('.well-known directory copied successfully.');
} else {
console.error('.well-known directory does not exist.');
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const DescriptionContentROW = () => {
export const DescriptionContentEU = () => {
return (
<>
<Text size="sm">
<Text size="sm" className="text-solid-slate-1400">
<Localize
translate_text="_t_Deriv Investments (Europe) Limited is licensed and regulated by the Malta Financial Services Authority under the Investment Services Act._t_"
components={[
Expand All @@ -70,7 +70,7 @@ export const DescriptionContentEU = () => {
]}
/>
</Text>
<Text size="sm" className="pt-general-lg">
<Text size="sm" className="pt-general-lg text-solid-slate-1400">
<Localize
translate_text="_t_Make sure to read our <0>Terms and Conditions</0>, <1>Risk Disclosure</1>, and <2>Secure and Responsible Trading</2> to fully understand the risks involved before using our services. Please also note that the information on this website does not constitute investment advice. The value of investments may go down as well as up._t_"
components={[
Expand Down Expand Up @@ -147,7 +147,9 @@ export const DescriptionContent = () => {
const { region } = useBuildVariant()
const { is_cpa_plan } = useRegion()
const { exitRef } = useFloatingCtaContext()
const descriptionContent = (region === "row" && <DescriptionContentROW />) || (region === "eu" && <DescriptionContentEU />);
const descriptionContent =
(region === 'row' && <DescriptionContentROW />) ||
(region === 'eu' && <DescriptionContentEU />)
const [content, setContent] = useState(descriptionContent)

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import React from 'react'
import { Analytics } from '@deriv-com/analytics'
import {
SocialAppleWhiteIcon,
SocialAppleBlackIcon,
SocialFacebookBrandIcon,
SocialGoogleBrandIcon,
} from '@deriv/quill-icons'
import { Button } from '@deriv/quill-design'
import { signup_apple_btn, signup_fb_btn, signup_login_redirect } from '../signup.module.scss'
import { signup_login_redirect } from '../signup.module.scss'
import Login from 'common/login'
import Typography from 'features/components/atoms/typography'
import { Localize } from 'components/localization'
import { isBrowser } from 'common/utility'
import useThirdPartyFlags from 'components/hooks/use-third-party-flags'

const FormSocialButtons = () => {
const FormSocialButtons = ({ theme }: { theme: 'dark' | 'plain' }) => {
const analyticsData: Parameters<typeof Analytics.trackEvent>[1] = {
action: 'started',
form_source: isBrowser() && window.location.hostname,
Expand All @@ -23,25 +24,28 @@ const FormSocialButtons = () => {
const facebook_signup = useThirdPartyFlags('facebook_signup')
const apple_signup = useThirdPartyFlags('apple_signup')

const textStyleOverrides = theme === 'dark' ? ({ textcolor: 'white' } as const) : {}
const buttonStyleOverrides =
theme === 'dark' ? ({ colorStyle: 'white' } as const) : ({ colorStyle: 'black' } as const)

return (
<>
{google_signup && (
<Button
size="lg"
variant="secondary"
colorStyle="white"
icon={SocialGoogleBrandIcon}
fullWidth={true}
iconPosition="start"
id="dm-signup-google"
// className={signup_fb_btn}
onClick={() => {
Analytics?.trackEvent('ce_virtual_signup_form', {
signup_provider: 'google',
...analyticsData,
})
Login.initOneAll('google')
}}
{...buttonStyleOverrides}
>
<Localize translate_text={'_t_Google_t_'} />
</Button>
Expand All @@ -50,11 +54,10 @@ const FormSocialButtons = () => {
<Button
size="lg"
variant="secondary"
colorStyle="white"
icon={SocialFacebookBrandIcon}
fullWidth={true}
iconPosition="start"
className={signup_fb_btn}
// className={signup_fb_btn}
id="dm-signup-facebook"
onClick={() => {
Analytics?.trackEvent('ce_virtual_signup_form', {
Expand All @@ -63,6 +66,7 @@ const FormSocialButtons = () => {
})
Login.initOneAll('facebook')
}}
{...buttonStyleOverrides}
>
<Localize translate_text={'_t_Facebook_t_'} />
</Button>
Expand All @@ -71,11 +75,10 @@ const FormSocialButtons = () => {
<Button
size="lg"
variant="secondary"
colorStyle="white"
icon={SocialAppleWhiteIcon}
icon={theme === 'dark' ? SocialAppleWhiteIcon : SocialAppleBlackIcon}
fullWidth={true}
iconPosition="start"
className={signup_apple_btn}
// className={signup_apple_btn}
id="dm-signup-apple"
onClick={() => {
Analytics?.trackEvent('ce_virtual_signup_form', {
Expand All @@ -84,19 +87,19 @@ const FormSocialButtons = () => {
})
Login.initOneAll('apple')
}}
{...buttonStyleOverrides}
>
<Localize translate_text={'_t_Apple_t_'} />
</Button>
)}
<Typography.Paragraph mt="2x" textcolor="white" align="center">
<Typography.Paragraph mt="2x" align="center" {...textStyleOverrides}>
<Localize
translate_text="_t_Already have an account? <0>Log in</0>_t_"
components={[
<Typography.Paragraph
as="span"
textcolor="white"
key={0}
weight='bold'
weight="bold"
className={signup_login_redirect}
onClick={(event) => {
event.preventDefault()
Expand All @@ -107,6 +110,7 @@ const FormSocialButtons = () => {
})
Login.redirectToLogin()
}}
{...textStyleOverrides}
/>,
]}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@ import Flex from 'features/components/atoms/flex-box'
import Typography from 'features/components/atoms/typography'
import { Localize } from 'components/localization'

const SignUpFormContainer = ({ onModalClose }: { onModalClose: () => void }) => {
const SignUpFormContainer = ({
onModalClose,
theme,
}: {
onModalClose: () => void
theme: 'plain' | 'dark'
}) => {
const textStyleOverrides = theme === 'dark' ? ({ textcolor: 'white' } as const) : {}
const logoStyleOverrides = theme === 'dark' ? ({ fill: 'white' } as const) : {}

return (
<Flex.Box
basis="full"
Expand All @@ -24,22 +33,22 @@ const SignUpFormContainer = ({ onModalClose }: { onModalClose: () => void }) =>
className={signup_form_container}
>
<Flex.Box justify="between" pr="5x" align="center">
<Typography.Heading size="xxl" textcolor="white" className={sign_up_header}>
<Typography.Heading size="xxl" className={sign_up_header} {...textStyleOverrides}>
<Localize translate_text="_t_Sign Up_t_" />
</Typography.Heading>
<LabelPairedXmarkLgBoldIcon onClick={onModalClose} fill="white" />
<LabelPairedXmarkLgBoldIcon onClick={onModalClose} {...logoStyleOverrides} />
</Flex.Box>

<Flex.Box className={signup_form_layout} direction="col" pb="6x" gap="8x">
<SignUpPageForm />
<SignUpPageForm theme={theme} />
<Flex.Box justify="center" align="center">
<Flex.Item grow="1">
<Typography.Paragraph align="center" textcolor="white">
<Typography.Paragraph align="center" {...textStyleOverrides}>
<Localize translate_text="_t_Or sign up with_t_" />
</Typography.Paragraph>
</Flex.Item>
</Flex.Box>
<FormSocialButtons />
<FormSocialButtons theme={theme} />
</Flex.Box>
</Flex.Box>
)
Expand Down
Loading

0 comments on commit 378344e

Please sign in to comment.