From 7141b88377fd6ec0d74767825d119f87fcae3b43 Mon Sep 17 00:00:00 2001 From: Gary Tou Date: Tue, 29 Oct 2024 15:05:13 -0700 Subject: [PATCH] Extract organization spotlight card to a component --- .../organization-spotlight.js | 82 ++++++++++++++++++ pages/fiscal-sponsorship/index.js | 84 +------------------ 2 files changed, 86 insertions(+), 80 deletions(-) create mode 100644 components/fiscal-sponsorship/organization-spotlight.js diff --git a/components/fiscal-sponsorship/organization-spotlight.js b/components/fiscal-sponsorship/organization-spotlight.js new file mode 100644 index 00000000..453e27ee --- /dev/null +++ b/components/fiscal-sponsorship/organization-spotlight.js @@ -0,0 +1,82 @@ +import Tilt from '../tilt' +import { Card, Heading, Text } from 'theme-ui' +import Image from 'next/image' +import { Balancer } from 'react-wrap-balancer' + +export default function OrganizationSpotlight({ organization }) { + return ( + + + {`${organization.name} +
+ + {organization.name} + + + {organization.location.readable} + +
+ + {organization.description} + +
+
+ ) +} diff --git a/pages/fiscal-sponsorship/index.js b/pages/fiscal-sponsorship/index.js index e0c43fa5..2330759f 100644 --- a/pages/fiscal-sponsorship/index.js +++ b/pages/fiscal-sponsorship/index.js @@ -1,6 +1,5 @@ import Meta from '@hackclub/meta' import Head from 'next/head' -import Image from 'next/image' import Link from 'next/link' import { Balancer } from 'react-wrap-balancer' import { @@ -19,12 +18,11 @@ import Nav from '../../components/nav' import Footer from '../../components/footer' import Photo from '../../components/photo' import Stat from '../../components/stat' -import Tilt from '../../components/tilt' - import ContactBanner from '../../components/fiscal-sponsorship/contact' import Features from '../../components/fiscal-sponsorship/features' import OuternetImgFile from '../../public/home/outernet-110.jpg' import SignIn from '../../components/fiscal-sponsorship/sign-in' +import OrganizationSpotlight from '../../components/fiscal-sponsorship/organization-spotlight' const organizations = [ { @@ -269,83 +267,9 @@ export default function Page() { - {organizations - // .map(org => new Organization(org)) - .map(organization => ( - - - {`${organization.name} -
- - {organization.name} - - - {organization.location.readable} - -
- - {organization.description} - -
-
- ))} + {organizations.map(org => ( + + ))}