mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-20 15:43:13 +09:00
Correctly disable dropzone when host is offline
This commit is contained in:
1 parent
05b697fd24
commit
c6abe29e89
4 files changed
+22
-13
No files matched your search
@@ -6,13 +6,14 @@ import { DraggingContext } from "../model/is_dragging";
|
||||
|
||||
export default function UploadButton(props: React.ComponentProps<typeof Button>) {
|
||||
const isDroppingFile = useContext(DraggingContext);
|
||||
const borderColor = props.disabled ? "gray" : "rgb(22, 119, 255)";
|
||||
return <Button
|
||||
className="dropzone"
|
||||
className={`dropzone ${props.disabled ? "disabled" : "enabled"}`}
|
||||
{...props}
|
||||
style={{
|
||||
...props.style,
|
||||
// Distinct border when dropping file
|
||||
border: isDroppingFile ? "dashed 2px rgb(22, 119, 255)" : undefined,
|
||||
border: isDroppingFile ? `dashed 2px ${borderColor}` : undefined,
|
||||
}}
|
||||
icon={isDroppingFile ? <InboxOutlined /> : props.icon || <UploadOutlined />}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user