This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CRO][Translation] MyAffiliate signup form (#5992)
* feat: new affiliate signup page * fix: urls and phone * fix: translations * fix: getting the language * fix: phone number issue * fix: enable capital letter for email input * fix: phone code send wrong values * auto-pull-translation * translation: 📚 sync translations from crowdin feature branch * fix: a lot of minor issues * chore: fix eslnit issue * fix: responsive design for modals and arabic language * fix: terms of use sending to API * fix: resolving react minify errors * fix: react minify errors, ab test, validation * chore: new localise text and wizard size change * auto-pull-translation * translation: 📚 sync translations from crowdin feature branch * fix: datepicker input * fix: datepicker input and password passing * fix: ab testing * fix: add ab test for one more button and fix datapicker input * fix: datapicker input * fix: datepicker, states * refactor: tracking events, some minor changes with keys, brackets and id * refactor: handlers and password validation * refactor: make tracking utility and some refactor around * refactor: types, state, images * refactor: state, local constants movement * fix: security, deployment, console logs * refactor: validation and state management * fix: increase length of phone number * refactor: inputs, filter and data fix by individual account * chore: console log * fix: issue with incorrect name * fix: add mandatory fields * fix: state empty on try again * refactor: validate feature movement and prepare for debounce * fix: api limitations * fix: deployment issue * fix: deployment issue * refactor: button enabling condition * refactor: step view and date picker on safari fix * feat: add new text * auto-pull-translation * chore: empty commit * auto-pull-translation * translation: 📚 sync translations from crowdin feature branch * chore: empty commit * fix: update password validation --------- Co-authored-by: DerivFE <[email protected]>
- Loading branch information
1 parent
0870bf6
commit a1b7c89
Showing
74 changed files
with
10,411 additions
and
5,279 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
28 changes: 28 additions & 0 deletions
28
src/features/components/templates/navigation/affiliates-nav/index.tsx
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,28 @@ | ||
import React from 'react' | ||
import Link from 'features/components/atoms/link' | ||
import Image from 'features/components/atoms/image' | ||
import NavTemplate from 'features/components/templates/navigation/template' | ||
import LanguageSwitcher from 'features/components/molecules/language-switcher' | ||
import { partners_nav_logo } from 'features/components/templates/navigation/payment-agent-nav/payment-agent-nav.module.scss' | ||
import PartnerNavLogo from 'images/svg/partner-nav-logo.svg' | ||
|
||
const AffiliateNav = () => { | ||
return ( | ||
<NavTemplate | ||
renderLogo={() => ( | ||
<Link url={{ type: 'internal', to: '/partners/' }}> | ||
<Image | ||
src={PartnerNavLogo} | ||
alt={'nav affiliates'} | ||
className={partners_nav_logo} | ||
aria-label="deriv logo link" | ||
/> | ||
</Link> | ||
)} | ||
> | ||
<LanguageSwitcher /> | ||
</NavTemplate> | ||
) | ||
} | ||
|
||
export default AffiliateNav |
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
29 changes: 29 additions & 0 deletions
29
src/features/hooks/ab-testing/use-partners-signup-link/index.ts
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,29 @@ | ||
import { useEffect, useState } from 'react' | ||
import { Analytics } from '@deriv/analytics' | ||
import { getLanguage } from 'common/utility' | ||
import { affiliate_signup_url } from 'common/constants' | ||
|
||
const useAffiliateSignupLink = () => { | ||
const [affiliate_signup_link, setAffiliateSignupLink] = useState('') | ||
|
||
useEffect(() => { | ||
const partners_signup_ab_test = Analytics?.getFeatureValue( | ||
'partners_signup_ab_test', | ||
'fallback', | ||
) | ||
const language = getLanguage() | ||
|
||
const calculated_link = | ||
partners_signup_ab_test === true | ||
? `${window.location.origin}${ | ||
language !== 'en' ? '/' + language : '' | ||
}/signup-affiliates` | ||
: affiliate_signup_url | ||
|
||
setAffiliateSignupLink(calculated_link) | ||
}, []) | ||
|
||
return { affiliate_signup_link } | ||
} | ||
|
||
export default useAffiliateSignupLink |
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 |
---|---|---|
@@ -1,29 +1,46 @@ | ||
import { useEffect, useMemo } from 'react' | ||
import useWS from '../../../components/hooks/useWS' | ||
import useWS from 'components/hooks/useWS' | ||
|
||
export type ResidenceType = { | ||
text: string | ||
value: string | ||
} | ||
|
||
const formatResidenceList = (residences) => { | ||
const formatResidenceList = ({ | ||
residences, | ||
restricted, | ||
}: { | ||
residences: any[] | ||
restricted: ['Iran', 'North Korea', 'Myanmar (Burma)', 'Syria', 'Cuba'] | ||
}) => { | ||
if (!residences.length) { | ||
return [] | ||
} | ||
return residences?.map(({ text: display_name, text: name, value: symbol }) => ({ | ||
name, | ||
display_name, | ||
symbol, | ||
})) | ||
return residences | ||
.filter(({ text: name }) => !restricted.includes(name)) | ||
.map(({ text: display_name, text: name, value: symbol, phone_idd: prefix }) => { | ||
return { | ||
name, | ||
display_name, | ||
symbol, | ||
prefix, | ||
} | ||
}) | ||
} | ||
|
||
export const useResidenceList = () => { | ||
export const useResidenceList = ({ | ||
restricted_countries, | ||
}: { | ||
restricted_countries?: ['Iran', 'North Korea', 'Myanmar (Burma)', 'Syria', 'Cuba'] | ||
} = {}) => { | ||
const { send, data } = useWS('residence_list') | ||
|
||
useEffect(() => { | ||
send() | ||
}, [send]) | ||
|
||
const residence_list = useMemo(() => formatResidenceList(data || []), [data]) | ||
const residence_list = useMemo( | ||
() => formatResidenceList({ residences: data || [], restricted: restricted_countries }), | ||
[data], | ||
) | ||
return [residence_list] | ||
} |
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,32 @@ | ||
import { useEffect, useMemo } from 'react' | ||
import useWS from '../../../components/hooks/useWS' | ||
|
||
export type ResidenceType = { | ||
text: string | ||
value: string | ||
} | ||
|
||
const formatStatesList = (states) => { | ||
if (!states.length) { | ||
return [] | ||
} | ||
|
||
return states?.map( | ||
({ text }) => | ||
typeof text !== undefined && { | ||
name: text, | ||
display_name: text, | ||
}, | ||
) | ||
} | ||
|
||
export const useStatesList = (country_code) => { | ||
const { send, data } = useWS('states_list') | ||
|
||
useEffect(() => { | ||
send({ states_list: country_code }) | ||
}, [country_code]) | ||
|
||
const states_list = useMemo(() => formatStatesList(data || []), [data]) | ||
return [states_list] | ||
} |
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.
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.
Oops, something went wrong.
a1b7c89
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
deriv-com – ./
deriv-com-git-master.binary.sx
deriv-com.binary.sx