Added settings page

This commit is contained in:
Plexi09 2026-02-23 13:04:28 +01:00
parent 0ef35eb1d5
commit 19a52e28cd
Signed by: Plexi09
GPG key ID: 20D439A69163544A
6 changed files with 488 additions and 7 deletions

View file

@ -1,23 +1,38 @@
import React from 'react';
import { Link, useLocation } from 'react-router-dom';
import { Film, Heart, Users } from 'lucide-react';
import { Film, Heart, Users, Settings } from 'lucide-react';
import { useAppContext } from '../store/AppContext';
export const Navbar: React.FC = () => {
const location = useLocation();
const { matches } = useAppContext();
const { user, matches } = useAppContext();
const navItems = [
{ path: '/', icon: Users, label: 'Partner' },
{ path: '/swipe', icon: Film, label: 'Discover' },
{ path: '/matches', icon: Heart, label: 'Matches', badge: matches.length },
{ path: '/settings', icon: Settings, label: 'Settings', requiresAuth: true },
];
return (
<nav className="fixed bottom-0 w-full bg-surface border-t border-slate-700 pb-safe">
<nav className="fixed bottom-0 w-full bg-surface border-t border-border pb-safe">
<div className="flex justify-around items-center h-16 max-w-md mx-auto">
{navItems.map(({ path, icon: Icon, label, badge }) => {
{navItems.map(({ path, icon: Icon, label, badge, requiresAuth }) => {
const isActive = location.pathname === path;
const isDisabled = requiresAuth && !user;
if (isDisabled) {
return (
<div
key={path}
className="flex flex-col items-center justify-center w-full h-full space-y-1 text-slate-600 cursor-not-allowed"
>
<Icon size={24} />
<span className="text-xs font-medium">{label}</span>
</div>
);
}
return (
<Link
key={path}