Skip to content

Commit 6ed333d

Browse files
committed
style(website): redesign list with screenshot
1 parent d534db2 commit 6ed333d

File tree

3 files changed

+25
-68
lines changed

3 files changed

+25
-68
lines changed

apps/website/public/translations/en/translation.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@
9797
"get_started": "Get started"
9898
},
9999
"components": {
100-
"link_learn_more": "Learn more...",
101-
"list_with_screenshot_alt": "Screenshot of the feature being selected"
100+
"link_learn_more": "Learn more..."
102101
},
103102
"download_now": {
104103
"text": "Download now ",

apps/website/src/pages/Home/index.css

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -183,72 +183,43 @@ section.faq {
183183
display: flex;
184184
}
185185

186+
h3 {
187+
color: var(--brand-1);
188+
}
189+
186190
ul {
187191
list-style-type: none;
188192
margin: 0;
189193
padding: 0;
194+
gap: 1em;
195+
display: grid;
196+
197+
@media (min-width: 720px) {
198+
grid-template-columns: 1fr 1fr 1fr;
199+
}
190200

191201
li {
192-
margin-bottom: 1em;
193-
194-
&:last-of-type {
195-
margin-bottom: 0;
196-
}
202+
margin: 0;
197203

198204
.card {
199205
border: 1px solid transparent;
200-
}
201-
202-
&.selected .card {
203-
border: 1px solid var(--brand-1);
204-
}
206+
height: 100%;
207+
}
205208
}
206209
}
207210

208211
.details {
209-
flex-basis: 50%;
210-
flex-shrink: 0;
212+
max-height: 35vh;
213+
overflow: hidden;
214+
display: flex;
215+
flex-direction: column;
211216

212217
@media (max-width: 719px) {
213218
margin-top: 1em;
214219
}
215220
}
216221

217-
&.horizontal {
218-
flex-direction: column-reverse;
219-
220-
ul {
221-
gap: 1em;
222-
display: grid;
223-
224-
@media (min-width: 720px) {
225-
grid-template-columns: 1fr 1fr 1fr;
226-
}
227-
}
228-
229-
li {
230-
margin: 0;
231-
}
232-
233-
.card {
234-
height: 100%;
235-
}
236-
237-
h3 {
238-
color: var(--brand-1);
239-
}
240-
241-
.details {
242-
max-height: 35vh;
243-
overflow: hidden;
244-
display: flex;
245-
flex-direction: column;
246-
247-
img {
248-
height: 100%;
249-
width: auto;
250-
object-fit: contain;
251-
}
252-
}
222+
img {
223+
object-fit: contain;
253224
}
254225
}

apps/website/src/pages/Home/index.tsx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function NoteTypesSection() {
132132
const { t } = useTranslation();
133133
return (
134134
<Section className="note-types" title={t("note_types.title")}>
135-
<ListWithScreenshot horizontal items={[
135+
<ListWithScreenshot items={[
136136
{
137137
title: t("note_types.text_title"),
138138
imageUrl: "/type_text.webp",
@@ -246,39 +246,26 @@ function CollectionsSection() {
246246
);
247247
}
248248

249-
function ListWithScreenshot({ items, horizontal, cardExtra }: {
249+
function ListWithScreenshot({ items, cardExtra }: {
250250
items: { title: string, imageUrl: string, description: string, moreInfo: string, iconSvg?: string }[];
251-
horizontal?: boolean;
252251
cardExtra?: ComponentChildren;
253252
}) {
254-
const [ selectedItem, setSelectedItem ] = useState(items[0]);
255-
const { t } = useTranslation();
256-
257253
return (
258-
<div className={`list-with-screenshot ${horizontal ? "horizontal" : ""}`}>
254+
<div className={`list-with-screenshot`}>
259255
<ul>
260256
{items.map(item => (
261-
<li className={`${item === selectedItem ? "selected" : ""}`}>
257+
<li>
262258
<Card
263259
title={item.title}
264-
onMouseEnter={() => setSelectedItem(item)}
265-
onClick={() => setSelectedItem(item)}
266260
moreInfoUrl={item.moreInfo}
267261
iconSvg={item.iconSvg}
262+
imageUrl={item.imageUrl}
268263
>
269264
{item.description}
270265
</Card>
271266
</li>
272267
))}
273268
</ul>
274-
275-
<div className="details">
276-
{selectedItem && (
277-
<>
278-
<img src={selectedItem.imageUrl} alt={t("components.list_with_screenshot_alt")} loading="lazy" />
279-
</>
280-
)}
281-
</div>
282269
</div>
283270
)
284271
}

0 commit comments

Comments
 (0)