mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
feat(vacay,journey): apply the same unified toolbar header
Wraps the Vacay and Journey desktop headers in the shared rounded bg-tertiary bar (title + divider + subtitle, actions grouped on the right, border and light shadow for contrast). Vacay keeps its filters sidebar-toggle inside the bar on tablet widths; Journey keeps the search-toggle and the primary "Create journey" action. Mobile headers are unchanged.
This commit is contained in:
@@ -150,39 +150,72 @@ export default function JourneyPage() {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Header — desktop */}
|
{/* Header — desktop (unified toolbar) */}
|
||||||
<div className="hidden md:flex items-start justify-between px-8 pt-10 pb-7">
|
<div className="hidden md:block px-8 pt-10 pb-7">
|
||||||
<div>
|
<div style={{
|
||||||
<h1 className="text-[32px] font-extrabold tracking-[-0.025em] text-zinc-900 dark:text-white leading-none">{t('journey.title')}</h1>
|
background: 'var(--bg-tertiary)', borderRadius: 18,
|
||||||
<p className="text-[13px] text-zinc-500 mt-1.5">{t("journey.frontpage.subtitle")}</p>
|
border: '1px solid var(--border-primary)',
|
||||||
</div>
|
boxShadow: '0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)',
|
||||||
<div className="flex items-center gap-2">
|
padding: '14px 16px 14px 22px',
|
||||||
{searchOpen && (
|
display: 'flex', alignItems: 'center', gap: 16, flexWrap: 'wrap',
|
||||||
<input
|
}}>
|
||||||
value={searchQuery}
|
<h2 style={{ margin: 0, fontSize: 18, fontWeight: 600, color: 'var(--text-primary)', letterSpacing: '-0.01em', flexShrink: 0 }}>
|
||||||
onChange={e => setSearchQuery(e.target.value)}
|
{t('journey.title')}
|
||||||
onKeyDown={e => { if (e.key === 'Escape') { setSearchQuery(''); setSearchOpen(false) } }}
|
</h2>
|
||||||
placeholder={t('journey.search.placeholder')}
|
<div style={{ width: 1, height: 22, background: 'var(--border-faint)', flexShrink: 0 }} />
|
||||||
autoFocus
|
<span style={{ fontSize: 13, color: 'var(--text-muted)' }}>
|
||||||
className="w-52 px-3 py-2 border border-zinc-200 dark:border-zinc-700 rounded-[10px] text-[13px] bg-white dark:bg-zinc-800 text-zinc-900 dark:text-white focus:border-zinc-400 focus:outline-none"
|
{t('journey.frontpage.subtitle')}
|
||||||
/>
|
</span>
|
||||||
)}
|
|
||||||
<button
|
<div style={{ display: 'inline-flex', gap: 6, alignItems: 'center', marginLeft: 'auto', flexShrink: 0 }}>
|
||||||
onClick={() => {
|
{searchOpen && (
|
||||||
setSearchOpen(s => !s)
|
<input
|
||||||
if (searchOpen) setSearchQuery('')
|
value={searchQuery}
|
||||||
}}
|
onChange={e => setSearchQuery(e.target.value)}
|
||||||
className={`w-9 h-9 rounded-[10px] border border-zinc-200 dark:border-zinc-700 flex items-center justify-center text-zinc-500 transition-colors ${searchOpen ? 'bg-zinc-100 dark:bg-zinc-700' : 'bg-white dark:bg-zinc-800 hover:bg-zinc-50 dark:hover:bg-zinc-700'}`}
|
onKeyDown={e => { if (e.key === 'Escape') { setSearchQuery(''); setSearchOpen(false) } }}
|
||||||
>
|
placeholder={t('journey.search.placeholder')}
|
||||||
{searchOpen ? <X size={15} /> : <Search size={15} />}
|
autoFocus
|
||||||
</button>
|
className="w-52 px-3 py-2 rounded-[10px] text-[13px] bg-white dark:bg-zinc-800 text-zinc-900 dark:text-white focus:outline-none"
|
||||||
<button
|
style={{ border: '1px solid var(--border-primary)' }}
|
||||||
onClick={() => openCreateModal()}
|
/>
|
||||||
className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-[10px] bg-zinc-900 dark:bg-white text-white dark:text-zinc-900 text-[13px] font-medium hover:bg-zinc-800 dark:hover:bg-zinc-100 transition-all hover:-translate-y-px"
|
)}
|
||||||
>
|
<button
|
||||||
<Plus size={14} />
|
onClick={() => {
|
||||||
{t('journey.frontpage.createJourney')}
|
setSearchOpen(s => !s)
|
||||||
</button>
|
if (searchOpen) setSearchQuery('')
|
||||||
|
}}
|
||||||
|
title={t('journey.search.placeholder')}
|
||||||
|
style={{
|
||||||
|
appearance: 'none', border: 'none', cursor: 'pointer', fontFamily: 'inherit',
|
||||||
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
|
padding: '7px 11px', borderRadius: 99,
|
||||||
|
background: searchOpen ? 'var(--bg-card)' : 'transparent',
|
||||||
|
color: searchOpen ? 'var(--text-primary)' : 'var(--text-muted)',
|
||||||
|
boxShadow: searchOpen ? '0 1px 2px rgba(0,0,0,0.06)' : 'none',
|
||||||
|
transition: 'all 0.15s ease',
|
||||||
|
}}
|
||||||
|
onMouseEnter={e => { if (!searchOpen) { e.currentTarget.style.background = 'var(--bg-card)'; e.currentTarget.style.color = 'var(--text-primary)' } }}
|
||||||
|
onMouseLeave={e => { if (!searchOpen) { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--text-muted)' } }}
|
||||||
|
>
|
||||||
|
{searchOpen ? <X size={15} /> : <Search size={15} />}
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => openCreateModal()}
|
||||||
|
style={{
|
||||||
|
appearance: 'none', border: 'none', cursor: 'pointer', fontFamily: 'inherit',
|
||||||
|
display: 'inline-flex', alignItems: 'center', gap: 6,
|
||||||
|
padding: '9px 14px', borderRadius: 10, fontSize: 13, fontWeight: 500,
|
||||||
|
background: 'var(--accent)', color: 'var(--accent-text)', flexShrink: 0,
|
||||||
|
marginLeft: 2,
|
||||||
|
transition: 'opacity 0.15s ease',
|
||||||
|
}}
|
||||||
|
onMouseEnter={e => e.currentTarget.style.opacity = '0.88'}
|
||||||
|
onMouseLeave={e => e.currentTarget.style.opacity = '1'}
|
||||||
|
>
|
||||||
|
<Plus size={14} strokeWidth={2.5} />
|
||||||
|
{t('journey.frontpage.createJourney')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -138,19 +138,15 @@ export default function VacayPage(): React.ReactElement {
|
|||||||
|
|
||||||
<div style={{ paddingTop: 'var(--nav-h)' }}>
|
<div style={{ paddingTop: 'var(--nav-h)' }}>
|
||||||
<div className="max-w-[1800px] mx-auto px-3 sm:px-4 py-4 sm:py-6">
|
<div className="max-w-[1800px] mx-auto px-3 sm:px-4 py-4 sm:py-6">
|
||||||
{/* Header */}
|
{/* Mobile header */}
|
||||||
<div className="flex items-center justify-between mb-4 sm:mb-5">
|
<div className="md:hidden flex items-center justify-between mb-4">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="w-9 h-9 rounded-xl flex items-center justify-center" style={{ background: 'var(--bg-secondary)' }}>
|
<div className="w-9 h-9 rounded-xl flex items-center justify-center" style={{ background: 'var(--bg-secondary)' }}>
|
||||||
<CalendarDays size={18} style={{ color: 'var(--text-primary)' }} />
|
<CalendarDays size={18} style={{ color: 'var(--text-primary)' }} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<h1 className="text-lg font-bold" style={{ color: 'var(--text-primary)' }}>{t('admin.addons.catalog.vacay.name')}</h1>
|
||||||
<h1 className="text-lg sm:text-xl font-bold" style={{ color: 'var(--text-primary)' }}>{t('admin.addons.catalog.vacay.name')}</h1>
|
|
||||||
<p className="text-xs hidden sm:block" style={{ color: 'var(--text-muted)' }}>{t('vacay.subtitle')}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
{/* Mobile sidebar toggle */}
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowMobileSidebar(true)}
|
onClick={() => setShowMobileSidebar(true)}
|
||||||
className="lg:hidden flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors"
|
className="lg:hidden flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors"
|
||||||
@@ -164,11 +160,62 @@ export default function VacayPage(): React.ReactElement {
|
|||||||
style={{ background: 'var(--bg-secondary)', color: 'var(--text-muted)' }}
|
style={{ background: 'var(--bg-secondary)', color: 'var(--text-muted)' }}
|
||||||
>
|
>
|
||||||
<Settings size={14} />
|
<Settings size={14} />
|
||||||
<span className="hidden sm:inline">{t('vacay.settings')}</span>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Desktop header — unified toolbar */}
|
||||||
|
<div className="hidden md:block" style={{ marginBottom: 20 }}>
|
||||||
|
<div style={{
|
||||||
|
background: 'var(--bg-tertiary)', borderRadius: 18,
|
||||||
|
border: '1px solid var(--border-primary)',
|
||||||
|
boxShadow: '0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04)',
|
||||||
|
padding: '14px 16px 14px 22px',
|
||||||
|
display: 'flex', alignItems: 'center', gap: 16, flexWrap: 'wrap',
|
||||||
|
}}>
|
||||||
|
<h2 style={{ margin: 0, fontSize: 18, fontWeight: 600, color: 'var(--text-primary)', letterSpacing: '-0.01em', flexShrink: 0 }}>
|
||||||
|
{t('admin.addons.catalog.vacay.name')}
|
||||||
|
</h2>
|
||||||
|
<div style={{ width: 1, height: 22, background: 'var(--border-faint)', flexShrink: 0 }} />
|
||||||
|
<span style={{ fontSize: 13, color: 'var(--text-muted)' }}>
|
||||||
|
{t('vacay.subtitle')}
|
||||||
|
</span>
|
||||||
|
<div style={{ display: 'inline-flex', gap: 6, alignItems: 'center', marginLeft: 'auto', flexShrink: 0 }}>
|
||||||
|
<button
|
||||||
|
onClick={() => setShowMobileSidebar(true)}
|
||||||
|
className="lg:hidden"
|
||||||
|
title={t('vacay.filters') || 'Filters'}
|
||||||
|
style={{
|
||||||
|
appearance: 'none', border: 'none', cursor: 'pointer', fontFamily: 'inherit',
|
||||||
|
display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
|
||||||
|
padding: '7px 11px', borderRadius: 99,
|
||||||
|
background: 'transparent', color: 'var(--text-muted)',
|
||||||
|
transition: 'all 0.15s ease',
|
||||||
|
}}
|
||||||
|
onMouseEnter={e => { e.currentTarget.style.background = 'var(--bg-card)'; e.currentTarget.style.color = 'var(--text-primary)' }}
|
||||||
|
onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--text-muted)' }}
|
||||||
|
>
|
||||||
|
<SlidersHorizontal size={15} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
onClick={() => setShowSettings(true)}
|
||||||
|
style={{
|
||||||
|
appearance: 'none', border: 'none', cursor: 'pointer', fontFamily: 'inherit',
|
||||||
|
display: 'inline-flex', alignItems: 'center', gap: 6,
|
||||||
|
padding: '9px 14px', borderRadius: 10, fontSize: 13, fontWeight: 500,
|
||||||
|
background: 'var(--accent)', color: 'var(--accent-text)', flexShrink: 0,
|
||||||
|
marginLeft: 2,
|
||||||
|
transition: 'opacity 0.15s ease',
|
||||||
|
}}
|
||||||
|
onMouseEnter={e => e.currentTarget.style.opacity = '0.88'}
|
||||||
|
onMouseLeave={e => e.currentTarget.style.opacity = '1'}
|
||||||
|
>
|
||||||
|
<Settings size={14} strokeWidth={2.5} /> {t('vacay.settings')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Main layout */}
|
{/* Main layout */}
|
||||||
<div className="flex gap-4 items-start">
|
<div className="flex gap-4 items-start">
|
||||||
{/* Desktop Sidebar */}
|
{/* Desktop Sidebar */}
|
||||||
|
|||||||
Reference in New Issue
Block a user