From c5d582a34b595d6c1bbabbff97b00e848e272cbc Mon Sep 17 00:00:00 2001 From: yuval-hazaz Date: Wed, 24 Apr 2024 17:59:53 +0300 Subject: [PATCH] feat:description items stripe --- components/Common/Button/index.jsx | 6 +- components/Common/DescriptionStripe/index.jsx | 88 +++++++++++++++++++ .../ModernizationValues/index.jsx | 29 +----- .../ModernizationValues2/index.jsx | 80 ++++------------- 4 files changed, 110 insertions(+), 93 deletions(-) create mode 100644 components/Common/DescriptionStripe/index.jsx diff --git a/components/Common/Button/index.jsx b/components/Common/Button/index.jsx index 3052e2da..bd632004 100644 --- a/components/Common/Button/index.jsx +++ b/components/Common/Button/index.jsx @@ -5,9 +5,9 @@ import { useCallback } from 'react'; // Background Colors const ButtonColorsConfig = { - purpleDark: 'bg-purple-dark hover:bg-purple-bright-hover', - purpleBright: 'bg-purple-bright', - purpleBrightHover: 'hover:bg-purple-bright-hover', + purpleDark: '!bg-purple-dark !hover:bg-purple-bright-hover', + purpleBright: '!bg-purple-bright', + purpleBrightHover: '!hover:bg-purple-bright-hover', transparent: 'bg-transparent hover:bg-purple-bright-hover', }; diff --git a/components/Common/DescriptionStripe/index.jsx b/components/Common/DescriptionStripe/index.jsx new file mode 100644 index 00000000..ec589789 --- /dev/null +++ b/components/Common/DescriptionStripe/index.jsx @@ -0,0 +1,88 @@ +import { useCallback } from 'react'; +import Image from 'next/image'; +import * as analytics from '../../../lib/analytics'; +import PrimaryButton from '../Button/button-primary'; +import PropTypes from 'prop-types'; + +const DescriptionStripe = ({ items, ctaItem }) => { + const handleCtaClick = useCallback(() => { + analytics.event({ + action: ctaItem.buttonEvent.action, + params: ctaItem.buttonEvent.params, + }); + }, [ctaItem]); + + return ( + <> +
+
+ {items.map((item, index) => { + return ( +
+
+ {item.title} +
+ +
+ {item.title} +
+
+ {item.content} +
+
+ ); + })} + {ctaItem && ( +
+
+
+ {ctaItem.title} +
+
+ {ctaItem.content} +
+
+ +
+ )} +
+
+ + ); +}; + +DescriptionStripe.propTypes = { + items: PropTypes.arrayOf({ + image: PropTypes.node, + title: PropTypes.string, + content: PropTypes.string, + }), + + ctaItem: PropTypes.shape({ + title: PropTypes.string, + content: PropTypes.string, + buttonLink: PropTypes.string, + buttonTitle: PropTypes.string, + buttonEvent: PropTypes.shape({ + action: PropTypes.string, + params: PropTypes.object, + }), + }), +}; + +DescriptionStripe.defaultProps = { + items: [], + ctaItem: undefined, +}; + +export default DescriptionStripe; diff --git a/components/Sections/Modernization/ModernizationValues/index.jsx b/components/Sections/Modernization/ModernizationValues/index.jsx index fc9b5c89..bd3ede25 100644 --- a/components/Sections/Modernization/ModernizationValues/index.jsx +++ b/components/Sections/Modernization/ModernizationValues/index.jsx @@ -2,6 +2,7 @@ import Image from 'next/image'; import Feature1 from '../../../../public/images/modernization/faster.svg'; import Feature2 from '../../../../public/images/modernization/save-cost.svg'; import Feature3 from '../../../../public/images/modernization/flexible.svg'; +import DescriptionStripe from '../../../Common/DescriptionStripe'; const items = [ { @@ -24,33 +25,7 @@ const items = [ }, ]; const ModernizationValues = () => { - return ( - <> -
-
- {items.map((item, index) => { - return ( -
-
- {item.title} -
- -
- {item.title} -
-
- {item.content} -
-
- ); - })} -
-
- - ); + return ; }; export default ModernizationValues; diff --git a/components/Sections/Modernization/ModernizationValues2/index.jsx b/components/Sections/Modernization/ModernizationValues2/index.jsx index 7777686e..6bb347a0 100644 --- a/components/Sections/Modernization/ModernizationValues2/index.jsx +++ b/components/Sections/Modernization/ModernizationValues2/index.jsx @@ -1,9 +1,6 @@ -import { useCallback } from 'react'; -import Image from 'next/image'; -import Feature1 from '../../../../public/images/modernization/production-ready.svg'; import Feature2 from '../../../../public/images/modernization/graph.svg'; -import * as analytics from '../../../../lib/analytics'; -import Link from 'next/link'; +import Feature1 from '../../../../public/images/modernization/production-ready.svg'; +import DescriptionStripe from '../../../Common/DescriptionStripe'; const items = [ { @@ -19,66 +16,23 @@ const items = [ 'Deliver robust and future-proof applications. Amplication-generated code is error-free, based on best practices and built-in standards, ensuring optimal performance.', }, ]; -const ModernizationValues2 = () => { - const handleBookDemoClick = useCallback(() => { - analytics.event({ - action: 'bookDemoClicked', - params: { - buttonLocation: 'application-modernization', - }, - }); - }, []); - return ( - <> -
-
- {items.map((item, index) => { - return ( -
-
- {item.title} -
+const ctaItem = { + title: 'Revolutionize Your Legacy Services Today', + content: + 'Learn how Amplication can help modernize your legacy systems and fast-track your digital transformation.', + buttonTitle: 'Book a Demo', + buttonLink: process.env.NEXT_PUBLIC_BOOK_MEETING_URL, + buttonEvent: { + action: 'bookDemoClicked', + params: { + buttonLocation: 'application-modernization', + }, + }, +}; -
- {item.title} -
-
- {item.content} -
-
- ); - })} -
-
-
- Revolutionize Your Legacy Services Today -
-
- Learn how Amplication can help modernize your legacy systems and - fast-track your digital transformation. -
-
- - - Book a Demo - - -
-
-
- - ); +const ModernizationValues2 = () => { + return ; }; export default ModernizationValues2;