From bac096e049be9eb4263bc010edc02e4fa7a665f7 Mon Sep 17 00:00:00 2001 From: Farabi Date: Thu, 3 Oct 2024 16:06:07 +0800 Subject: [PATCH] fix: tutorial tab translations --- .../no-search-result.tsx | 3 +- .../quick-strategy-guides.tsx | 4 +-- src/pages/tutorials/tutorials.tsx | 30 +++++++++---------- src/stores/dashboard-store.ts | 24 +++++++-------- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/pages/tutorials/common/no-search-result-found/no-search-result.tsx b/src/pages/tutorials/common/no-search-result-found/no-search-result.tsx index c6b54fcb..d3c23c01 100644 --- a/src/pages/tutorials/common/no-search-result-found/no-search-result.tsx +++ b/src/pages/tutorials/common/no-search-result-found/no-search-result.tsx @@ -14,7 +14,8 @@ const NoSearchResult = observer(() => { - + + diff --git a/src/pages/tutorials/quick-strategy-content/quick-strategy-guides.tsx b/src/pages/tutorials/quick-strategy-content/quick-strategy-guides.tsx index f90970f8..0f760b4f 100644 --- a/src/pages/tutorials/quick-strategy-content/quick-strategy-guides.tsx +++ b/src/pages/tutorials/quick-strategy-content/quick-strategy-guides.tsx @@ -14,7 +14,7 @@ const QuickStrategyGuides = () => { return (
- {tutorial_selected_strategy === '' && quick_strategy_tab_content.length > 0 && ( + {tutorial_selected_strategy === '' && quick_strategy_tab_content().length > 0 && ( {
); diff --git a/src/pages/tutorials/tutorials.tsx b/src/pages/tutorials/tutorials.tsx index 70844e63..b4558252 100644 --- a/src/pages/tutorials/tutorials.tsx +++ b/src/pages/tutorials/tutorials.tsx @@ -40,29 +40,29 @@ const TutorialsTab = observer(({ handleTabChange }: TTutorialsTab) => { }, [active_tab_tutorials]); const has_content_guide_tab = - guide_tab_content.length > 0 || - video_tab_content.length > 0 || - faq_tab_content.length > 0 || - quick_strategy_tab_content.length > 0; + guide_tab_content().length > 0 || + video_tab_content().length > 0 || + faq_tab_content().length > 0 || + quick_strategy_tab_content().length > 0; - const tutorial_tabs = (): TTutorialsTabItem[] => [ + const tutorial_tabs: TTutorialsTabItem[] = [ { label: localize('Guide'), content: ( ), }, { label: localize('FAQ'), - content: , + content: , }, { label: localize('Quick strategy guides'), - content: , + content: , }, { label: localize('Search'), @@ -70,11 +70,11 @@ const TutorialsTab = observer(({ handleTabChange }: TTutorialsTab) => { <> - - + + ) : ( @@ -83,9 +83,9 @@ const TutorialsTab = observer(({ handleTabChange }: TTutorialsTab) => { ]; return isDesktop ? ( - + ) : ( - + ); }); diff --git a/src/stores/dashboard-store.ts b/src/stores/dashboard-store.ts index 3e60fbf0..2c48eb4f 100644 --- a/src/stores/dashboard-store.ts +++ b/src/stores/dashboard-store.ts @@ -230,10 +230,10 @@ export default class DashboardStore implements IDashboardStore { toast_message = ''; is_web_socket_intialised = true; search_param = ''; - guide_tab_content = user_guide_content(); - video_tab_content = guide_content(); - faq_tab_content = faq_content(); - quick_strategy_tab_content = quick_strategy_content(); + guide_tab_content = user_guide_content; + video_tab_content = guide_content; + faq_tab_content = faq_content; + quick_strategy_tab_content = quick_strategy_content; filtered_tab_list = []; is_chart_modal_visible = false; is_trading_view_modal_visible = false; @@ -244,10 +244,10 @@ export default class DashboardStore implements IDashboardStore { }; resetTutorialTabContent = () => { - this.guide_tab_content = user_guide_content(); - this.video_tab_content = guide_content(); - this.faq_tab_content = faq_content(); - this.quick_strategy_tab_content = quick_strategy_content(); + this.guide_tab_content = user_guide_content; + this.video_tab_content = guide_content; + this.faq_tab_content = faq_content; + this.quick_strategy_tab_content = quick_strategy_content; }; filterTuotrialTab = (search_param: string) => { @@ -278,10 +278,10 @@ export default class DashboardStore implements IDashboardStore { return quick_strategy_content()[Number(index)]; }); - this.guide_tab_content = filtered_user_guide; - this.video_tab_content = filter_video_guide; - this.faq_tab_content = filtered_faq_content; - this.quick_strategy_tab_content = filtered_quick_strategy_content; + this.guide_tab_content = () => filtered_user_guide; + this.video_tab_content = () => filter_video_guide; + this.faq_tab_content = () => filtered_faq_content; + this.quick_strategy_tab_content = () => filtered_quick_strategy_content; return filtered_tutorial_content; };