Skip to content

Commit 88b8dcd

Browse files
committed
feat: update grid column sizes from lg to md for improved responsiveness
1 parent 4e2de4c commit 88b8dcd

File tree

5 files changed

+53
-62
lines changed

5 files changed

+53
-62
lines changed

src/routes/CampaignsRoute/CampaignsRoute.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function CampaignsRoute(props: {
6868
<Grid
6969
columns={{
7070
sm: "2",
71-
lg: "3",
71+
md: "3",
7272
}}
7373
gap="6"
7474
width="auto"

src/routes/CreatorRoute/CreatorRoute.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function CreatorRoute(props: {
4646
<Grid
4747
columns={{
4848
sm: "2",
49-
lg: "3",
49+
md: "3",
5050
}}
5151
gap="6"
5252
width="auto"

src/routes/HomeRoute/HomeRoute.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function HomeRoute(props: {
118118
<Grid
119119
columns={{
120120
sm: "2",
121-
lg: "3",
121+
md: "3",
122122
}}
123123
gap="6"
124124
width="auto"
@@ -185,7 +185,7 @@ export function HomeRoute(props: {
185185
<Grid
186186
columns={{
187187
sm: "2",
188-
lg: "3",
188+
md: "3",
189189
}}
190190
gap="6"
191191
width="auto"

src/routes/ResourceRoute/ResourceRoute.tsx

+47-50
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import React from "react";
1919
import {
2020
getMdxComponents,
2121
MDXH1,
22-
MDXH3,
2322
MDXH4,
2423
MDXWrapper,
2524
} from "../../components/client/MDX/MDX";
@@ -259,30 +258,31 @@ export function ResourceRoute(props: {
259258
</Inset>
260259
</Box>
261260
)}
261+
262262
<Box>
263-
<MDXH3>{props.resource.data.name}</MDXH3>
263+
<Text size="5" weight={"bold"} className="mt-2 block">
264+
{props.resource.data.name}
265+
</Text>
264266
<Link
265267
href={AppUrl.creator({
266268
id: props.creator.id,
267269
})}
268270
color="gray"
269271
className="hover:text-(--accent-12)"
270272
>
271-
<Text size={"4"}>By {props.creator.data.name}</Text>
273+
<Text size={"3"} className="block">
274+
By {props.creator.data.name}
275+
</Text>
272276
</Link>
273277
</Box>
274278
</Flex>
279+
<Box>{renderLocalesDropdown()}</Box>
280+
275281
<Box>
276282
{Object.keys(props.doc.sidebar.categories).map((category) => {
277283
return (
278284
<React.Fragment key={category}>
279-
<Heading
280-
size="1"
281-
mt="3"
282-
mb="1"
283-
className="uppercase"
284-
color="gray"
285-
>
285+
<Heading size="2" className="mt-3 mb-2 uppercase" color="gray">
286286
{category}
287287
</Heading>
288288
<Flex direction="column">
@@ -314,13 +314,7 @@ export function ResourceRoute(props: {
314314
})}
315315
{Object.keys(props.doc.sidebar.categories).length === 0 ? (
316316
<>
317-
<Heading
318-
size="1"
319-
mt="3"
320-
mb="1"
321-
className="uppercase"
322-
color="gray"
323-
>
317+
<Heading size="2" className="mt-3 mb-2 uppercase" color="gray">
324318
Chapters
325319
</Heading>
326320
</>
@@ -348,43 +342,46 @@ export function ResourceRoute(props: {
348342
);
349343
})}
350344
</Box>
351-
<Box>
352-
<Select.Root
353-
defaultValue={props.resource.data._locale}
354-
size={"1"}
355-
onValueChange={(newLocale) => {
356-
location.href = AppUrl.resourcePage({
357-
id: [
358-
props.resource.data._idWithoutLocale,
359-
newLocale === "en" ? "" : newLocale,
360-
].join("/") as CollectionEntry<"resources">["id"],
361-
page: "",
362-
});
363-
}}
364-
>
365-
<Select.Trigger />
366-
<Select.Content>
367-
{props.locales.map((locale) => {
368-
const codeToWord: Record<string, string> = {
369-
en: "English",
370-
es: "Español",
371-
fr: "Français",
372-
it: "Italiano",
373-
ua: "Українська",
374-
};
375-
return (
376-
<Select.Item key={locale} value={locale}>
377-
{codeToWord[locale]}
378-
</Select.Item>
379-
);
380-
})}
381-
</Select.Content>
382-
</Select.Root>
383-
</Box>
384345
</Flex>
385346
);
386347
}
387348

349+
function renderLocalesDropdown() {
350+
return (
351+
<Select.Root
352+
defaultValue={props.resource.data._locale}
353+
size={"2"}
354+
onValueChange={(newLocale) => {
355+
location.href = AppUrl.resourcePage({
356+
id: [
357+
props.resource.data._idWithoutLocale,
358+
newLocale === "en" ? "" : newLocale,
359+
].join("/") as CollectionEntry<"resources">["id"],
360+
page: "",
361+
});
362+
}}
363+
>
364+
<Select.Trigger className="w-full" variant="surface" />
365+
<Select.Content>
366+
{props.locales.map((locale) => {
367+
const codeToWord: Record<string, string> = {
368+
en: "English",
369+
es: "Español",
370+
fr: "Français",
371+
it: "Italiano",
372+
ua: "Українська",
373+
};
374+
return (
375+
<Select.Item key={locale} value={locale}>
376+
{codeToWord[locale]}
377+
</Select.Item>
378+
);
379+
})}
380+
</Select.Content>
381+
</Select.Root>
382+
);
383+
}
384+
388385
function renderToc() {
389386
return (
390387
<>

src/routes/SearchRoute/SearchRoute.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,7 @@ export function SearchRoute(props: { indexes: Array<SearchIndexType> }) {
132132
</TextField.Slot>
133133
</TextField.Root>
134134
{shouldDisplayFilters && (
135-
<SegmentedControl.Root
136-
value={type}
137-
size={{
138-
initial: "1",
139-
xs: "3",
140-
}}
141-
>
135+
<SegmentedControl.Root value={type} size={"3"}>
142136
{Object.keys(searchTypes).map((key) => {
143137
return (
144138
<SegmentedControl.Item
@@ -171,7 +165,7 @@ export function SearchRoute(props: { indexes: Array<SearchIndexType> }) {
171165
<Grid
172166
columns={{
173167
sm: "2",
174-
lg: "3",
168+
md: "3",
175169
}}
176170
gap="6"
177171
width="auto"

0 commit comments

Comments
 (0)