From 4279c1f3095b68c3dec49644abfde63d3493b99e Mon Sep 17 00:00:00 2001 From: nemanjafleek Date: Fri, 24 Jan 2025 17:55:50 +0100 Subject: [PATCH 1/4] feat: prepare basic component structure for the Affiliates page --- src/components/Affiliates/Section.tsx | 18 +++++++++++++ src/components/Affiliates/images/.gitkeep | 0 src/components/Affiliates/index.tsx | 32 +++++++++++++++++++++++ src/pages/affiliates.astro | 17 ++++++++++++ src/settings.json | 23 ++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 src/components/Affiliates/Section.tsx create mode 100644 src/components/Affiliates/images/.gitkeep create mode 100644 src/components/Affiliates/index.tsx create mode 100644 src/pages/affiliates.astro diff --git a/src/components/Affiliates/Section.tsx b/src/components/Affiliates/Section.tsx new file mode 100644 index 000000000..84c5b0a2d --- /dev/null +++ b/src/components/Affiliates/Section.tsx @@ -0,0 +1,18 @@ +import { cn } from '@utils/cn'; + +interface SectionProps { + title: string; + className?: string; + children?: React.ReactNode; +} + +const Section: React.FC = ({ children, title, className }) => { + return ( +
+

{title}

+ {children &&
{children}
} +
+ ); +}; + +export default Section; diff --git a/src/components/Affiliates/images/.gitkeep b/src/components/Affiliates/images/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/src/components/Affiliates/index.tsx b/src/components/Affiliates/index.tsx new file mode 100644 index 000000000..9ebc77d19 --- /dev/null +++ b/src/components/Affiliates/index.tsx @@ -0,0 +1,32 @@ +import settings from '@base/settings.json'; +import Section from './Section'; + +const AboutModule = { + Hero: () => ( +
+
Hero section
+
+ ), + WhyBecome: () => ( +
+
WhyBecome section
+
+ ), + WhoCanJoin: () => ( +
+
WhoCanJoin section
+
+ ), + HowItWorks: () => ( +
+
HowItWorks section
+
+ ), + Faq: () => ( +
+
Faq section
+
+ ), +}; + +export default AboutModule; diff --git a/src/pages/affiliates.astro b/src/pages/affiliates.astro new file mode 100644 index 000000000..2a300da46 --- /dev/null +++ b/src/pages/affiliates.astro @@ -0,0 +1,17 @@ +--- +import Layout from '@layouts/Page.astro'; +import AffiliatesModule from '@components/Affiliates'; +import settings from '@base/settings.json'; + +const { title, description, slug, image } = settings.site.metadata.affiliates; + +// Todo: make correct layout +--- + + + + + + + + diff --git a/src/settings.json b/src/settings.json index f04fd00a8..0f3797713 100755 --- a/src/settings.json +++ b/src/settings.json @@ -26,6 +26,12 @@ "description": "Fleek: Build next-gen apps and AI agents in minutes on an open-source, verifiable, auto-scalable cloud platform. Start for free!", "image": "/images/fleek-meta-image.png?202406061658" }, + "affiliates": { + "title": "Fleek Affiliate Program", + "slug": "affiliates", + "description": "Join Fleek's Affiliate Program and help shape the future of the autonomous internet.", + "image": "/images/fleek-meta-image.png?202406061658" + }, "blog": { "title": "Blog", "slug": "blog", @@ -523,6 +529,23 @@ "button": "Get started with Fleek" } }, + "affiliatesPage": { + "hero": { + "title": "Refer Users to Fleek and Earn Cash Rewards" + }, + "whyBecome": { + "title": "Why Become a Fleek Affiliate?" + }, + "whoCanJoin": { + "title": "Who Can Join?" + }, + "howItWorks": { + "title": "How It Works" + }, + "faq": { + "title": "Frequently Asked Questions" + } + }, "templatesPage": { "title": "TEMPLATES", "subTitle": "Begin with a template", From 77215d88db4225f1dbf47b9996be0cc1d65ac1a5 Mon Sep 17 00:00:00 2001 From: nemanjafleek Date: Mon, 27 Jan 2025 14:29:09 +0100 Subject: [PATCH 2/4] feat: Hero section, basic styles, work in progress --- src/components/Affiliates/Section.tsx | 30 ++++++++++++++++++++++----- src/components/Affiliates/index.tsx | 26 +++++++++++++++++++++-- src/layouts/AffiliatesPage.astro | 24 +++++++++++++++++++++ src/pages/affiliates.astro | 8 +++---- src/settings.json | 5 ++++- 5 files changed, 80 insertions(+), 13 deletions(-) create mode 100644 src/layouts/AffiliatesPage.astro diff --git a/src/components/Affiliates/Section.tsx b/src/components/Affiliates/Section.tsx index 84c5b0a2d..06275ee1f 100644 --- a/src/components/Affiliates/Section.tsx +++ b/src/components/Affiliates/Section.tsx @@ -1,15 +1,35 @@ import { cn } from '@utils/cn'; +import type { ReactNode, FC } from 'react'; interface SectionProps { - title: string; + title: ReactNode; + isH1Title?: boolean; + subTitle?: string; className?: string; - children?: React.ReactNode; + children?: ReactNode; } -const Section: React.FC = ({ children, title, className }) => { +const Section: FC = ({ + children, + title, + isH1Title = false, + subTitle, + className, +}) => { return ( -
-

{title}

+
+ {isH1Title ? ( +

+ {title} +

+ ) : ( +

{title}

+ )} + {subTitle && ( +

+ {subTitle} +

+ )} {children &&
{children}
}
); diff --git a/src/components/Affiliates/index.tsx b/src/components/Affiliates/index.tsx index 9ebc77d19..94546eb34 100644 --- a/src/components/Affiliates/index.tsx +++ b/src/components/Affiliates/index.tsx @@ -1,10 +1,32 @@ import settings from '@base/settings.json'; import Section from './Section'; +import { Button } from '@components/Button'; +import { Target } from '@components/Link'; const AboutModule = { Hero: () => ( -
-
Hero section
+
+ {settings.affiliatesPage.hero.titleWhite} + + {settings.affiliatesPage.hero.titleYellow} + + + } + isH1Title + subTitle={settings.affiliatesPage.hero.subTitle} + > +
), WhyBecome: () => ( diff --git a/src/layouts/AffiliatesPage.astro b/src/layouts/AffiliatesPage.astro new file mode 100644 index 000000000..fad41da4a --- /dev/null +++ b/src/layouts/AffiliatesPage.astro @@ -0,0 +1,24 @@ +--- +import '@styles/globals.css'; +import '@styles/blogPage.css'; + +import BaseHtml from './BaseHtml.astro'; + +const { title, description, slug, image } = Astro.props; +// same as About for now +--- + + +
+ +
+
diff --git a/src/pages/affiliates.astro b/src/pages/affiliates.astro index 2a300da46..49af3d4a6 100644 --- a/src/pages/affiliates.astro +++ b/src/pages/affiliates.astro @@ -1,14 +1,12 @@ --- -import Layout from '@layouts/Page.astro'; +import Layout from '@layouts/AffiliatesPage.astro'; import AffiliatesModule from '@components/Affiliates'; import settings from '@base/settings.json'; -const { title, description, slug, image } = settings.site.metadata.affiliates; - -// Todo: make correct layout +const { affiliates } = settings.site.metadata; --- - + diff --git a/src/settings.json b/src/settings.json index 0f3797713..2bdde3065 100755 --- a/src/settings.json +++ b/src/settings.json @@ -531,7 +531,10 @@ }, "affiliatesPage": { "hero": { - "title": "Refer Users to Fleek and Earn Cash Rewards" + "titleWhite": "Refer Users to Fleek and ", + "titleYellow": "Earn Cash Rewards", + "subTitle": "Partner with Fleek to shape the future of the web and earn rewards while empowering developers and businesses to build the next generation of AI agents and apps.", + "ctaText": "Join the movement and get rewarded" }, "whyBecome": { "title": "Why Become a Fleek Affiliate?" From 8fdb99c9c840577c84fa84d79c2dbf6fef0ba2d0 Mon Sep 17 00:00:00 2001 From: nemanjafleek Date: Mon, 27 Jan 2025 16:22:58 +0100 Subject: [PATCH 3/4] feat: style non-Hero sections title and subtitle, cards in progress --- src/components/Affiliates/Section.tsx | 38 -------------- src/components/Affiliates/components/Card.tsx | 27 ++++++++++ .../Affiliates/components/Section.tsx | 51 +++++++++++++++++++ src/components/Affiliates/index.tsx | 16 ++++-- src/settings.json | 6 ++- 5 files changed, 93 insertions(+), 45 deletions(-) delete mode 100644 src/components/Affiliates/Section.tsx create mode 100644 src/components/Affiliates/components/Card.tsx create mode 100644 src/components/Affiliates/components/Section.tsx diff --git a/src/components/Affiliates/Section.tsx b/src/components/Affiliates/Section.tsx deleted file mode 100644 index 06275ee1f..000000000 --- a/src/components/Affiliates/Section.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { cn } from '@utils/cn'; -import type { ReactNode, FC } from 'react'; - -interface SectionProps { - title: ReactNode; - isH1Title?: boolean; - subTitle?: string; - className?: string; - children?: ReactNode; -} - -const Section: FC = ({ - children, - title, - isH1Title = false, - subTitle, - className, -}) => { - return ( -
- {isH1Title ? ( -

- {title} -

- ) : ( -

{title}

- )} - {subTitle && ( -

- {subTitle} -

- )} - {children &&
{children}
} -
- ); -}; - -export default Section; diff --git a/src/components/Affiliates/components/Card.tsx b/src/components/Affiliates/components/Card.tsx new file mode 100644 index 000000000..f2779ba04 --- /dev/null +++ b/src/components/Affiliates/components/Card.tsx @@ -0,0 +1,27 @@ +import type { FC } from 'react'; + +interface CardProps { + icon: string; + title: string; + description: string; +} + +const Card: FC = ({ icon, title, description }) => { + return ( +
+
+ {title} +
+
+

+ {title} +

+
+
+

{description}

+
+
+ ); +}; + +export default Card; diff --git a/src/components/Affiliates/components/Section.tsx b/src/components/Affiliates/components/Section.tsx new file mode 100644 index 000000000..656dfcca6 --- /dev/null +++ b/src/components/Affiliates/components/Section.tsx @@ -0,0 +1,51 @@ +import { cn } from '@utils/cn'; +import type { ReactNode, FC } from 'react'; + +interface SectionProps { + title: ReactNode; + isHero?: boolean; + subTitle?: string; + className?: string; + children?: ReactNode; +} + +const Section: FC = ({ + children, + title, + isHero = false, + subTitle, + className, +}) => { + return ( +
+ {isHero ? ( +

+ {title} +

+ ) : ( +

+ {title} +

+ )} + {subTitle && ( +

+ {subTitle} +

+ )} + {children &&
{children}
} +
+ ); +}; + +export default Section; diff --git a/src/components/Affiliates/index.tsx b/src/components/Affiliates/index.tsx index 94546eb34..69cc9ac27 100644 --- a/src/components/Affiliates/index.tsx +++ b/src/components/Affiliates/index.tsx @@ -1,7 +1,7 @@ import settings from '@base/settings.json'; -import Section from './Section'; import { Button } from '@components/Button'; import { Target } from '@components/Link'; +import Section from './components/Section'; const AboutModule = { Hero: () => ( @@ -14,12 +14,12 @@ const AboutModule = { } - isH1Title + isHero subTitle={settings.affiliatesPage.hero.subTitle} >