Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
project_ss23_gameunity
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
Service Desk
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
Yusuf Akgül
project_ss23_gameunity
Commits
6c59f1e2
Commit
6c59f1e2
authored
1 year ago
by
Yusuf Akgül
Browse files
Options
Downloads
Plain Diff
Merge branch 'UserProfile' into 'main'
Log Out button See merge request
!18
parents
1ed0fc36
6645dbe4
No related branches found
No related tags found
1 merge request
!18
Log Out button
Pipeline
#35720
passed
1 year ago
Stage: build
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/(content)/layout.tsx
+0
-2
0 additions, 2 deletions
app/(content)/layout.tsx
components/nav.tsx
+13
-4
13 additions, 4 deletions
components/nav.tsx
with
13 additions
and
6 deletions
app/(content)/layout.tsx
+
0
−
2
View file @
6c59f1e2
...
...
@@ -5,7 +5,6 @@ import { dashboardConfig } from "@/lib/config/dashboard"
interface
DashboardLayoutProps
{
children
?:
React
.
ReactNode
}
export
default
async
function
ContentLayout
({
children
,
}:
DashboardLayoutProps
)
{
...
...
@@ -15,7 +14,6 @@ export default async function ContentLayout({
<
aside
className
=
"hidden w-[200px] flex-col md:flex"
>
<
div
className
=
"sticky top-0"
>
<
DashboardNav
items
=
{
dashboardConfig
.
sidebarNav
}
/>
<
button
>
Logout
</
button
>
</
div
>
</
aside
>
<
main
className
=
"flex w-full flex-1 flex-col overflow-hidden"
>
...
...
This diff is collapsed.
Click to expand it.
components/nav.tsx
+
13
−
4
View file @
6c59f1e2
...
...
@@ -7,6 +7,7 @@ import { SidebarNavItem } from "@/types";
import
Link
from
"
next/link
"
;
import
{
usePathname
}
from
"
next/navigation
"
;
import
{
ModeToggle
}
from
"
./mode-toggle
"
;
import
{
signIn
,
signOut
,
useSession
}
from
"
next-auth/react
"
interface
DashboardNavProps
{
items
:
SidebarNavItem
[]
...
...
@@ -14,11 +15,11 @@ interface DashboardNavProps {
export
default
function
DashboardNav
({
items
}:
DashboardNavProps
)
{
const
path
=
usePathname
()
const
{
data
:
session
}
=
useSession
();
if
(
!
items
?.
length
)
{
return
null
}
const
isLoaded
=
true
const
user
=
"
test
"
...
...
@@ -30,7 +31,7 @@ export default function DashboardNav({ items }: DashboardNavProps) {
<
Icons
.
logoWhite
className
=
"h-7 w-7 hidden dark:block"
/>
</
Link
>
</
div
>
{
isLoaded
&&
user
?
{
session
?.
user
&&
isLoaded
&&
user
?
(
items
.
map
((
item
,
index
)
=>
{
const
Icon
=
Icons
[
item
.
icon
as
keyof
IconsType
||
"
arrowRight
"
];
if
(
item
.
title
===
"
My Profile
"
)
{
...
...
@@ -62,7 +63,15 @@ export default function DashboardNav({ items }: DashboardNavProps) {
</
p
>
</
div
>
}
<
ModeToggle
/>
{
session
?.
user
&&
<>
<
p
className
=
"text-sky-600"
>
{
session
?.
user
.
name
}
</
p
>
<
button
className
=
" text-red-500"
onClick
=
{
()
=>
signOut
()
}
>
Sign Out
</
button
>
</>
}
<
ModeToggle
/>
</
nav
>
)
}
\ 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