Skip to content
Snippets Groups Projects
Commit fe9e09dc authored by Jacopo Gasparetto's avatar Jacopo Gasparetto
Browse files

Add enabled/disabled functionaly to Button component

parent 8d649db5
No related branches found
No related tags found
No related merge requests found
......@@ -5,16 +5,20 @@ interface ButtonProps {
className?: string,
title: string,
icon?: ReactNode
disabled?: boolean
onClick?: () => void
}
export const Button = (props: ButtonProps) => {
const classNameEnabled = "border border-color rounded p-4 hover:bg-neutral-200";
const classNameDisabled = "border border-color rounded p-4 text-neutral-200";
return (
<div className={props.className}>
<button
className="border border-colorounded p-4 hover:bg-neutral-200"
className={props.disabled ? classNameDisabled : classNameEnabled}
type={props.type}
onClick={props.onClick}
disabled={props.disabled}
>
<div className="flex">
{props.icon ?
......
......@@ -169,19 +169,25 @@ export const BucketBrowser = ({ bucketName }: PropsType) => {
icon={<ArrowLeftIcon />}
onClick={() => navigate(-1)}
/>
<InputFile onChange={handleFileChange} />
<Button
title="Upload file"
icon={<ArrowUpOnSquareIcon />}
onClick={upload}
/>
<Button
title="Delete file(s)"
icon={<TrashIcon />}
onClick={deleteSelectedObjects}
/>
<div className="flex place-content-center">
<div className="flex w-2/3">
<div className='container w-2/3'>
<div className="flex mt-8 place-content-between">
<div className='flex space-x-4'>
<InputFile onChange={handleFileChange} />
<Button
title="Upload file"
icon={<ArrowUpOnSquareIcon />}
onClick={upload}
/>
</div>
<Button
title="Delete file(s)"
icon={<TrashIcon />}
onClick={deleteSelectedObjects}
disabled={selectedRows.size === 0}
/>
</div>
<div className="flex place-content-center mt-4">
<Table
selectable={true}
columns={columns}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment