forked from microwavenby/shoegaze-stack
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.tsx
167 lines (162 loc) · 4.96 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import { Grid, GridContainer } from "@trussworks/react-uswds";
import React from "react";
import { Trans, useTranslation } from "react-i18next";
type imgObj = {
src: string;
alt: string;
href: string;
};
export default function Index() {
const { t } = useTranslation();
const Griddify = (image_list: imgObj[]) => {
const chunkSize = 4;
const content = [];
for (let i = 0; i < image_list.length; i += chunkSize) {
const chunk = image_list.slice(i, i + chunkSize);
content.push(
<Grid
row
gap={6}
className="usa-graphic-list__row margin-bottom-1"
key={`logos-row-${i / 4 + 1}`}
>
{chunk.map((img) => (
<Grid
tablet={{ col: true }}
className="usa-media-block"
key={`logo-${img.alt}`}
>
<a key={img.href} href={img.href}>
<img
src={img.src}
alt={img.alt}
className="usa-media-block__img height-15 width-15 "
/>
</a>
</Grid>
))}
</Grid>
);
}
return <>{content}</>;
};
return (
<div>
<section className="usa-hero" aria-label="Introduction">
<GridContainer>
<Grid offset={8}>
<div className="usa-hero__callout">
<h1 className="usa-hero__heading">
<span className="usa-hero__heading--alt">
{t("Index.title")}:
</span>
<Trans i18nKey={"Index.subtitle"} />
</h1>
<p>{t("Index.subtitle2")}</p>
<a className="usa-button" href="../README.md">
{t("Index.button")}
</a>
</div>
</Grid>
</GridContainer>
</section>
<section className="grid-container usa-section">
<Grid row gap>
<Grid tablet={{ col: 4 }}>
<h2 className="font-heading-xl margin-top-0 tablet:margin-bottom-0 text-primary-darker">
<Trans i18nKey={"Index.readme.header"} />
</h2>
</Grid>
<Grid tablet={{ col: 8 }} className="usa-prose">
<Trans i18nKey={"Index.readme.description"} />
</Grid>
</Grid>
</section>
<section className="grid-container usa-section">
<Grid row gap>
<Grid
tablet={{ col: 4 }}
className="usa-media-block"
key="logo-uswds"
>
<a
key="uswds-href"
href={t("Index.uswds.uswdsHref") || "#brokenLink"}
>
<img
src="img/uswds.svg"
alt={t("Index.uswds.uswdsAlt") || "Logo"}
className="usa-media-block__img height-15 width-15 "
/>
</a>
</Grid>
<Grid tablet={{ col: 4 }}>
<h3 className="font-heading-xl margin-top-0 tablet:margin-bottom-0 text-primary-darker">
<Trans i18nKey={"Index.uswds.header"} />
</h3>
</Grid>
</Grid>
<Grid row gap>
<Grid tablet={{ col: 4 }}></Grid>
<Grid tablet={{ col: 4 }} className="usa-prose">
<Trans i18nKey={"Index.uswds.description"} />
</Grid>
</Grid>
</section>
<section className="usa-section usa-section--dark">
<GridContainer>
<div className="usa-hero__callout bg-accent-warm-dark margin-bottom-2">
<h1 className="usa-hero__heading">
<span className="usa-hero__heading--alt">
<Trans i18nKey={"Index.technologies.title"} />:
</span>
</h1>
<Trans i18nKey={"Index.technologies.subtitle"} />
</div>
{Griddify([
{
src: "img/remix.svg",
alt: "Remix",
href: "https://remix.run",
},
{
src: "img/postgres.png",
alt: "PostgreSQL",
href: "https://www.postgresql.org/",
},
{
src: "img/prisma.svg",
alt: "Prisma",
href: "https://prisma.io",
},
{
src: "img/testing-library.png",
alt: "Testing Library",
href: "https://testing-library.com",
},
{
src: "img/playwright.png",
alt: "Playwright",
href: "https://playwright.dev",
},
{
src: "img/jest.png",
alt: "Jest",
href: "https://jestjs.io/",
},
{
src: "img/prettier.svg",
alt: "Prettier",
href: "https://prettier.io",
},
{
src: "img/ts.svg",
alt: "TypeScript",
href: "https://typescriptlang.org",
},
])}
</GridContainer>
</section>
</div>
);
}