Skip to content

Commit 103ce2c

Browse files
committed
refactor: use ui elements from @eventer/ui package
1 parent 5b0c9e3 commit 103ce2c

File tree

10 files changed

+22
-24
lines changed

10 files changed

+22
-24
lines changed

apps/web/src/app/auth/callback/page.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { Button } from "@eventer/ui";
34
import Image from "next/image";
45
import { useRouter } from "next/navigation";
56
import { useEffect, useState } from "react";
@@ -168,13 +169,9 @@ export default function AuthCallback() {
168169
</div>
169170
<h2 className="text-xl font-semibold text-red-900">Authentication Failed</h2>
170171
<p className="text-red-600 mt-2">{message}</p>
171-
<button
172-
type="button"
173-
onClick={() => router.push("/")}
174-
className="mt-4 bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700"
175-
>
172+
<Button type="button" onClick={() => router.push("/")}>
176173
Go Home
177-
</button>
174+
</Button>
178175
</>
179176
)}
180177
</div>

apps/web/src/app/auth/login/page.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use client";
22

3+
import { Button } from "@eventer/ui";
34
import Image from "next/image";
45
import { useRouter } from "next/navigation";
56
import { useEffect, useState } from "react";
@@ -70,13 +71,9 @@ export default function TestPage() {
7071
<p className="text-xs text-gray-400 mt-1">ID: {user.id}</p>
7172
</div>
7273
</div>
73-
<button
74-
type="button"
75-
onClick={handleSignOut}
76-
className="w-full mt-4 py-2 px-4 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
77-
>
74+
<Button type="button" onClick={handleSignOut} variant="destructive">
7875
Sign Out
79-
</button>
76+
</Button>
8077
</div>
8178
</div>
8279
</div>
@@ -94,13 +91,9 @@ export default function TestPage() {
9491
</p>
9592
</div>
9693
<div>
97-
<button
98-
type="button"
99-
onClick={handleGoogleSignIn}
100-
className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"
101-
>
94+
<Button type="button" onClick={handleGoogleSignIn}>
10295
Sign in with Google
103-
</button>
96+
</Button>
10497
</div>
10598
</div>
10699
</div>

apps/web/src/app/events/layout.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
// Auth Guard for Dashboard Page
44

5+
import { Button } from "@eventer/ui";
56
import { useRouter } from "next/navigation";
67
import { useEffect, useState } from "react";
78
import { client } from "@/lib/client";
@@ -49,13 +50,9 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
4950
<div className="min-h-screen flex flex-col">
5051
<header className="bg-gray-800 text-white flex justify-between p-4">
5152
<h1 className="text-xl">Dashboard</h1>
52-
<button
53-
type="button"
54-
onClick={() => handleLogout()}
55-
className="bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded"
56-
>
53+
<Button type="button" onClick={() => handleLogout()} variant="destructive">
5754
Logout
58-
</button>
55+
</Button>
5956
</header>
6057
<main className="flex-1 p-6 bg-gray-100">{children}</main>
6158
</div>

packages/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"type": "module",
66
"exports": {
7+
".": "./src/index.ts",
78
"./*": "./src/*.tsx",
89
"./globals.css": "./src/globals.css"
910
},
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./button";
2+
export * from "./input";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from "./atoms";
2+
export * from "./molecules";
3+
export * from "./organisms";
4+
export * from "./templates";
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

packages/ui/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./components";

0 commit comments

Comments
 (0)