Skip to content

Commit b7844a6

Browse files
Refactor CSS to add utility classes for flex center and flex between
1 parent 79742c7 commit b7844a6

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

app/globals.css

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
@tailwind components;
33
@tailwind utilities;
44

5+
@layer utilities{
6+
.flex-center{
7+
@apply flex justify-center items-center;
8+
}
9+
10+
.flex-between{
11+
@apply flex justify-between items-center;
12+
}
13+
}
14+
515
:root {
616
--background: #ffffff;
717
--foreground: #171717;

app/layout.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Metadata } from "next";
22
import "./globals.css";
33
import { Inter } from "next/font/google";
4+
import { ClerkProvider } from "@clerk/nextjs";
45

56
const inter = Inter({ subsets: ["latin"] });
67

@@ -17,9 +18,11 @@ export default function RootLayout({
1718
}>) {
1819
return (
1920
<html lang="en">
21+
<ClerkProvider>
2022
<body className={`${inter.className} bg-dark-2`}>
2123
{children}
2224
</body>
25+
</ClerkProvider>
2326
</html>
2427
);
2528
}

components/Navbar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const Navbar = () => {
2121
</Link>
2222
<div className="flex-between gap-5">
2323
<SignedIn>
24-
<UserButton afterSignOutUrl="/sign-in" />
24+
<UserButton/>
2525
</SignedIn>
2626

2727
<MobileNav />

components/Sidebar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const Sidebar = () => {
1212
<section className="sticky left-0 top-0 flex h-screen w-fit flex-col justify-between bg-dark-1 p-6 pt-28 text-white max-sm:hidden lg:w-[264px]">
1313
<div className="flex flex-1 flex-col gap-6">
1414
{sidebarLinks.map((link) => {
15-
const isActive = pathname === link.route || pathname.startsWith(link.route);
15+
const isActive = pathname === link.route || pathname.startsWith(`$(link.route)/`);
1616

1717
return (
1818
<Link

middleware.ts

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { clerkMiddleware, createRouteMatcher } from '@clerk/nextjs/server'
2+
3+
const protectedRoutes = createRouteMatcher([
4+
'/',
5+
'/upcoming',
6+
'/previous',
7+
'/recordings',
8+
'/personal-room',
9+
'/meeting(.*)'
10+
])
11+
12+
export default clerkMiddleware((auth, req) => {
13+
if(protectedRoutes(req)) auth().protect();
14+
})
15+
16+
export const config = {
17+
matcher: [
18+
// Skip Next.js internals and all static files, unless found in search params
19+
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
20+
// Always run for API routes
21+
'/(api|trpc)(.*)',
22+
],
23+
}

0 commit comments

Comments
 (0)