Skip to content

Commit d4180c1

Browse files
authored
Refactor/NS-24-improve-src-directory-structure (#60)
* refactor: add types directory * refactor: improve components directory structure
1 parent 426f08a commit d4180c1

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

src/app/layout.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { PropsWithChildren } from 'react';
44
import type { Metadata } from 'next';
55

66
import { Footer } from '@/components/footer';
7-
import { Header } from '@/components/header';
7+
import { Navbar } from '@/components/navbar/navbar';
88
import { ThemeProvider } from '@/components/theme-provider';
99
import { siteConfig } from '@/lib/constant';
1010
import { fonts } from '@/lib/fonts';
@@ -49,7 +49,7 @@ const RootLayout = ({ children }: PropsWithChildren) => {
4949
<html lang="en" suppressHydrationWarning>
5050
<body className={cn('min-h-screen font-sans', fonts)}>
5151
<ThemeProvider attribute="class">
52-
<Header />
52+
<Navbar />
5353
{children}
5454
<Footer />
5555
</ThemeProvider>

src/components/header.tsx src/components/navbar/navbar.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Link from 'next/link';
22
import { getServerSession } from 'next-auth';
33

44
import { authOptions } from '@/app/api/auth/[...nextauth]/auth-options';
5-
import { SignInButton } from '@/components/sign-in-button';
6-
import { ThemeToggle } from '@/components/theme-toggle';
7-
import { UserDropdown } from '@/components/user-dropdown';
5+
import { SignInButton } from '@/components/navbar/sign-in-button';
6+
import { ThemeToggle } from '@/components/navbar/theme-toggle';
7+
import { UserDropdown } from '@/components/navbar/user-dropdown';
88

9-
export const Header = async () => {
9+
export const Navbar = async () => {
1010
const session = await getServerSession(authOptions);
1111

1212
return (
File renamed without changes.
File renamed without changes.

src/components/user-dropdown.tsx src/components/navbar/user-dropdown.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const UserDropdown = ({ session }: { session: Session }) => {
1717
<DropdownMenu>
1818
<DropdownMenuTrigger>
1919
<Image
20+
className="overflow-hidden rounded-full"
2021
src={`${session.user?.image}`}
2122
alt={`${session.user?.name}`}
2223
width={32}

src/types/user.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export type TUser = {
2+
id: string;
3+
email: string;
4+
name: string;
5+
image: string;
6+
};

0 commit comments

Comments
 (0)