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
6b9acd89
Commit
6b9acd89
authored
1 year ago
by
Jacopo Gasparetto
Browse files
Options
Downloads
Patches
Plain Diff
Style drawer buttons
parent
1fa402c8
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
+1
-1
1 addition, 1 deletion
frontend/src/components/Button.tsx
frontend/src/components/Drawer.tsx
+26
-13
26 additions, 13 deletions
frontend/src/components/Drawer.tsx
with
27 additions
and
14 deletions
frontend/src/components/Button.tsx
+
1
−
1
View file @
6b9acd89
...
...
@@ -12,7 +12,7 @@ export const Button = (props: ButtonProps) => {
return
(
<
div
className
=
{
props
.
className
}
>
<
button
className
=
"border rounded p-4 hover:bg-neutral-200 w-full h-full"
className
=
"border
border-colo
rounded p-4 hover:bg-neutral-200 w-full h-full"
type
=
{
props
.
type
}
onClick
=
{
props
.
onClick
}
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/components/Drawer.tsx
+
26
−
13
View file @
6b9acd89
import
{
staticRoutes
}
from
'
../routes
'
;
import
{
useOAuth
}
from
'
../services/OAuth2
'
;
import
{
Link
}
from
'
react-router-dom
'
;
import
{
Button
}
from
'
./Button
'
;
import
{
ArrowLeftOnRectangleIcon
}
from
'
@heroicons/react/24/outline
'
;
export
const
Drawer
=
()
=>
{
const
{
user
,
logout
}
=
useOAuth
();
const
path
=
window
.
location
.
pathname
;
const
links
=
staticRoutes
.
map
(
route
=>
{
let
className
=
"
h-10 hover:bg-neutral-300 rounded-lg p-2
"
;
className
+=
route
.
path
===
path
?
"
bg-neutral-200
"
:
""
;
let
className
=
"
h-10 flex hover:text-white hover:bg-infn items-center hover:rounded-lg ph-4
"
;
if
(
route
.
path
===
path
)
{
className
+=
"
rounded-lg bg-gray-200
"
;
}
return
(
<
li
className
=
{
className
}
key
=
{
route
.
path
}
>
<
Link
className
=
"block h-10"
to
=
{
route
.
path
}
>
{
route
.
title
}
</
Link
>
<
Link
className
=
'p-4'
to
=
{
route
.
path
}
>
{
route
.
title
}
</
Link
>
</
li
>
)
});
const
{
user
}
=
useOAuth
();
const
userName
:
string
|
null
=
user
?.
profile
&&
user
?.
profile
[
"
name
"
]
?
user
?.
profile
[
"
name
"
]
:
null
;
return
(
<>
return
(
<
div
className
=
'h-full bg-gray-100 dark:bg-gray-800'
>
<
img
className
=
"w-full bg-gray-100 p-4"
alt
=
""
src
=
"/logo530.png"
/>
<
nav
className
=
"h-full p-4 bg-gray-100 dark:bg-gray-800"
>
<
div
>
{
userName
?
<
div
className
=
'p-4 text-xl font-semibold'
>
{
userName
}
</
div
>
:
null
userName
?
<
div
className
=
'p-4
mx-auto
text-xl font-semibold'
>
{
userName
}
</
div
>
:
null
}
<
ul
>
{
links
}
</
ul
>
</
nav
>
</>
<
nav
className
=
'p-4'
>
<
ul
>
{
links
}
</
ul
>
</
nav
>
</
div
>
<
Button
className
=
'p-8 absolute inset-x-0 bottom-4'
title
=
'Logout'
icon
=
{
<
ArrowLeftOnRectangleIcon
/>
}
onClick
=
{
logout
}
/>
</
div
>
)
}
\ No newline at end of file
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