From c86610d3ef78e40898757a19f491f40d2803100c Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Fri, 20 Aug 2021 10:06:02 +0300 Subject: [PATCH 1/4] nikolai.berestevich/feat/blog - new text on subscription banner --- src/components/custom/_agreement-label.js | 44 ++++++++++++++++++++--- src/pages/blog/components/_subscribe.js | 2 ++ 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/components/custom/_agreement-label.js b/src/components/custom/_agreement-label.js index a43b9a2902b..980fdbb3fa5 100644 --- a/src/components/custom/_agreement-label.js +++ b/src/components/custom/_agreement-label.js @@ -12,8 +12,23 @@ const CheckboxSpan = styled.span` font-size: 1.75rem; } ` - -const AgreementLabel = ({ handleChangeCheckbox, isChecked, color }) => { +const AdditionalFlex = styled.div` + margin-top: 10px; + font-size: var(--text-size-xs); + line-height: 20px; + color: ${(props) => (props.color ? props.color : 'black')}; + @media ${device.tabletL} { + font-size: 1.75rem; + } +` +const AgreementLabel = ({ + handleChangeCheckbox, + isChecked, + color, + additional_text = '', + link_path = 'terms_and_conditions', + link_text = 'I agree to the <0>terms and conditions', +}) => { const handleChange = (event) => { handleChangeCheckbox(event) } @@ -42,11 +57,11 @@ const AgreementLabel = ({ handleChangeCheckbox, isChecked, color }) => { { ]} /> + {additional_text && ( + + , + ]} + /> + + )} ) } AgreementLabel.propTypes = { + additional_text: PropTypes.string, color: PropTypes.string, handleChangeCheckbox: PropTypes.func, isChecked: PropTypes.bool, + link_path: PropTypes.string, + link_text: PropTypes.string, } export default AgreementLabel diff --git a/src/pages/blog/components/_subscribe.js b/src/pages/blog/components/_subscribe.js index e328d717c0e..559c60d7972 100644 --- a/src/pages/blog/components/_subscribe.js +++ b/src/pages/blog/components/_subscribe.js @@ -391,6 +391,8 @@ const Subscribe = () => { isChecked={is_checked} handleChangeCheckbox={handleChange} color="#C2C2C2" + link_text="Send me marketing materials too!" + additional_text="We respect your privacy and protect your information. Read our <0>Privacy policy to find out more." /> )} {submit_status === 'success' && ( From 490be3612c107e5ce2792c2510e3a0c51e57619f Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Fri, 20 Aug 2021 12:21:44 +0300 Subject: [PATCH 2/4] nikolai.berestevich/feat/blog - new text on subscription banner --- src/common/constants.js | 1 + src/components/custom/_agreement-label.js | 4 +- src/components/localization/localized-link.js | 13 +- src/pages/blog/_recent-featured-posts.js | 341 +++++++++--------- src/pages/blog/components/_subscribe.js | 1 + 5 files changed, 189 insertions(+), 171 deletions(-) diff --git a/src/common/constants.js b/src/common/constants.js index 1d3f66b5d13..cec5c8fe42e 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -77,6 +77,7 @@ export const localized_link_url = Object.freeze({ smart_trader: smarttrader_url, zoho: zoho_url, terms_and_conditions: domain_full_url, + 'tnc/security-and-privacy.pdf': domain_full_url, }) export const default_server_url = 'green.binaryws.com' diff --git a/src/components/custom/_agreement-label.js b/src/components/custom/_agreement-label.js index 980fdbb3fa5..41320b456b3 100644 --- a/src/components/custom/_agreement-label.js +++ b/src/components/custom/_agreement-label.js @@ -27,6 +27,7 @@ const AgreementLabel = ({ color, additional_text = '', link_path = 'terms_and_conditions', + additional_link_path = 'terms_and_conditions', link_text = 'I agree to the <0>terms and conditions', }) => { const handleChange = (event) => { @@ -78,7 +79,7 @@ const AgreementLabel = ({ components={[ { if (deriv_app_links.includes(type)) { @@ -158,6 +160,8 @@ const getURLFormat = (type, locale, to, affiliate_lang) => { /_/g, '-', )}` + } else if (only_en_new_tab_no_modal.includes(type)) { + return `${localized_link_url[type]}/${type.replace(/_/g, '-')}` } else { return to } @@ -189,9 +193,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) { @@ -217,7 +226,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} > diff --git a/src/pages/blog/_recent-featured-posts.js b/src/pages/blog/_recent-featured-posts.js index 589b2a5c9a6..677c2e49a7d 100644 --- a/src/pages/blog/_recent-featured-posts.js +++ b/src/pages/blog/_recent-featured-posts.js @@ -1,7 +1,12 @@ import React from 'react' import Clock from './recent-featured-posts/images/clock.svg' import Dot from './recent-featured-posts/images/dot.svg' -import { recent_article_data, featured_article_data, article_data, article_data_2 } from './recent-featured-posts/_data' +import { + recent_article_data, + featured_article_data, + article_data, + article_data_2, +} from './recent-featured-posts/_data' import { StyledContainer, StyledTabs, @@ -57,175 +62,175 @@ const RecentFeaturedPosts = () => { const articles_2 = article_data_2 return ( - - - - - - - - - - - - {recent.category} - - - -
- {recent.title} -
-
- {recent.description} -
-
- - {recent.date} - - {recent.reading_time} min read - -
-
-
- - - {articles.map((article) => { - return ( - - - - - - - - - - - {article.category} - - - {article.date} - - {article.reading_time} min - -
- {article.title} -
-
- + + + + + + + + + + + + {recent.category} + + + +
+ {recent.title} +
+
+ {recent.description} +
+
+ + {recent.date} + + {recent.reading_time} min read + +
+
+
+ + + {articles.map((article) => { + return ( + + + + + + + + + + + {article.category} + + + {article.date} + + {article.reading_time} min + +
{article.title} - - - {article.date} - {article.reading_time} min read - - - - - ) - })} - - - - - - - - - - - - - - {featured.category} - - - -
- {featured.title} -
-
- {featured.description} -
-
- - {featured.date} - {featured.reading_time} min read - -
-
-
- - - {articles_2.map((article) => { - return ( - - - - - - - - - - - {article.category} - - - {article.date} - - {article.reading_time} min - -
- {article.title} -
-
- +
+
+ + {article.title} + + + {article.date} + {article.reading_time} min read + +
+
+
+ ) + })} +
+
+
+
+ + + + + + + + + + {featured.category} + + + +
+ {featured.title} +
+
+ {featured.description} +
+
+ + {featured.date} + {featured.reading_time} min read + +
+
+
+ + + {articles_2.map((article) => { + return ( + + + + + + + + + + + {article.category} + + + {article.date} + + {article.reading_time} min + +
{article.title} - - - {article.date} - {article.reading_time} min read - - - - - ) - })} - - - - - - - See all blog articles - - +
+
+ + {article.title} + + + {article.date} + {article.reading_time} min read + +
+
+
+ ) + })} +
+
+
+
+
+ + See all blog articles + +
) } diff --git a/src/pages/blog/components/_subscribe.js b/src/pages/blog/components/_subscribe.js index 559c60d7972..6fa7b24bedd 100644 --- a/src/pages/blog/components/_subscribe.js +++ b/src/pages/blog/components/_subscribe.js @@ -393,6 +393,7 @@ const Subscribe = () => { color="#C2C2C2" link_text="Send me marketing materials too!" additional_text="We respect your privacy and protect your information. Read our <0>Privacy policy to find out more." + additional_link_path="tnc/security-and-privacy.pdf" /> )} {submit_status === 'success' && ( From 51232ef616a9d975deb0a7809bca3238fc8ee691 Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Fri, 20 Aug 2021 12:26:05 +0300 Subject: [PATCH 3/4] nikolai.berestevich/feat/blog - new text on subscription banner --- src/common/constants.js | 3 +-- src/components/localization/localized-link.js | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/common/constants.js b/src/common/constants.js index cec5c8fe42e..fdf9fff8202 100644 --- a/src/common/constants.js +++ b/src/common/constants.js @@ -76,8 +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, - 'tnc/security-and-privacy.pdf': domain_full_url, + domain_full_url: domain_full_url, }) export const default_server_url = 'green.binaryws.com' diff --git a/src/components/localization/localized-link.js b/src/components/localization/localized-link.js index d6b10398a08..8b56c072120 100644 --- a/src/components/localization/localized-link.js +++ b/src/components/localization/localized-link.js @@ -156,12 +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[type]}/${type.replace(/_/g, '-')}` + return `${localized_link_url.domain_full_url}/${type.replace(/_/g, '-')}` } else { return to } From 966c1ac431b72aa09aedc5fe55e7be78005ddaab Mon Sep 17 00:00:00 2001 From: Nikolai Berestevich Date: Mon, 23 Aug 2021 09:44:57 +0300 Subject: [PATCH 4/4] nikolai.berestevich/feat/blog - new text on subscription banner --- src/components/custom/_agreement-label.js | 31 ---------------- src/pages/blog/components/_subscribe.js | 43 ++++++++++++++++++----- 2 files changed, 34 insertions(+), 40 deletions(-) diff --git a/src/components/custom/_agreement-label.js b/src/components/custom/_agreement-label.js index 41320b456b3..abe5d393b48 100644 --- a/src/components/custom/_agreement-label.js +++ b/src/components/custom/_agreement-label.js @@ -12,22 +12,11 @@ const CheckboxSpan = styled.span` font-size: 1.75rem; } ` -const AdditionalFlex = styled.div` - margin-top: 10px; - font-size: var(--text-size-xs); - line-height: 20px; - color: ${(props) => (props.color ? props.color : 'black')}; - @media ${device.tabletL} { - font-size: 1.75rem; - } -` const AgreementLabel = ({ handleChangeCheckbox, isChecked, color, - additional_text = '', link_path = 'terms_and_conditions', - additional_link_path = 'terms_and_conditions', link_text = 'I agree to the <0>terms and conditions', }) => { const handleChange = (event) => { @@ -71,31 +60,11 @@ const AgreementLabel = ({ ]} /> - {additional_text && ( - - , - ]} - /> - - )} ) } AgreementLabel.propTypes = { - additional_link_path: PropTypes.string, - additional_text: PropTypes.string, color: PropTypes.string, handleChangeCheckbox: PropTypes.func, isChecked: PropTypes.bool, diff --git a/src/pages/blog/components/_subscribe.js b/src/pages/blog/components/_subscribe.js index 6fa7b24bedd..477cd6860f0 100644 --- a/src/pages/blog/components/_subscribe.js +++ b/src/pages/blog/components/_subscribe.js @@ -6,6 +6,7 @@ import paperPlane from 'images/common/blog/paperplanes.png' import validation from 'common/validation' import { Input, Button } from 'components/form' import { Localize, localize } from 'components/localization' +import { LocalizedLinkText } from 'components/elements' import { Flex } from 'components/containers' import AgreementLabel from 'components/custom/_agreement-label' import device from 'themes/device.js' @@ -146,7 +147,15 @@ const EmailButton = styled(Button)` border-bottom-left-radius: 4px; } ` - +const AdditionalFlex = styled.div` + margin-top: 10px; + font-size: var(--text-size-xs); + line-height: 20px; + color: ${(props) => (props.color ? props.color : 'black')}; + @media ${device.tabletL} { + font-size: 1.75rem; + } +` const Subscribe = () => { const [is_checked, setChecked] = React.useState(false) const [email, setEmail] = React.useState('') @@ -387,14 +396,30 @@ const Subscribe = () => { {submit_status === true && ( - + <> + + + , + ]} + /> + + )} {submit_status === 'success' && (