|
1 |
| -import { useTranslation } from "next-i18next" |
2 |
| -import styled from "styled-components" |
| 1 | +import { useTranslation, Trans } from "next-i18next" |
3 | 2 | import AboutPagesCard from "../AboutPagesCard/AboutPagesCard"
|
4 | 3 | import { Col, Container, Row } from "../bootstrap"
|
5 |
| -import { |
6 |
| - CodeForBostonCardContent, |
7 |
| - NuLawLabCardContent, |
8 |
| - OpenCollectiveContent |
9 |
| -} from "../OurPartnersCardContent/OurPartnersCardContent" |
10 | 4 | import { PageTitle, PageDescr } from "../shared/CommonComponents"
|
| 5 | +import Image from "react-bootstrap/Image" |
11 | 6 |
|
12 |
| -export const OurPartners = () => { |
13 |
| - const { t } = useTranslation("common") |
| 7 | +const LocalizedContent = (props: { |
| 8 | + i18nKey: string |
| 9 | + linkClassName?: string |
| 10 | +}) => ( |
| 11 | + <Trans |
| 12 | + i18nKey={props.i18nKey} |
| 13 | + ns="partners" |
| 14 | + components={{ |
| 15 | + a: ( |
| 16 | + <a |
| 17 | + href="value-overridden-by-partners-json" |
| 18 | + target="_blank" |
| 19 | + rel="noreferrer" |
| 20 | + className={props.linkClassName} |
| 21 | + /> |
| 22 | + ) |
| 23 | + }} |
| 24 | + /> |
| 25 | +) |
14 | 26 |
|
| 27 | +const PartnerContentCard = ({ src, org }: { src: string; org: string }) => { |
| 28 | + const { t } = useTranslation("partners") |
| 29 | + const orgTitle = t(`${org}.title`) |
15 | 30 | return (
|
16 |
| - <Container> |
17 |
| - <Row> |
18 |
| - <Col> |
19 |
| - <PageTitle>{t("partners.header")}</PageTitle> |
20 |
| - </Col> |
21 |
| - </Row> |
22 |
| - <Row> |
23 |
| - <Col className="py-3"> |
24 |
| - <PageDescr> |
25 |
| - {t("partners.desc1")} |
26 |
| - <StyleLink |
27 |
| - href="https://www.nulawlab.org" |
28 |
| - target="_blank" |
29 |
| - rel="noopener noreferrer" |
30 |
| - > |
31 |
| - {" "} |
32 |
| - {t("partners.desc2")} |
33 |
| - </StyleLink>{" "} |
34 |
| - {t("partners.desc3")} |
35 |
| - <StyleLink |
36 |
| - href="https://www.bc.edu/bc-web/schools/law.html" |
37 |
| - target="_blank" |
38 |
| - rel="noopener noreferrer" |
39 |
| - > |
40 |
| - {" "} |
41 |
| - {t("partners.desc4")} |
42 |
| - </StyleLink>{" "} |
43 |
| - {t("partners.desc5")}{" "} |
44 |
| - <StyleLink |
45 |
| - href="https://cyber.harvard.edu/" |
46 |
| - target="_blank" |
47 |
| - rel="noopener noreferrer" |
48 |
| - > |
49 |
| - {t("partners.desc6")} |
50 |
| - </StyleLink> |
51 |
| - . |
52 |
| - </PageDescr> |
53 |
| - </Col> |
54 |
| - </Row> |
55 |
| - <Row> |
56 |
| - <Col> |
57 |
| - <AboutPagesCard title="NuLawLab"> |
58 |
| - <NuLawLabCardContent /> |
59 |
| - </AboutPagesCard> |
60 |
| - </Col> |
61 |
| - </Row> |
62 |
| - <Row> |
63 |
| - <Col> |
64 |
| - <AboutPagesCard title="Code for Boston"> |
65 |
| - <CodeForBostonCardContent /> |
66 |
| - </AboutPagesCard> |
67 |
| - </Col> |
68 |
| - </Row> |
69 |
| - <Row> |
70 |
| - <Col> |
71 |
| - <AboutPagesCard title="Partners in Democracy"> |
72 |
| - <Row> |
73 |
| - <OpenCollectiveContent /> |
74 |
| - </Row> |
75 |
| - </AboutPagesCard> |
76 |
| - </Col> |
77 |
| - </Row> |
78 |
| - </Container> |
| 31 | + <Row> |
| 32 | + <Col> |
| 33 | + <AboutPagesCard title={orgTitle}> |
| 34 | + <Row className="mb-3"> |
| 35 | + <Col className="text-center align-self-center" md={3}> |
| 36 | + <Image fluid src={src} alt={t("logo", { org: orgTitle })} /> |
| 37 | + </Col> |
| 38 | + <Col className="align-self-center" md={9}> |
| 39 | + <p className="lh-sm tracking-wide fs-5 pt-4 pt-md-0"> |
| 40 | + <LocalizedContent i18nKey={`${org}.content`} /> |
| 41 | + </p> |
| 42 | + </Col> |
| 43 | + </Row> |
| 44 | + </AboutPagesCard> |
| 45 | + </Col> |
| 46 | + </Row> |
79 | 47 | )
|
80 | 48 | }
|
81 | 49 |
|
82 |
| -const StyleLink = styled.a` |
83 |
| - text-decoration: none; |
84 |
| - color: var(--bs-blue); |
85 |
| -` |
| 50 | +export const OurPartners = () => ( |
| 51 | + <Container> |
| 52 | + <PageTitle>{useTranslation("partners").t("title")}</PageTitle> |
| 53 | + <PageDescr className="py-3"> |
| 54 | + <LocalizedContent i18nKey="desc" linkClassName="text-decoration-none" /> |
| 55 | + </PageDescr> |
| 56 | + <PartnerContentCard |
| 57 | + src="/northeastern_school_of_law_logo.svg" |
| 58 | + org="nulawlab" |
| 59 | + /> |
| 60 | + <PartnerContentCard src="/codeforbostonicon.png" org="codeforboston" /> |
| 61 | + <PartnerContentCard src="/pid.png" org="pid" /> |
| 62 | + </Container> |
| 63 | +) |
0 commit comments