From 7712419eebb7dffac1ad5b722920380d2857399e Mon Sep 17 00:00:00 2001 From: niloo-fs Date: Tue, 11 Jan 2022 14:12:58 +0330 Subject: [PATCH 1/2] generalize academy and general footer into a single footer --- src/components/layout/footer.js | 3 +- .../layout/footer/disclaimer-academy.js | 180 ------------------ src/components/layout/footer/disclaimer.js | 20 +- 3 files changed, 19 insertions(+), 184 deletions(-) delete mode 100644 src/components/layout/footer/disclaimer-academy.js diff --git a/src/components/layout/footer.js b/src/components/layout/footer.js index 0e9a72f6831..ba5fe08d995 100644 --- a/src/components/layout/footer.js +++ b/src/components/layout/footer.js @@ -6,7 +6,6 @@ import { DefaultFooter, FooterGrid } from './footer/common/style.js' import LogoSection from './footer/logo' import MainLinksSection from './footer/main-links' import DisclaimerSection from './footer/disclaimer' -import DisclaimerSectionAcademy from './footer/disclaimer-academy' import CopyrightSection from './footer/copyright' import BottomSocialSection from './footer/bottom-social-wrapper' import AdditionalEUSection from './footer/additional-eu' @@ -39,7 +38,7 @@ const Footer = ({ type, is_ppc, is_ppc_redirect, academy }) => { is_ppc_redirect={is_ppc_redirect} is_eu_country={is_eu_country} /> - {academy ? : } + diff --git a/src/components/layout/footer/disclaimer-academy.js b/src/components/layout/footer/disclaimer-academy.js deleted file mode 100644 index 64262e33598..00000000000 --- a/src/components/layout/footer/disclaimer-academy.js +++ /dev/null @@ -1,180 +0,0 @@ -import React from 'react' -import { - DisclaimerWrapper, - DisclaimerParagraph, - RiskWarning, - StaticAsset, - BoldLink, -} from './common/style.js' -import { Show } from 'components/containers' -import { Localize, localize } from 'components/localization' - -const DisclaimerSectionAcademy = () => { - return ( - <> - - - - , - ]} - /> - - - , - , - , - ]} - /> - - - - - , - ]} - /> - - - , - ]} - /> - - - - {localize( - 'Deriv Limited - 13 Castle Street, St. Helier, JE2 3BT, Jersey - is the holding company for the above subsidiaries.', - )} - - - {localize( - "This website's services are not available in certain countries, including the USA, Canada, and Hong Kong, or to persons below 18.", - )} - - - {localize( - 'The information contained in this academy is for educational purposes only and is not intended as financial or investment advice.', - )} - - - - - - - - - , - ]} - /> - - - - - - - - - - - - - - , - ]} - /> - - - - - - - - - - - - - - - - , - ]} - /> - - - - - - - - , - ]} - /> - - - - - - - ) -} - -export default DisclaimerSectionAcademy diff --git a/src/components/layout/footer/disclaimer.js b/src/components/layout/footer/disclaimer.js index c9c0b123cd5..04b5482d774 100644 --- a/src/components/layout/footer/disclaimer.js +++ b/src/components/layout/footer/disclaimer.js @@ -1,4 +1,5 @@ import React from 'react' +import PropTypes from 'prop-types' import { DisclaimerWrapper, DisclaimerParagraph, @@ -9,7 +10,7 @@ import { import { Show } from 'components/containers' import { Localize, localize } from 'components/localization' -const DisclaimerSection = () => { +const DisclaimerSection = ({ academy }) => { return ( <> @@ -69,7 +70,11 @@ const DisclaimerSection = () => { licence no. MGA/B2C/102/2000)${ + academy + ? ' and by the Revenue Commissioners for clients in Ireland (licence no. 1010285).' + : '.' + }`} components={[ { "This website's services are not available in certain countries, including the USA, Canada, and Hong Kong, or to persons below 18.", )} + {academy && ( + + {localize( + 'The information contained in this academy is for educational purposes only and is not intended as financial or investment advice.', + )} + + )} @@ -172,4 +184,8 @@ const DisclaimerSection = () => { ) } +DisclaimerSection.propTypes = { + academy: PropTypes.bool, +} + export default DisclaimerSection From 33686c71b4852b4f2f9fba96b72d62aa52df4c47 Mon Sep 17 00:00:00 2001 From: niloo-fs Date: Wed, 12 Jan 2022 09:48:43 +0330 Subject: [PATCH 2/2] improve props naming --- src/components/layout/footer.js | 2 +- src/components/layout/footer/disclaimer.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/layout/footer.js b/src/components/layout/footer.js index ba5fe08d995..29a6dfb34b3 100644 --- a/src/components/layout/footer.js +++ b/src/components/layout/footer.js @@ -38,7 +38,7 @@ const Footer = ({ type, is_ppc, is_ppc_redirect, academy }) => { is_ppc_redirect={is_ppc_redirect} is_eu_country={is_eu_country} /> - + diff --git a/src/components/layout/footer/disclaimer.js b/src/components/layout/footer/disclaimer.js index 04b5482d774..1cf6cfaa932 100644 --- a/src/components/layout/footer/disclaimer.js +++ b/src/components/layout/footer/disclaimer.js @@ -10,7 +10,7 @@ import { import { Show } from 'components/containers' import { Localize, localize } from 'components/localization' -const DisclaimerSection = ({ academy }) => { +const DisclaimerSection = ({ is_academy }) => { return ( <> @@ -71,7 +71,7 @@ const DisclaimerSection = ({ academy }) => { licence no. MGA/B2C/102/2000)${ - academy + is_academy ? ' and by the Revenue Commissioners for clients in Ireland (licence no. 1010285).' : '.' }`} @@ -96,7 +96,7 @@ const DisclaimerSection = ({ academy }) => { "This website's services are not available in certain countries, including the USA, Canada, and Hong Kong, or to persons below 18.", )} - {academy && ( + {is_academy && ( {localize( 'The information contained in this academy is for educational purposes only and is not intended as financial or investment advice.', @@ -185,7 +185,7 @@ const DisclaimerSection = ({ academy }) => { } DisclaimerSection.propTypes = { - academy: PropTypes.bool, + is_academy: PropTypes.bool, } export default DisclaimerSection