forked from Tadrisino/MathApp_frontend
Lessons tab replaces the map tab: chapter > island > lesson list with the island quiz beside it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,7 +53,7 @@ export function NavigatorProvider({ initial, children }: { initial: Route; child
|
||||
const root = stack[0].name;
|
||||
return {
|
||||
route: stack[stack.length - 1],
|
||||
tab: ['home', 'map', 'ask', 'subscription', 'profile'].includes(root) ? (root as TabName) : null,
|
||||
tab: ['home', 'lessons', 'ask', 'subscription', 'profile'].includes(root) ? (root as TabName) : null,
|
||||
canGoBack: stack.length > 1,
|
||||
push,
|
||||
replace,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/** همهی صفحههای اپ و پارامترهایشان. */
|
||||
export type Route =
|
||||
| { name: 'home' }
|
||||
| { name: 'map' }
|
||||
| { name: 'lessons' }
|
||||
| { name: 'ask'; lessonId?: number; questionId?: string; prompt?: string }
|
||||
| { name: 'subscription' }
|
||||
| { name: 'profile' }
|
||||
@@ -20,9 +20,9 @@ export type Route =
|
||||
| { name: 'invoices' }
|
||||
| { name: 'invite' };
|
||||
|
||||
export type TabName = 'home' | 'map' | 'ask' | 'subscription' | 'profile';
|
||||
export type TabName = 'home' | 'lessons' | 'ask' | 'subscription' | 'profile';
|
||||
|
||||
export const TABS: TabName[] = ['home', 'map', 'ask', 'subscription', 'profile'];
|
||||
export const TABS: TabName[] = ['home', 'lessons', 'ask', 'subscription', 'profile'];
|
||||
|
||||
export function isTab(name: Route['name']): name is TabName {
|
||||
return (TABS as string[]).includes(name);
|
||||
|
||||
Reference in New Issue
Block a user