From 0fa3abe743437366a7c752ececd690ee84d2b895 Mon Sep 17 00:00:00 2001 From: Zhang Ziqing Date: Mon, 24 Oct 2022 21:52:07 +0800 Subject: [PATCH] [offers][feat] add landing page --- .../src/components/offers/OffersNavigation.ts | 1 + .../offers/landing/LeftTextCard.tsx | 54 ++++ .../offers/landing/RightTextCard.tsx | 54 ++++ .../offers/profile/ProfileComments.tsx | 33 +++ apps/portal/src/pages/offers/home.tsx | 48 ++++ apps/portal/src/pages/offers/index.tsx | 272 +++++++++++++++--- .../pages/offers/profile/[offerProfileId].tsx | 4 +- 7 files changed, 426 insertions(+), 40 deletions(-) create mode 100644 apps/portal/src/components/offers/landing/LeftTextCard.tsx create mode 100644 apps/portal/src/components/offers/landing/RightTextCard.tsx create mode 100644 apps/portal/src/pages/offers/home.tsx diff --git a/apps/portal/src/components/offers/OffersNavigation.ts b/apps/portal/src/components/offers/OffersNavigation.ts index 393385e6..9b340cec 100644 --- a/apps/portal/src/components/offers/OffersNavigation.ts +++ b/apps/portal/src/components/offers/OffersNavigation.ts @@ -1,6 +1,7 @@ import type { ProductNavigationItems } from '~/components/global/ProductNavigation'; const navigation: ProductNavigationItems = [ + { href: '/offers/home', name: 'Home' }, { href: '/offers/submit', name: 'Analyse your offers' }, ]; diff --git a/apps/portal/src/components/offers/landing/LeftTextCard.tsx b/apps/portal/src/components/offers/landing/LeftTextCard.tsx new file mode 100644 index 00000000..27886018 --- /dev/null +++ b/apps/portal/src/components/offers/landing/LeftTextCard.tsx @@ -0,0 +1,54 @@ +import type { ReactNode } from 'react'; + +type LeftTextCardProps = Readonly<{ + description: string; + icon: ReactNode; + imageAlt: string; + imageSrc: string; + title: string; +}>; + +const baseUrl = '/offers/home'; +export default function LeftTextCard({ + description, + icon, + imageAlt, + imageSrc, + title, +}: LeftTextCardProps) { + return ( +
+
+
+
+ + {icon} + +
+
+

+ {title} +

+

{description}

+ +
+
+
+
+
+ {imageAlt} +
+
+
+ ); +} diff --git a/apps/portal/src/components/offers/landing/RightTextCard.tsx b/apps/portal/src/components/offers/landing/RightTextCard.tsx new file mode 100644 index 00000000..551c246a --- /dev/null +++ b/apps/portal/src/components/offers/landing/RightTextCard.tsx @@ -0,0 +1,54 @@ +import type { ReactNode } from 'react'; + +type RightTextCarddProps = Readonly<{ + description: string; + icon: ReactNode; + imageAlt: string; + imageSrc: string; + title: string; +}>; + +const baseUrl = '/offers/home'; +export default function RightTextCard({ + description, + icon, + imageAlt, + imageSrc, + title, +}: RightTextCarddProps) { + return ( +
+
+
+
+ + {icon} + +
+
+

+ {title} +

+

{description}

+ +
+
+
+
+
+ {imageAlt} +
+
+
+ ); +} diff --git a/apps/portal/src/components/offers/profile/ProfileComments.tsx b/apps/portal/src/components/offers/profile/ProfileComments.tsx index 350c29ea..ebed5bfd 100644 --- a/apps/portal/src/components/offers/profile/ProfileComments.tsx +++ b/apps/portal/src/components/offers/profile/ProfileComments.tsx @@ -142,6 +142,39 @@ export default function ProfileComments({ />

Discussions

+ {isEditable || session?.user?.name ? ( +
+