Refactor: Remove server state files and update server log handling
- Deleted server-stopped, server.log, and server.pid files to clean up unused state. - Updated game-page-client.tsx to enhance button accessibility with cursor-pointer class. - Modified not-found.tsx, page.tsx, and profile/page.tsx for consistent cursor-pointer usage on links. - Adjusted search/page.tsx and components/auth/*.tsx for improved button interactions with cursor-pointer. - Refined navbar.tsx for better user experience with cursor-pointer on navigation links. - Updated settings-security-tab.tsx for passkey management API endpoints and improved error handling. - Enhanced saved-games components for better user interaction with cursor-pointer on buttons. - General code cleanup and consistency improvements across various components.
This commit is contained in:
@@ -85,7 +85,7 @@ export default function ForgotPasswordForm() {
|
||||
|
||||
<Link
|
||||
href="/login"
|
||||
className="flex items-center justify-center gap-2 text-sm text-text/50 hover:text-text transition-colors"
|
||||
className="flex items-center justify-center gap-2 text-sm text-text/50 hover:text-text transition-colors cursor-pointer"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
Back to sign in
|
||||
|
||||
@@ -190,7 +190,7 @@ export default function LoginForm() {
|
||||
<div className="text-right">
|
||||
<Link
|
||||
href="/forgot-password"
|
||||
className="text-sm text-text/50 hover:text-text transition-colors"
|
||||
className="text-sm text-text/50 hover:text-text transition-colors cursor-pointer"
|
||||
>
|
||||
Forgot password?
|
||||
</Link>
|
||||
@@ -218,7 +218,7 @@ export default function LoginForm() {
|
||||
Don't have an account?{" "}
|
||||
<Link
|
||||
href="/signup"
|
||||
className="text-primary hover:underline"
|
||||
className="text-primary hover:underline cursor-pointer"
|
||||
>
|
||||
Create one
|
||||
</Link>
|
||||
|
||||
@@ -133,7 +133,7 @@ export default function OtpVerificationStep({
|
||||
|
||||
<button
|
||||
onClick={onBack}
|
||||
className="flex items-center justify-center gap-2 w-full text-sm text-text/50 hover:text-text transition-colors"
|
||||
className="flex items-center justify-center gap-2 w-full text-sm text-text/50 hover:text-text transition-colors cursor-pointer"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
Back to signup
|
||||
|
||||
@@ -208,7 +208,7 @@ export default function ResetPasswordForm({
|
||||
|
||||
<Link
|
||||
href="/login"
|
||||
className="flex items-center justify-center gap-2 text-sm text-text/50 hover:text-text transition-colors"
|
||||
className="flex items-center justify-center gap-2 text-sm text-text/50 hover:text-text transition-colors cursor-pointer"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
Back to sign in
|
||||
|
||||
@@ -143,7 +143,7 @@ export default function SignupFormStep({ onSuccess }: SignupFormStepProps) {
|
||||
|
||||
<p className="text-center text-sm text-text/50">
|
||||
Already have an account?{" "}
|
||||
<Link href="/login" className="text-primary hover:underline">
|
||||
<Link href="/login" className="text-primary hover:underline cursor-pointer">
|
||||
Sign in
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
+10
-10
@@ -217,7 +217,7 @@ export default function Navbar() {
|
||||
key={route.href}
|
||||
href={route.href}
|
||||
title={`Navigate to ${route.title}`}
|
||||
className='text-sm font-medium hover:text-primary transition-colors uppercase'
|
||||
className='text-sm font-medium hover:text-primary transition-colors uppercase cursor-pointer'
|
||||
>
|
||||
{route.title}
|
||||
</Link>
|
||||
@@ -260,7 +260,7 @@ export default function Navbar() {
|
||||
key={route.href}
|
||||
href={route.href}
|
||||
onClick={() => setUserMenuOpen(false)}
|
||||
className='w-full flex items-center gap-2 px-3 py-2 text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors'
|
||||
className='w-full flex items-center gap-2 px-3 py-2 text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors cursor-pointer'
|
||||
>
|
||||
{route.icon === "User" && <User className='h-4 w-4' />}
|
||||
{route.icon === "Bookmark" && <Bookmark className='h-4 w-4' />}
|
||||
@@ -273,7 +273,7 @@ export default function Navbar() {
|
||||
setUserMenuOpen(false)
|
||||
await authClient.signOut()
|
||||
}}
|
||||
className='w-full flex items-center gap-2 px-3 py-2 text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors'
|
||||
className='w-full flex items-center gap-2 px-3 py-2 text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors cursor-pointer'
|
||||
>
|
||||
<LogOut className='h-4 w-4' />
|
||||
Sign out
|
||||
@@ -291,7 +291,7 @@ export default function Navbar() {
|
||||
>
|
||||
<Link
|
||||
href='/login'
|
||||
className='text-sm font-medium hover:text-primary transition-colors uppercase'
|
||||
className='text-sm font-medium hover:text-primary transition-colors uppercase cursor-pointer'
|
||||
>
|
||||
login
|
||||
</Link>
|
||||
@@ -303,7 +303,7 @@ export default function Navbar() {
|
||||
{/* Mobile Hamburger Button */}
|
||||
<button
|
||||
onClick={() => setMobileMenuOpen(true)}
|
||||
className='flex md:hidden flex-row items-center justify-center p-2 -mr-2 rounded-md hover:bg-text/5 transition-colors'
|
||||
className='flex md:hidden flex-row items-center justify-center p-2 -mr-2 rounded-md hover:bg-text/5 transition-colors cursor-pointer'
|
||||
aria-label='Open menu'
|
||||
>
|
||||
<MenuIcon className='h-5 w-5' />
|
||||
@@ -338,7 +338,7 @@ export default function Navbar() {
|
||||
<span className='font-bold text-lg'>Menu</span>
|
||||
<button
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className='p-2 -mr-2 rounded-md hover:bg-text/5 transition-colors'
|
||||
className='p-2 -mr-2 rounded-md hover:bg-text/5 transition-colors cursor-pointer'
|
||||
aria-label='Close menu'
|
||||
>
|
||||
<XIcon className='h-5 w-5' />
|
||||
@@ -350,7 +350,7 @@ export default function Navbar() {
|
||||
key={route.href}
|
||||
href={route.href}
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className={`text-sm font-medium hover:text-primary transition-colors uppercase px-3 py-2 rounded-md hover:bg-text/5 ${
|
||||
className={`text-sm font-medium hover:text-primary transition-colors uppercase px-3 py-2 rounded-md hover:bg-text/5 cursor-pointer ${
|
||||
pathname === route.href
|
||||
? "text-primary bg-text/5"
|
||||
: ""
|
||||
@@ -371,7 +371,7 @@ export default function Navbar() {
|
||||
key={route.href}
|
||||
href={route.href}
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className='flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors'
|
||||
className='flex items-center gap-2 px-3 py-2 rounded-lg text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors cursor-pointer'
|
||||
>
|
||||
{route.icon === "User" && <User className='h-4 w-4' />}
|
||||
{route.icon === "Bookmark" && <Bookmark className='h-4 w-4' />}
|
||||
@@ -383,7 +383,7 @@ export default function Navbar() {
|
||||
setMobileMenuOpen(false)
|
||||
await authClient.signOut()
|
||||
}}
|
||||
className='w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg border border-white/10 text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors'
|
||||
className='w-full flex items-center justify-center gap-2 px-3 py-2 rounded-lg border border-white/10 text-sm text-text/70 hover:text-text hover:bg-text/5 transition-colors cursor-pointer'
|
||||
>
|
||||
<LogOut className='h-4 w-4' />
|
||||
Sign out
|
||||
@@ -394,7 +394,7 @@ export default function Navbar() {
|
||||
<Link
|
||||
href='/login'
|
||||
onClick={() => setMobileMenuOpen(false)}
|
||||
className='block w-full text-center px-3 py-2 rounded-lg border border-white/10 text-sm text-text hover:bg-text/5 transition-colors'
|
||||
className='block w-full text-center px-3 py-2 rounded-lg border border-white/10 text-sm text-text hover:bg-text/5 transition-colors cursor-pointer'
|
||||
>
|
||||
Login
|
||||
</Link>
|
||||
|
||||
@@ -47,7 +47,7 @@ export function SettingsSecurityTab() {
|
||||
let cancelled = false
|
||||
Promise.all([
|
||||
fetch("/api/user/me/auth-methods", { credentials: "include" }).then(r => r.ok ? r.json() : null).catch(() => null),
|
||||
fetch("/api/auth/passkey/list-user-passkeys", { credentials: "include" }).then(r => r.ok ? r.json() : []).catch(() => []),
|
||||
fetch("/api/auth/passkey/list", { credentials: "include" }).then(r => r.ok ? r.json() : []).catch(() => []),
|
||||
]).then(([methodsData, passkeyData]) => {
|
||||
if (cancelled) return
|
||||
if (methodsData) setAuthMethods(methodsData)
|
||||
@@ -65,7 +65,7 @@ export function SettingsSecurityTab() {
|
||||
}
|
||||
|
||||
const refreshPasskeys = async () => {
|
||||
const res = await fetch("/api/auth/passkey/list-user-passkeys", { credentials: "include" })
|
||||
const res = await fetch("/api/auth/passkey/list", { credentials: "include" })
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
setPasskeys(Array.isArray(data) ? data : [])
|
||||
@@ -146,7 +146,7 @@ export function SettingsSecurityTab() {
|
||||
|
||||
setIsDeletingPasskey(id)
|
||||
try {
|
||||
const res = await fetch("/api/auth/passkey/delete-passkey", {
|
||||
const res = await fetch("/api/user/me/passkey/delete", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ id }),
|
||||
@@ -176,7 +176,7 @@ export function SettingsSecurityTab() {
|
||||
const handleRenamePasskey = async (id: string) => {
|
||||
setIsUpdatingPasskey(true)
|
||||
try {
|
||||
const res = await fetch("/api/auth/passkey/update-passkey", {
|
||||
const res = await fetch("/api/user/me/passkey/update", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ id, name: editingName }),
|
||||
@@ -347,7 +347,7 @@ export function SettingsSecurityTab() {
|
||||
<button
|
||||
onClick={() => handleRenamePasskey(pk.id)}
|
||||
disabled={isUpdatingPasskey}
|
||||
className="p-1 rounded hover:bg-green-500/10 text-green-400 transition-colors"
|
||||
className="p-1 rounded hover:bg-green-500/10 text-green-400 transition-colors cursor-pointer disabled:cursor-not-allowed"
|
||||
>
|
||||
{isUpdatingPasskey ? (
|
||||
<Loader2 className="h-3.5 w-3.5 animate-spin" />
|
||||
@@ -357,7 +357,7 @@ export function SettingsSecurityTab() {
|
||||
</button>
|
||||
<button
|
||||
onClick={cancelEditingPasskey}
|
||||
className="p-1 rounded hover:bg-red-500/10 text-red-400 transition-colors"
|
||||
className="p-1 rounded hover:bg-red-500/10 text-red-400 transition-colors cursor-pointer"
|
||||
>
|
||||
<X className="h-3.5 w-3.5" />
|
||||
</button>
|
||||
|
||||
@@ -77,7 +77,7 @@ export function BookmarkButton({ gameId, className = "" }: BookmarkButtonProps)
|
||||
whileTap={{ scale: 0.9 }}
|
||||
onClick={toggleSave}
|
||||
disabled={isToggling}
|
||||
className={`flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors ${
|
||||
className={`flex items-center gap-2 px-3 py-2 rounded-lg border transition-colors cursor-pointer ${
|
||||
isSaved
|
||||
? "bg-primary/10 border-primary/30 text-primary"
|
||||
: "bg-text/5 border-border text-text/50 hover:text-text hover:border-primary/30"
|
||||
|
||||
@@ -117,7 +117,7 @@ export function SavedGamesGrid() {
|
||||
<button
|
||||
onClick={() => removeGame(game.id, game.gameId)}
|
||||
disabled={removingId === game.id}
|
||||
className="absolute top-2 right-2 p-1.5 rounded-full bg-black/50 text-text/70 hover:text-red-400 hover:bg-black/70 transition-colors opacity-0 group-hover:opacity-100"
|
||||
className="absolute top-2 right-2 p-1.5 rounded-full bg-black/50 text-text/70 hover:text-red-400 hover:bg-black/70 transition-colors opacity-0 group-hover:opacity-100 cursor-pointer disabled:cursor-not-allowed"
|
||||
>
|
||||
{removingId === game.id ? (
|
||||
<Loader2 className="h-3 w-3 animate-spin" />
|
||||
|
||||
@@ -81,7 +81,7 @@ export function TiptapEditor({
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => editor.chain().focus().toggleBold().run()}
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors ${
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors cursor-pointer ${
|
||||
editor.isActive("bold") ? "bg-text/10 text-primary" : "text-text/50"
|
||||
}`}
|
||||
>
|
||||
@@ -90,7 +90,7 @@ export function TiptapEditor({
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => editor.chain().focus().toggleItalic().run()}
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors ${
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors cursor-pointer ${
|
||||
editor.isActive("italic") ? "bg-text/10 text-primary" : "text-text/50"
|
||||
}`}
|
||||
>
|
||||
@@ -100,7 +100,7 @@ export function TiptapEditor({
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => editor.chain().focus().toggleBulletList().run()}
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors ${
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors cursor-pointer ${
|
||||
editor.isActive("bulletList") ? "bg-text/10 text-primary" : "text-text/50"
|
||||
}`}
|
||||
>
|
||||
@@ -109,7 +109,7 @@ export function TiptapEditor({
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => editor.chain().focus().toggleOrderedList().run()}
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors ${
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors cursor-pointer ${
|
||||
editor.isActive("orderedList") ? "bg-text/10 text-primary" : "text-text/50"
|
||||
}`}
|
||||
>
|
||||
@@ -119,7 +119,7 @@ export function TiptapEditor({
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleLink}
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors ${
|
||||
className={`p-1.5 rounded hover:bg-text/10 transition-colors cursor-pointer ${
|
||||
editor.isActive("link") ? "bg-text/10 text-primary" : "text-text/50"
|
||||
}`}
|
||||
>
|
||||
|
||||
@@ -109,7 +109,7 @@ export function StepIndicator({
|
||||
type="button"
|
||||
onMouseEnter={() => setShowTooltip(currentStep)}
|
||||
onMouseLeave={() => setShowTooltip(null)}
|
||||
className="text-text/40 hover:text-text transition-colors"
|
||||
className="text-text/40 hover:text-text transition-colors cursor-pointer"
|
||||
>
|
||||
<Info className="h-4 w-4" />
|
||||
</button>
|
||||
@@ -137,7 +137,7 @@ export function StepIndicator({
|
||||
key={index}
|
||||
type="button"
|
||||
onClick={() => index <= currentStep && onStepClick?.(index)}
|
||||
className={`h-1.5 rounded-full transition-all ${
|
||||
className={`h-1.5 rounded-full transition-all cursor-pointer ${
|
||||
index === currentStep
|
||||
? "w-6 bg-primary"
|
||||
: index < currentStep
|
||||
|
||||
Reference in New Issue
Block a user