feat: basic ui layout

This commit is contained in:
鲁树人
2023-05-07 23:29:37 +01:00
parent 53682a1cdb
commit 38aa81b5bc
16 changed files with 375 additions and 104 deletions

View File

@@ -1,25 +1,44 @@
import { Box, Stack, Text } from '@chakra-ui/react';
import { UnlockIcon } from '@chakra-ui/icons';
import { useId } from 'react';
import { PointerLabel } from './PointerLabel';
import { Box, Text } from '@chakra-ui/react';
import { UnlockIcon } from '@chakra-ui/icons';
export function SelectFile() {
const id = useId();
return (
<Box borderWidth="1px" borderRadius="lg" p="6">
<Stack alignItems="center">
<UnlockIcon />
<Box>
<PointerLabel htmlFor={id}>
<Text as="span" color="teal.400">
</Text>
</PointerLabel>
<input id={id} type="file" hidden multiple />
</Box>
</Stack>
<Box
as="label"
htmlFor={id}
w="100%"
maxW={480}
borderWidth="1px"
borderRadius="lg"
transitionDuration="0.5s"
p="6"
cursor="pointer"
display="flex"
flexDir="column"
alignItems="center"
_hover={{
borderColor: 'gray.400',
bg: 'gray.50',
}}
>
<Box pb={3}>
<UnlockIcon boxSize={8} />
</Box>
<Box textAlign="center">
{/* 将文件拖到此处,或 */}
<Text as="span" color="teal.400">
</Text>
<input id={id} type="file" hidden multiple />
<Text fontSize="sm" opacity="50%">
</Text>
</Box>
</Box>
);
}