ui improvs

This commit is contained in:
2026-03-31 11:40:41 +05:30
parent 238ce8b69f
commit 2b9c5d0248
2 changed files with 45 additions and 7 deletions

View File

@@ -853,12 +853,35 @@
} }
.bottom-nav-btn svg { .bottom-nav-btn svg {
width: 18px; width: 22px;
height: 18px; height: 22px;
flex-shrink: 0; flex-shrink: 0;
stroke-width: 2; stroke-width: 2;
} }
.bottom-nav-avatar {
width: 26px;
height: 26px;
border-radius: 50%;
object-fit: cover;
flex-shrink: 0;
border: 2px solid transparent;
}
.bottom-nav-avatar-placeholder {
background: var(--color-primary, #22c55e);
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.6rem;
font-weight: 700;
}
.bottom-nav-btn-active .bottom-nav-avatar {
border-color: currentColor;
}
.bottom-nav-btn span { .bottom-nav-btn span {
font-size: 0.8125rem; font-size: 0.8125rem;
font-weight: 600; font-weight: 600;
@@ -2143,6 +2166,11 @@
display: inline; display: inline;
} }
.bottom-nav-avatar {
width: 31px;
height: 31px;
}
/* Active pill keeps green but full-width */ /* Active pill keeps green but full-width */
.bottom-nav-btn-active { .bottom-nav-btn-active {
padding: 10px 14px; padding: 10px 14px;
@@ -2403,6 +2431,10 @@
color: #fff; color: #fff;
} }
[data-theme="dark"] .bottom-nav-avatar-placeholder {
background: #16a34a;
}
/* -- Write button -- */ /* -- Write button -- */
[data-theme="dark"] .journal-write-btn { [data-theme="dark"] .journal-write-btn {
background: #22c55e; background: #22c55e;

View File

@@ -1,8 +1,12 @@
import { useNavigate, useLocation } from 'react-router-dom' import { useNavigate, useLocation } from 'react-router-dom'
import { useAuth } from '../contexts/AuthContext'
export default function BottomNav() { export default function BottomNav() {
const navigate = useNavigate() const navigate = useNavigate()
const location = useLocation() const location = useLocation()
const { user, mongoUser } = useAuth()
const displayName = mongoUser?.displayName || user?.displayName || 'U'
const photoURL = (mongoUser && 'photoURL' in mongoUser) ? (mongoUser.photoURL || null) : (user?.photoURL || null)
const isActive = (path: string) => location.pathname === path const isActive = (path: string) => location.pathname === path
@@ -50,11 +54,13 @@ export default function BottomNav() {
onClick={() => navigate('/settings')} onClick={() => navigate('/settings')}
aria-label="Settings" aria-label="Settings"
> >
{/* Gear icon */} {photoURL ? (
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round"> <img src={photoURL} alt={displayName} className="bottom-nav-avatar" />
<circle cx="12" cy="12" r="3" /> ) : (
<path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" /> <div className="bottom-nav-avatar bottom-nav-avatar-placeholder">
</svg> {displayName.charAt(0).toUpperCase()}
</div>
)}
<span>Settings</span> <span>Settings</span>
</button> </button>
</nav> </nav>