|
1 | 1 | import { useState, useEffect } from 'react'; |
2 | 2 | import { useMentraAuth } from '@mentra/react'; |
3 | | -import Home from './pages/Home'; |
4 | 3 | import Template from './pages/Template'; |
5 | 4 |
|
6 | | -type Tab = 'home' | 'template'; |
7 | | - |
8 | 5 | export default function App() { |
9 | 6 | const { userId, isLoading, error, isAuthenticated } = useMentraAuth(); |
10 | | - const [activeTab, setActiveTab] = useState<Tab>('home'); |
11 | 7 | const [isDark, setIsDark] = useState(true); |
12 | | - const [isDropdownOpen, setIsDropdownOpen] = useState(false); |
13 | 8 |
|
14 | 9 | // Log authentication state to console |
15 | 10 | useEffect(() => { |
@@ -143,107 +138,19 @@ export default function App() { |
143 | 138 | <span className="font-bold text-lg" style={{ color: isDark ? '#f1f5f9' : 'var(--accent-emerald)' }}>Mentra</span> |
144 | 139 | </div> |
145 | 140 |
|
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"> |
172 | 143 | <div className="w-2 h-2 bg-emerald-500 rounded-full animate-pulse"></div> |
173 | 144 | <span className="text-xs text-emerald-400 font-mono"> |
174 | 145 | {userId?.substring(0, 8)}... |
175 | 146 | </span> |
176 | 147 | </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> |
241 | 148 | </div> |
242 | 149 | </header> |
243 | 150 |
|
244 | 151 | {/* Content */} |
245 | 152 | <main> |
246 | | - {activeTab === 'home' ? <Home /> : <Template isDark={isDark} setIsDark={handleThemeChange} userId={userId || ''} />} |
| 153 | + <Template isDark={isDark} setIsDark={handleThemeChange} userId={userId || ''} /> |
247 | 154 | </main> |
248 | 155 | </div> |
249 | 156 | ); |
|
0 commit comments