Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

nikolai.berestevich/feat/blog - new text on subscription banner #2032

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const localized_link_url = Object.freeze({
mt5: deriv_mt5_app_url,
smart_trader: smarttrader_url,
zoho: zoho_url,
terms_and_conditions: domain_full_url,
domain_full_url: domain_full_url,
})
export const default_server_url = 'green.binaryws.com'

Expand Down
15 changes: 11 additions & 4 deletions src/components/custom/_agreement-label.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ const CheckboxSpan = styled.span`
font-size: 1.75rem;
}
`

const AgreementLabel = ({ handleChangeCheckbox, isChecked, color }) => {
const AgreementLabel = ({
handleChangeCheckbox,
isChecked,
color,
link_path = 'terms_and_conditions',
link_text = 'I agree to the <0>terms and conditions</0>',
}) => {
const handleChange = (event) => {
handleChangeCheckbox(event)
}
Expand Down Expand Up @@ -42,11 +47,11 @@ const AgreementLabel = ({ handleChangeCheckbox, isChecked, color }) => {
<CheckboxSpan color={color}>
<Localize
fontSize="var(--text-size-xs)"
translate_text="I agree to the <0>terms and conditions</0>"
translate_text={link_text}
components={[
<LocalizedLinkText
key={0}
type="terms_and_conditions"
type={link_path}
external="true"
rel="noopener noreferrer"
size="14px"
Expand All @@ -63,6 +68,8 @@ AgreementLabel.propTypes = {
color: PropTypes.string,
handleChangeCheckbox: PropTypes.func,
isChecked: PropTypes.bool,
link_path: PropTypes.string,
link_text: PropTypes.string,
}

export default AgreementLabel
20 changes: 14 additions & 6 deletions src/components/localization/localized-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ const deriv_other_products = ['binary', 'smart_trader']
const deriv_social_platforms = ['blog', 'community', 'api', 'zoho']
// add item to this array if you need to make an internal link open on a new tab without modal window
const new_tab_no_modal = ['terms_and_conditions']
// !only for paths without localisation: add item to this array if you need to make an internal link open on a new tab without modal window
const only_en_new_tab_no_modal = ['tnc/security-and-privacy.pdf']

const getURLFormat = (type, locale, to, affiliate_lang) => {
if (deriv_app_links.includes(type)) {
Expand All @@ -154,10 +156,11 @@ const getURLFormat = (type, locale, to, affiliate_lang) => {
} else if (deriv_social_platforms.includes(type)) {
return `${localized_link_url[type]}${to}`
} else if (new_tab_no_modal.includes(type)) {
return `${localized_link_url[type]}${locale === 'en' ? '' : '/' + locale}/${type.replace(
/_/g,
'-',
)}`
return `${localized_link_url.domain_full_url}${
locale === 'en' ? '' : '/' + locale
}/${type.replace(/_/g, '-')}`
} else if (only_en_new_tab_no_modal.includes(type)) {
return `${localized_link_url.domain_full_url}/${type.replace(/_/g, '-')}`
} else {
return to
}
Expand Down Expand Up @@ -189,9 +192,14 @@ const ExternalLink = ({
!affiliate_links.includes(type) &&
!deriv_app_links.includes(type) &&
!deriv_social_platforms.includes(type) &&
!new_tab_no_modal.includes(type)
!new_tab_no_modal.includes(type) &&
!only_en_new_tab_no_modal.includes(type)

const default_style = { cursor: 'pointer' }
let final_target = target
if (new_tab_no_modal.includes(type) || only_en_new_tab_no_modal.includes(type)) {
final_target = '__blank'
}

const handleClick = (e) => {
if (show_modal) {
Expand All @@ -217,7 +225,7 @@ const ExternalLink = ({
href={!show_modal ? url : ''}
onClick={show_modal ? handleClick : null}
disabled={!mounted}
target={new_tab_no_modal.includes(type) ? '__blank' : target}
target={final_target}
rel={rel}
{...props}
>
Expand Down
Loading