trying stuff
This commit is contained in:
20
src/App.tsx
20
src/App.tsx
@@ -1,6 +1,6 @@
|
|||||||
import './App.css';
|
import './App.css';
|
||||||
import Navbar from './components/Navbar';
|
import Navbar from './components/Navbar';
|
||||||
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
import {BrowserRouter, Routes, Route} from 'react-router-dom';
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
return <div className="p-4">Home Page</div>;
|
return <div className="p-4">Home Page</div>;
|
||||||
@@ -25,14 +25,16 @@ function Profile() {
|
|||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<Navbar />
|
<div className="pb-16">
|
||||||
<Routes>
|
<Navbar/>
|
||||||
<Route path="/" element={<Home />} />
|
<Routes>
|
||||||
<Route path="/feed" element={<Feed />} />
|
<Route path="/" element={<Home/>}/>
|
||||||
<Route path="/record" element={<Record />} />
|
<Route path="/feed" element={<Feed/>}/>
|
||||||
<Route path="/archive" element={<Archive />} />
|
<Route path="/record" element={<Record/>}/>
|
||||||
<Route path="/profile" element={<Profile />} />
|
<Route path="/archive" element={<Archive/>}/>
|
||||||
</Routes>
|
<Route path="/profile" element={<Profile/>}/>
|
||||||
|
</Routes>
|
||||||
|
</div>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -2,10 +2,19 @@ import { NavLink } from 'react-router-dom';
|
|||||||
|
|
||||||
export default function Navbar() {
|
export default function Navbar() {
|
||||||
const linkClasses = ({ isActive }: { isActive: boolean }) =>
|
const linkClasses = ({ isActive }: { isActive: boolean }) =>
|
||||||
isActive ? 'text-blue-600 font-semibold' : 'text-gray-600';
|
isActive
|
||||||
|
? 'text-blue-600 font-semibold'
|
||||||
|
: 'text-gray-600';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className="flex justify-center gap-8 bg-gray-100 py-4">
|
<nav className="
|
||||||
|
fixed bottom-0 left-0 right-0 /* pin to bottom */
|
||||||
|
flex justify-around /* evenly spaced links */
|
||||||
|
bg-white border-t border-gray-200 /* top border for separation */
|
||||||
|
py-2 /* vertical padding */
|
||||||
|
shadow-lg /* subtle drop shadow */
|
||||||
|
sm:hidden /* hide on small screens? remove if not needed */
|
||||||
|
">
|
||||||
<NavLink to="/" className={linkClasses}>
|
<NavLink to="/" className={linkClasses}>
|
||||||
Home
|
Home
|
||||||
</NavLink>
|
</NavLink>
|
||||||
|
Reference in New Issue
Block a user