refactor: remove unused Browse component and clean up Navbar and LandingPage for improved readability

This commit is contained in:
Ben Allfree
2025-11-29 22:59:51 -08:00
parent e6eb9a977f
commit 1e503fd6c4
3 changed files with 13 additions and 132 deletions
-3
View File
@@ -9,7 +9,6 @@ import {
} from 'react-router-dom'
import { Toaster } from '@/components/ui/sonner'
import Navbar from './components/Navbar'
import Browse from './pages/Browse'
import BuildNew from './pages/BuildNew'
import BuildProgress from './pages/BuildProgress'
import Dashboard from './pages/Dashboard'
@@ -39,7 +38,6 @@ function App() {
<ConditionalNavbar />
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/browse" element={<Browse />} />
<Route path="/builds/new/:buildHash" element={<BuildNew />} />
<Route path="/builds/new" element={<BuildNew />} />
<Route path="/builds/:buildHash" element={<BuildProgress />} />
@@ -52,7 +50,6 @@ function App() {
<ConditionalNavbar />
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/browse" element={<Browse />} />
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/builds/new/:buildHash" element={<BuildNew />} />
<Route path="/builds/new" element={<BuildNew />} />
+13 -47
View File
@@ -1,57 +1,23 @@
import { useAuthActions } from '@convex-dev/auth/react'
import { Authenticated, Unauthenticated } from 'convex/react'
import { Link } from 'react-router-dom'
import { Button } from '@/components/ui/button'
export default function Navbar() {
const { signIn, signOut } = useAuthActions()
return (
<nav className="border-b border-slate-800 bg-slate-950">
<div className="max-w-7xl mx-auto px-8 py-4">
<div className="flex items-center justify-between">
<div className="flex items-center gap-8">
<Link
to="/"
className="flex items-center gap-3 hover:opacity-80 transition-opacity"
>
<img
src="/favicon-96x96.png"
alt="Mesh Forge logo"
className="h-10 w-10 rounded-lg"
/>
<span className="text-2xl font-bold bg-linear-to-r from-cyan-400 to-blue-600 bg-clip-text text-transparent">
Mesh Forge
</span>
</Link>
<div className="flex items-center gap-4">
<Authenticated>
<Link
to="/dashboard"
className="text-slate-300 hover:text-white transition-colors"
>
Dashboard
</Link>
</Authenticated>
</div>
</div>
<div className="flex items-center gap-4">
<Unauthenticated>
<Button
onClick={() =>
signIn('google', { redirectTo: window.location.href })
}
className="bg-white text-slate-900 hover:bg-slate-200"
>
Sign in
</Button>
</Unauthenticated>
<Authenticated>
<Button variant="outline" onClick={() => signOut()}>
Sign Out
</Button>
</Authenticated>
</div>
<Link
to="/"
className="flex items-center gap-3 hover:opacity-80 transition-opacity"
>
<img
src="/favicon-96x96.png"
alt="Mesh Forge logo"
className="h-10 w-10 rounded-lg"
/>
<span className="text-2xl font-bold bg-gradient-to-r from-cyan-400 to-blue-600 bg-clip-text text-transparent">
Mesh Forge
</span>
</Link>
</div>
</div>
</nav>
-82
View File
@@ -1,5 +1,3 @@
import { useAuthActions } from '@convex-dev/auth/react'
import { Authenticated, Unauthenticated } from 'convex/react'
import { useNavigate } from 'react-router-dom'
import { Button } from '@/components/ui/button'
@@ -20,45 +18,8 @@ function QuickBuildIcon(props: React.SVGProps<SVGSVGElement>) {
)
}
function BrowseIcon(props: React.SVGProps<SVGSVGElement>) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
viewBox="0 0 24 24"
role="img"
aria-label="Browse"
{...props}
>
<title>Browse</title>
<path
fill="currentColor"
fillRule="evenodd"
d="M16.33 3.75H6.67c-.535 0-.98 0-1.345.03c-1.411.115-2.432 1.164-2.545 2.545c-.03.365-.03.812-.03 1.345v8.66c0 .535 0 .98.03 1.345c.03.38.098.736.27 1.073a2.75 2.75 0 0 0 1.202 1.202c.337.172.693.24 1.073.27c.365.03.81.03 1.344.03h9.662c.534 0 .98 0 1.344-.03c.38-.03.736-.098 1.073-.27a.75.75 0 0 0-.68-1.336c-.091.046-.228.088-.516.111c-.295.024-.68.025-1.252.025H6.7c-.572 0-.957 0-1.253-.025c-.287-.023-.424-.065-.514-.111a1.25 1.25 0 0 1-.547-.547c-.046-.09-.088-.227-.111-.515c-.024-.295-.025-.68-.025-1.252V8.25h14.486q.012.625.014 1.25a.75.75 0 1 0 1.5 0q0-.28-.003-.558c-.007-.67-.027-1.807-.091-2.618c-.113-1.424-1.072-2.43-2.481-2.544c-.365-.03-.81-.03-1.345-.03m2.352 3c-.048-.797-.278-1.406-1.13-1.475c-.295-.024-.68-.025-1.252-.025H6.7c-.572 0-.957 0-1.253.025c-.818.067-1.163.68-1.189 1.475z"
clipRule="evenodd"
/>
<path
fill="currentColor"
d="M6.5 9.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5z"
/>
<path
fill="currentColor"
fillRule="evenodd"
d="M17 10.25a3.25 3.25 0 1 0 1.706 6.017l1.264 1.263a.75.75 0 1 0 1.06-1.06l-1.263-1.264A3.25 3.25 0 0 0 17 10.25m-1.75 3.25a1.75 1.75 0 1 1 3.5 0a1.75 1.75 0 0 1-3.5 0"
clipRule="evenodd"
/>
<path
fill="currentColor"
d="M6.5 11.25a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5zm0 3a.75.75 0 0 0 0 1.5h5a.75.75 0 0 0 0-1.5zm0 2a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5z"
/>
</svg>
)
}
export default function LandingPage() {
const navigate = useNavigate()
const { signIn } = useAuthActions()
return (
<div className="min-h-screen bg-slate-950 text-white">
@@ -84,49 +45,6 @@ export default function LandingPage() {
<QuickBuildIcon className="mr-2 h-5 w-5" />
Quick Build
</Button>
<Button
onClick={() => navigate('/browse')}
size="lg"
variant="outline"
className="border-cyan-500/50 text-white hover:bg-slate-900/60"
>
<BrowseIcon className="mr-2 h-5 w-5" />
Browse Builds
</Button>
<Authenticated>
<Button
onClick={() => navigate('/dashboard')}
size="lg"
className="bg-white text-slate-900 hover:bg-slate-200"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
className="w-8 h-8"
aria-label="Dashboard icon"
>
<title>Dashboard icon</title>
<path
fill="currentColor"
fillRule="evenodd"
d="M14.748 0a1.75 1.75 0 0 0-1.75 1.75v4.5c0 .966.784 1.75 1.75 1.75h7.5a1.75 1.75 0 0 0 1.75-1.75v-4.5A1.75 1.75 0 0 0 22.248 0zm0 10a1.75 1.75 0 0 0-1.75 1.75v10.5c0 .967.784 1.75 1.75 1.75h7.5a1.75 1.75 0 0 0 1.75-1.75v-10.5a1.75 1.75 0 0 0-1.75-1.75zM.002 1.75C.002.784.785 0 1.752 0h7.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 9.252 14h-7.5a1.75 1.75 0 0 1-1.75-1.75zM1.752 16a1.75 1.75 0 0 0-1.75 1.75v4.5c0 .966.783 1.75 1.75 1.75h7.5a1.75 1.75 0 0 0 1.75-1.75v-4.5A1.75 1.75 0 0 0 9.252 16z"
clipRule="evenodd"
/>
</svg>
Go to Dashboard
</Button>
</Authenticated>
<Unauthenticated>
<Button
onClick={() =>
signIn('google', { redirectTo: window.location.href })
}
size="lg"
className="bg-white text-slate-900 hover:bg-slate-200"
>
Sign in
</Button>
</Unauthenticated>
</div>
{/* Benefits Grid */}