Skip to content

Commit cccc54b

Browse files
committed
Using fileupload vars
1 parent 33e0ee0 commit cccc54b

File tree

6 files changed

+1933
-1685
lines changed

6 files changed

+1933
-1685
lines changed

src/components/FileUpload/FileUpload.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ const UploadArea = styled.div<{
2828
$hasFile: boolean;
2929
$isError?: boolean;
3030
}>`
31-
background-color: ${({ theme }) => theme.click.card.secondary.color.background.default};
32-
border: ${({ theme }) => `1px solid ${theme.click.card.primary.color.stroke.default}`};
33-
border-radius: 8px;
31+
background-color: ${({ theme }) => theme.click.fileUpload.color.background.default};
32+
border: ${({ theme }) => `1px solid ${theme.click.fileUpload.color.stroke.default}`};
33+
border-radius: ${({ theme }) => `${theme.click.fileUpload.md.radii.all}`};
3434
padding: ${props => (!props.$hasFile ? "16px" : "8px")};
3535
display: flex;
3636
flex-direction: ${props =>
@@ -69,31 +69,34 @@ const UploadArea = styled.div<{
6969
${props =>
7070
props.$isError &&
7171
css`
72-
background-color: ${({ theme }) => theme.click.alert.color.background.danger};
72+
background-color: ${({ theme }) => theme.click.fileUpload.color.background.error};
7373
border: none;
7474
`}
7575
`;
7676

77+
const FileUploadTitle = styled(Title)`
78+
font-family: ${({ theme }) => theme.click.fileUpload.typography.title.default};
79+
color: ${({ theme }) => theme.click.fileUpload.color.title.default};
80+
`;
81+
82+
const FileUploadDescription = styled(Text)`
83+
font-family: ${({ theme }) => theme.click.fileUpload.typography.description.default};
84+
color: ${({ theme }) => theme.click.fileUpload.color.description.default};
85+
`;
86+
7787
const DocumentIcon = styled(Icon)`
7888
svg {
79-
width: 24px;
80-
height: 24px;
81-
color: ${({ theme }) => theme.global.color.text.muted};
89+
width: ${({ theme }) => theme.click.fileUpload.sm.icon.size.width};
90+
height: ${({ theme }) => theme.click.fileUpload.sm.icon.size.height};
91+
color: ${({ theme }) => theme.click.fileUpload.sm.color.icon.default};
8292
}
8393
`;
8494

8595
const UploadIcon = styled(Icon)`
8696
svg {
87-
width: 32px;
88-
height: 32px;
89-
${({ theme }) =>
90-
theme.name === "dark"
91-
? `
92-
color: ${theme.global.color.text.default};
93-
`
94-
: `
95-
color: ${theme.global.color.text.default};
96-
`}
97+
width: ${({ theme }) => theme.click.fileUpload.md.icon.size.width};
98+
height: ${({ theme }) => theme.click.fileUpload.md.icon.size.height};
99+
color: ${({ theme }) => theme.click.fileUpload.md.color.icon.default};
97100
}
98101
`;
99102

@@ -133,7 +136,7 @@ const FileInfo = styled.div`
133136

134137
const FileDetails = styled.div`
135138
display: flex;
136-
gap: 8px;
139+
gap: ${({ theme }) => theme.click.fileUpload.sm.space.gap};
137140
border: none;
138141
`;
139142

@@ -378,13 +381,10 @@ export const FileUpload = ({
378381
$size={size}
379382
$hasFile={false}
380383
>
381-
<Title type="h1">{title}</Title>
382-
<Text
383-
size={"lg"}
384-
color={"muted"}
385-
>
384+
<FileUploadTitle type="h1">{title}</FileUploadTitle>
385+
<FileUploadDescription>
386386
Files supported: {supportedFileTypes.join(", ")}
387-
</Text>
387+
</FileUploadDescription>
388388
</UploadText>
389389
<Button
390390
type={"secondary"}

0 commit comments

Comments
 (0)