-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
File uploader beta overrides example (#5341)
* File uploader beta overrides example * Adjust overrides example style
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
documentation-site/examples/file-uploader-beta/overrides.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import * as React from "react"; | ||
import { FileUploaderBeta, type FileRow } from "baseui/file-uploader-beta"; | ||
import { useStyletron } from "baseui"; | ||
|
||
export default function Example() { | ||
const [fileRows, setFileRows] = React.useState<Array<FileRow>>([ | ||
{ | ||
file: new File(["test file 1"], "file-1.txt"), | ||
status: "processed", | ||
errorMessage: null, | ||
}, | ||
{ | ||
file: new File(["test file 2"], "file-2.txt"), | ||
status: "error", | ||
errorMessage: "Failed to upload", | ||
}, | ||
]); | ||
const [, theme] = useStyletron(); | ||
return ( | ||
<FileUploaderBeta | ||
fileRows={fileRows} | ||
setFileRows={setFileRows} | ||
overrides={{ | ||
ButtonComponent: { | ||
props: { | ||
overrides: { | ||
BaseButton: { | ||
style: { | ||
outline: `${theme.colors.warning} solid`, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
ContentMessage: { | ||
style: { | ||
color: theme.colors.warning, | ||
}, | ||
}, | ||
FileDragAndDrop: { | ||
style: { | ||
borderLeftColor: theme.colors.warning, | ||
borderRightColor: theme.colors.warning, | ||
borderTopColor: theme.colors.warning, | ||
borderBottomColor: theme.colors.warning, | ||
}, | ||
}, | ||
FileRows: { | ||
style: { | ||
marginLeft: theme.sizing.scale0, | ||
marginRight: theme.sizing.scale0, | ||
outline: `${theme.colors.warning} dashed`, | ||
}, | ||
}, | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters