fixed at least as far as possible right now. does render stuff

This commit is contained in:
2025-07-02 17:22:37 +02:00
parent 2331a79884
commit 4bc9ab19d5
5 changed files with 65 additions and 36 deletions

View File

@@ -1,34 +1,31 @@
import './App.css'
import Navbar from "./components/Navbar.tsx";
import {BrowserRouter, Route, Routes} from "react-router-dom";
import './App.css';
import Navbar from './components/Navbar';
import { BrowserRouter, Routes, Route } from 'react-router-dom';
function Home() {
return null;
return <div className="p-4">Home Page</div>;
}
function Feed() {
return null;
return <div className="p-4">Feed Page</div>;
}
function Record() {
return null;
return <div className="p-4">Record Page</div>;
}
function Archive() {
return null;
return <div className="p-4">Archive Page</div>;
}
function Profile() {
return null;
return <div className="p-4">Profile Page</div>;
}
function App() {
export default function App() {
return (
<BrowserRouter>
<div>
<Navbar/>
</div>
<Navbar />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/feed" element={<Feed />} />
@@ -37,7 +34,5 @@ function App() {
<Route path="/profile" element={<Profile />} />
</Routes>
</BrowserRouter>
)
);
}
export default App

View File

@@ -1,14 +1,26 @@
import {NavLink} from 'react-router-dom'
import '../styles/navbar.css'
import { NavLink } from 'react-router-dom';
export default function Navbar() {
const linkClasses = ({ isActive }: { isActive: boolean }) =>
isActive ? 'text-blue-600 font-semibold' : 'text-gray-600';
return (
<nav className="navbar flex gap-4">
<NavLink to={"/"} className="navbar-left flex item-center gap-2">Home</NavLink>
<NavLink to={"/feed"} className="navbar-left">Feed</NavLink>
<NavLink to={"/record"} className="navbar-center">Record</NavLink>
<NavLink to={"/archive"} className="navbar-right">Find</NavLink>
<NavLink to={"/profile"} className="navbar-right">Profile</NavLink>
<nav className="flex justify-center gap-8 bg-gray-100 py-4">
<NavLink to="/" className={linkClasses}>
Home
</NavLink>
<NavLink to="/feed" className={linkClasses}>
Feed
</NavLink>
<NavLink to="/record" className={linkClasses}>
Record
</NavLink>
<NavLink to="/archive" className={linkClasses}>
Archive
</NavLink>
<NavLink to="/profile" className={linkClasses}>
Profile
</NavLink>
</nav>
)
}
);
}

View File

@@ -1,10 +1,12 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)
const container = document.getElementById('root');
if (!container) throw new Error('Root container missing in index.html');
createRoot(container).render(
<StrictMode>
<App />
</StrictMode>
);

View File

@@ -0,0 +1,19 @@
/* Example custom styles: */
nav {
display: flex;
justify-content: center;
gap: 2rem;
background-color: #f3f4f6;
padding: 1rem 0;
}
nav a {
color: #4b5563;
text-decoration: none;
font-weight: 500;
}
nav a.active {
color: #2563eb;
font-weight: 600;
}

View File

@@ -21,7 +21,8 @@
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
"noUncheckedSideEffectImports": true,
"allowSyntheticDefaultImports": true
},
"include": ["src"]
}