Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Ceph Webapp Poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Jacopo Gasparetto
Ceph Webapp Poc
Commits
fe9e09dc
Commit
fe9e09dc
authored
2 years ago
by
Jacopo Gasparetto
Browse files
Options
Downloads
Patches
Plain Diff
Add enabled/disabled functionaly to Button component
parent
8d649db5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/Button.tsx
+5
-1
5 additions, 1 deletion
frontend/src/components/Button.tsx
frontend/src/routes/BucketBrowser/index.tsx
+19
-13
19 additions, 13 deletions
frontend/src/routes/BucketBrowser/index.tsx
with
24 additions
and
14 deletions
frontend/src/components/Button.tsx
+
5
−
1
View file @
fe9e09dc
...
...
@@ -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
?
...
...
This diff is collapsed.
Click to expand it.
frontend/src/routes/BucketBrowser/index.tsx
+
19
−
13
View file @
fe9e09dc
...
...
@@ -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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment