Skip to content

Commit 30bfcc2

Browse files
committed
minor fixes
1 parent fcc927a commit 30bfcc2

File tree

1 file changed

+3
-96
lines changed

1 file changed

+3
-96
lines changed

src/frontend/src/App.tsx

Lines changed: 3 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import { useState, useEffect } from 'react';
22
import { useMentraAuth } from '@mentra/react';
3-
import Home from './pages/Home';
43
import Template from './pages/Template';
54

6-
type Tab = 'home' | 'template';
7-
85
export default function App() {
96
const { userId, isLoading, error, isAuthenticated } = useMentraAuth();
10-
const [activeTab, setActiveTab] = useState<Tab>('home');
117
const [isDark, setIsDark] = useState(true);
12-
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
138

149
// Log authentication state to console
1510
useEffect(() => {
@@ -143,107 +138,19 @@ export default function App() {
143138
<span className="font-bold text-lg" style={{ color: isDark ? '#f1f5f9' : 'var(--accent-emerald)' }}>Mentra</span>
144139
</div>
145140

146-
{/* Center - Tab Navigation + User Info */}
147-
<div className="hidden sm:flex items-center gap-6">
148-
<button
149-
onClick={() => setActiveTab('home')}
150-
className={`px-2 py-1 text-sm font-medium transition-all border-b-2 ${
151-
activeTab === 'home'
152-
? 'text-[#00e2a2] border-[#00e2a2]'
153-
: 'text-emerald-400/40 hover:text-emerald-400/60 border-transparent'
154-
}`}
155-
>
156-
Home
157-
</button>
158-
<button
159-
onClick={() => setActiveTab('template')}
160-
className={`px-2 py-1 text-sm font-medium transition-all border-b-2 ${
161-
activeTab === 'template'
162-
? 'text-[#00e2a2] border-[#00e2a2]'
163-
: 'text-emerald-400/40 hover:text-emerald-400/60 border-transparent'
164-
}`}
165-
>
166-
Template
167-
</button>
168-
</div>
169-
170-
{/* User Info - Desktop */}
171-
<div className="hidden sm:flex items-center gap-2 px-3 py-1.5 bg-emerald-500/10 border border-emerald-500/20 rounded-lg">
141+
{/* User Info */}
142+
<div className="flex items-center gap-2 px-3 py-1.5 bg-emerald-500/10 border border-emerald-500/20 rounded-lg">
172143
<div className="w-2 h-2 bg-emerald-500 rounded-full animate-pulse"></div>
173144
<span className="text-xs text-emerald-400 font-mono">
174145
{userId?.substring(0, 8)}...
175146
</span>
176147
</div>
177-
178-
{/* Tab Navigation & User - Mobile */}
179-
<div className="flex sm:hidden items-center gap-3">
180-
{/* User Info - Mobile */}
181-
<div className="flex items-center gap-2 px-2 py-1 bg-emerald-500/10 border border-emerald-500/20 rounded-md">
182-
<div className="w-1.5 h-1.5 bg-emerald-500 rounded-full animate-pulse"></div>
183-
<span className="text-[10px] text-emerald-400 font-mono">
184-
{userId?.substring(0, 6)}
185-
</span>
186-
</div>
187-
188-
{/* Tab Dropdown */}
189-
<div className="relative">
190-
<button
191-
onClick={() => setIsDropdownOpen(!isDropdownOpen)}
192-
className={`flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${
193-
isDark
194-
? 'text-[#00e2a2] bg-slate-800/50'
195-
: 'text-emerald-700 bg-emerald-100/80'
196-
}`}
197-
>
198-
{activeTab === 'home' ? 'Home' : 'Template'}
199-
<svg
200-
className={`w-4 h-4 transition-transform ${isDropdownOpen ? 'rotate-180' : ''}`}
201-
fill="none"
202-
stroke="currentColor"
203-
viewBox="0 0 24 24"
204-
>
205-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M19 9l-7 7-7-7" />
206-
</svg>
207-
</button>
208-
209-
{isDropdownOpen && (
210-
<div className="absolute right-0 mt-2 w-32 border-[0.5px] border-[#00ff5e2d] bg-black rounded-md shadow-lg overflow-hidden z-50">
211-
<button
212-
onClick={() => {
213-
setActiveTab('home');
214-
setIsDropdownOpen(false);
215-
}}
216-
className={`w-full text-left px-4 py-2 text-sm transition-colors ${
217-
activeTab === 'home'
218-
? 'text-[#00e2a2] bg-slate-700'
219-
: 'text-slate-300 hover:bg-slate-700'
220-
}`}
221-
>
222-
Home
223-
</button>
224-
<button
225-
onClick={() => {
226-
setActiveTab('template');
227-
setIsDropdownOpen(false);
228-
}}
229-
className={`w-full text-left px-4 py-2 text-sm transition-colors ${
230-
activeTab === 'template'
231-
? 'text-[#00e2a2] bg-slate-700'
232-
: 'text-slate-300 hover:bg-slate-700'
233-
}`}
234-
>
235-
Template
236-
</button>
237-
</div>
238-
)}
239-
</div>
240-
</div>
241148
</div>
242149
</header>
243150

244151
{/* Content */}
245152
<main>
246-
{activeTab === 'home' ? <Home /> : <Template isDark={isDark} setIsDark={handleThemeChange} userId={userId || ''} />}
153+
<Template isDark={isDark} setIsDark={handleThemeChange} userId={userId || ''} />
247154
</main>
248155
</div>
249156
);

0 commit comments

Comments
 (0)