Skip to content

Commit 2f89225

Browse files
outlook84xrgzs
andauthored
fix: improve responsive layout of upload page (#112)
* fix: improve responsive layout of upload page This commit enhances the user experience on the upload page for mobile devices. - Adjusts the width of the uploader selection for better accessibility on small screens. - Enlarges the upload icons for improved visibility. - Modifies the layout of action buttons to stack vertically on smaller viewports, preventing UI clutter. * Update Upload.tsx --------- Co-authored-by: MadDogOwner <[email protected]>
1 parent 314172f commit 2f89225

File tree

1 file changed

+43
-26
lines changed

1 file changed

+43
-26
lines changed

src/pages/home/uploads/Upload.tsx

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
ProgressIndicator,
1212
Button,
1313
Box,
14+
Stack,
1415
} from "@hope-ui/solid"
1516
import { createSignal, For, Show } from "solid-js"
1617
import { usePath, useRouter, useT } from "~/hooks"
@@ -198,6 +199,9 @@ const Upload = () => {
198199
justifyContent="center"
199200
border={`2px dashed ${drag() ? getMainColor() : "$neutral8"}`}
200201
rounded="$lg"
202+
spacing="$4"
203+
p="$6"
204+
minH="$56"
201205
onDragOver={(e: DragEvent) => {
202206
e.preventDefault()
203207
setDrag(true)
@@ -232,16 +236,15 @@ const Upload = () => {
232236
}
233237
handleAddFiles(res)
234238
}}
235-
spacing="$4"
236-
// py="$4"
237-
h="$56"
238239
>
239240
<Show
240241
when={!drag()}
241242
fallback={<Heading>{t("home.upload.release")}</Heading>}
242243
>
243-
<Heading>{t("home.upload.upload-tips")}</Heading>
244-
<Box w="30%">
244+
<Heading size="lg" textAlign="center">
245+
{t("home.upload.upload-tips")}
246+
</Heading>
247+
<Box w={{ "@initial": "80%", "@md": "30%" }}>
245248
<SelectWrapper
246249
value={curUploader().name}
247250
onChange={(name) => {
@@ -258,27 +261,41 @@ const Upload = () => {
258261
/>
259262
</Box>
260263
<HStack spacing="$4">
261-
<IconButton
262-
compact
263-
size="xl"
264-
aria-label={t("home.upload.upload_folder")}
265-
colorScheme="accent"
266-
icon={<RiDocumentFolderUploadFill />}
267-
onClick={() => {
268-
folderInput.click()
269-
}}
270-
/>
271-
<IconButton
272-
compact
273-
size="xl"
274-
aria-label={t("home.upload.upload_files")}
275-
icon={<RiDocumentFileUploadFill />}
276-
onClick={() => {
277-
fileInput.click()
278-
}}
279-
/>
264+
<VStack spacing="$2" alignItems="center">
265+
<IconButton
266+
compact
267+
size="xl"
268+
aria-label={t("home.upload.upload_folder")}
269+
colorScheme="accent"
270+
icon={<RiDocumentFolderUploadFill size="1.2em" />}
271+
onClick={() => {
272+
folderInput.click()
273+
}}
274+
/>
275+
<Text fontSize="$sm" color="$neutral11" textAlign="center">
276+
{t("home.upload.upload_folder")}
277+
</Text>
278+
</VStack>
279+
280+
<VStack spacing="$2" alignItems="center">
281+
<IconButton
282+
compact
283+
size="xl"
284+
aria-label={t("home.upload.upload_files")}
285+
icon={<RiDocumentFileUploadFill size="1.2em" />}
286+
onClick={() => {
287+
fileInput.click()
288+
}}
289+
/>
290+
<Text fontSize="$sm" color="$neutral11" textAlign="center">
291+
{t("home.upload.upload_files")}
292+
</Text>
293+
</VStack>
280294
</HStack>
281-
<HStack spacing="$4">
295+
<Stack
296+
spacing={{ "@initial": "$2", "@md": "$4" }}
297+
direction={{ "@initial": "column", "@md": "row" }}
298+
>
282299
<Checkbox
283300
checked={asTask()}
284301
onChange={() => {
@@ -303,7 +320,7 @@ const Upload = () => {
303320
>
304321
{t("home.upload.try_rapid")}
305322
</Checkbox>
306-
</HStack>
323+
</Stack>
307324
</Show>
308325
</VStack>
309326
</Show>

0 commit comments

Comments
 (0)