``update Refactor navigation URLs by replacing hardcoded LESSON_LINK with Paths.LESSON_LINK across App, RouteConfig, and multiple components; remove redundant LESSON_LINK from constants``

This commit is contained in:
2025-05-16 22:00:04 +08:00
parent 69b2ef59e5
commit 8d746f3aa9
10 changed files with 43 additions and 52 deletions

View File

@@ -1,4 +1,4 @@
import { DEBUG, DEBUG_LINK, LESSON_LINK, QUIZ_MAIN_MENU_LINK, RECORD_LINK, SETTING_LINK } from './constants';
import { DEBUG, DEBUG_LINK, QUIZ_MAIN_MENU_LINK, RECORD_LINK, SETTING_LINK } from './constants';
/* Core CSS required for Ionic components to work properly */
import '@ionic/react/css/core.css';
@@ -48,6 +48,7 @@ import ContextMeta from './contexts';
import { useAppStateContext } from './contexts/AppState';
import { useMyIonQuizContext } from './contexts/MyIonQuiz';
import { RouteConfig } from './RouteConfig';
import { Paths } from './Paths';
let active_color = 'tomato';
let inactive_color = 'gray';
@@ -99,8 +100,8 @@ const TabButtons: React.FC = () => {
<IonTabBar slot="bottom">
<IonTabButton
tab="lesson"
onClick={() => goSwitchPage(LESSON_LINK)}
style={{ color: tab_active == LESSON_LINK ? active_color : inactive_color }}
onClick={() => goSwitchPage(Paths.LESSON_LINK)}
style={{ color: tab_active == Paths.LESSON_LINK ? active_color : inactive_color }}
>
<IonIcon aria-hidden="true" icon={bookOutline} size="large" />
</IonTabButton>