@nakamura-123/pages 1.3.16 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component/Article/ArticleCategoryList.js +88 -33
- package/dist/component/Article/ArticleContentView.d.ts +1 -0
- package/dist/component/Article/ArticleContentView.js +56 -14
- package/dist/component/Article/ArticleRow.d.ts +3 -2
- package/dist/component/Article/ArticleRow.js +42 -16
- package/dist/component/Basic/BasicProgressBar.js +7 -5
- package/dist/component/Basic/MiniTestCard.js +15 -9
- package/dist/component/Basic/Paw5s.js +2 -1
- package/dist/component/Basic/SubCategoryList.js +13 -18
- package/dist/component/Coin/CoinCheck.js +1 -1
- package/dist/component/Coin/CoinFnc.d.ts +2 -2
- package/dist/component/Coin/CoinFnc.js +13 -11
- package/dist/component/Coin/WaitingPayBanner.js +2 -3
- package/dist/component/Grade/GAllTags.d.ts +3 -0
- package/dist/component/Grade/GAllTags.js +45 -0
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +7 -3
- package/dist/component/Grade/GradeCard/DatePickerModal.js +2 -1
- package/dist/component/Grade/GradeCard/Square3sGrade.js +1 -1
- package/dist/component/Grade/GradeCard/TargetDate.js +1 -1
- package/dist/component/Grade/QuizCntGraph.js +2 -1
- package/dist/component/Grade/Square4s.js +4 -4
- package/dist/component/Grade/UnitCircles.d.ts +4 -2
- package/dist/component/Grade/UnitCircles.js +6 -5
- package/dist/component/Grade/YearCircles.d.ts +4 -2
- package/dist/component/Grade/YearCircles.js +7 -5
- package/dist/component/KeyboardCloseBar.js +2 -1
- package/dist/component/QuizSet/QuizOptionDrill.js +3 -14
- package/dist/component/Result/QuizFlatList.js +161 -57
- package/dist/component/Result/ResultActions.d.ts +7 -0
- package/dist/component/Result/ResultActions.js +107 -0
- package/dist/component/Result/ResultHero.d.ts +7 -0
- package/dist/component/Result/ResultHero.js +166 -0
- package/dist/component/SettingBtns/LanguageModal.d.ts +9 -0
- package/dist/component/SettingBtns/LanguageModal.js +103 -0
- package/dist/component/SettingBtns/TransBtn.js +7 -84
- package/dist/component/Tag5s.js +2 -2
- package/dist/component/TagBadge5s.js +7 -5
- package/dist/component/TestPage/BarChartContainer.js +2 -1
- package/dist/component/TestPage/Square3s.js +3 -2
- package/dist/engine/components.d.ts +19 -0
- package/dist/engine/components.js +19 -0
- package/dist/engine/drill.d.ts +3 -0
- package/dist/engine/drill.js +24 -0
- package/dist/engine/grammar.d.ts +3 -0
- package/dist/engine/grammar.js +22 -0
- package/dist/engine/index.d.ts +5 -0
- package/dist/engine/index.js +17 -0
- package/dist/engine/tango.d.ts +3 -0
- package/dist/engine/tango.js +28 -0
- package/dist/engine/types.d.ts +46 -0
- package/dist/engine/types.js +2 -0
- package/dist/functions/createQuizFncG.d.ts +12 -0
- package/dist/functions/createQuizFncG.js +40 -0
- package/dist/functions/nextItemFnc.d.ts +12 -0
- package/dist/functions/nextItemFnc.js +56 -0
- package/dist/functions/questionFormatD.d.ts +1 -0
- package/dist/functions/questionFormatD.js +14 -13
- package/dist/functions/questionFormatG.d.ts +7 -0
- package/dist/functions/questionFormatG.js +31 -0
- package/dist/functions/retryQuizFnc.d.ts +1 -0
- package/dist/functions/retryQuizFnc.js +13 -0
- package/dist/functions/tagFncG.d.ts +5 -0
- package/dist/functions/tagFncG.js +24 -0
- package/dist/functions/tagFncJ.d.ts +2 -2
- package/dist/functions/tagFncJ.js +1 -1
- package/dist/hooks/BadgeHook.d.ts +1 -1
- package/dist/hooks/BadgeHook.js +3 -3
- package/dist/hooks/ExitQuizHook.js +9 -7
- package/dist/hooks/basicHook.d.ts +9 -1
- package/dist/hooks/basicHook.js +17 -8
- package/dist/hooks/quizActionHook.d.ts +3 -1
- package/dist/hooks/quizActionHook.js +33 -1
- package/dist/hooks/quizHook.d.ts +6 -2
- package/dist/hooks/quizHook.js +39 -4
- package/dist/hooks/resultHook.d.ts +10 -0
- package/dist/hooks/resultHook.js +85 -0
- package/dist/page/ArticleDetail.js +25 -12
- package/dist/page/CoinPage.js +2 -2
- package/dist/page/FAQPage.js +4 -3
- package/dist/page/GetBadgePage.js +5 -4
- package/dist/page/GradePage.js +6 -9
- package/dist/page/HistoryPage.js +7 -4
- package/dist/page/HomePage.js +7 -3
- package/dist/page/QuizPage.js +4 -4
- package/dist/page/QuizSettingPage.js +3 -6
- package/dist/page/QuizSetupPage.js +6 -14
- package/dist/page/ReportPage.js +1 -1
- package/dist/page/ResultPage.js +8 -25
- package/dist/page/SettingPage.js +36 -3
- package/dist/page/TestPage.js +7 -14
- package/dist/quiz/Title.js +5 -2
- package/dist/quiz/check/Check.js +11 -7
- package/dist/quiz/check/NextQuizBtn.js +3 -2
- package/dist/quiz/check/SelectTag.js +7 -0
- package/dist/quiz/common/MyTextqqyy.d.ts +1 -0
- package/dist/quiz/common/MyTextqqyy.js +2 -2
- package/dist/quiz/common/RenderImgOrText.d.ts +2 -0
- package/dist/quiz/common/RenderImgOrText.js +2 -2
- package/dist/quiz/common/RubyText.d.ts +3 -1
- package/dist/quiz/common/RubyText.js +20 -5
- package/dist/quiz/grammar/GAnswer.d.ts +8 -0
- package/dist/quiz/grammar/GAnswer.js +115 -0
- package/dist/quiz/grammar/GGuideBtn.d.ts +8 -0
- package/dist/quiz/grammar/GGuideBtn.js +43 -0
- package/dist/quiz/grammar/GQuestion.d.ts +8 -0
- package/dist/quiz/grammar/GQuestion.js +109 -0
- package/dist/quiz/grammar/QuizContentsGrammar.d.ts +10 -0
- package/dist/quiz/grammar/QuizContentsGrammar.js +31 -0
- package/dist/quiz/jAnswer/JAnswerContents.js +12 -5
- package/dist/quiz/jQuestion/JQuestionBottomText.d.ts +2 -1
- package/dist/quiz/jQuestion/JQuestionBottomText.js +3 -1
- package/dist/quiz/save/QuizSaveData.js +1 -1
- package/dist/quiz/setting/Above3BtnJ.js +5 -4
- package/dist/quiz/setting/Bottom3Btn.js +5 -4
- package/dist/quiz/setting/GuideBtn.js +3 -2
- package/dist/quiz/setting/RepeatBtn.js +2 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/filterType.d.ts +2 -1
- package/package.json +23 -3
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Db, Lib, QSelected } from "@nakamura-123/types";
|
|
2
|
+
import { QRG } from "../types/filterType";
|
|
3
|
+
export declare const getUnitTagLevelsG: (QuestionDB: QRG, unitId: number, tag?: Db.SubjectTag) => Lib.LevelNames[];
|
|
4
|
+
export declare const getGrammarTagLevelsG: (QuestionDB: QRG, grammarId: number, tag?: Db.SubjectTag) => Lib.LevelNames[];
|
|
5
|
+
export declare const getLessonTagLevelsG: (QuestionDB: QRG, selected: QSelected.Selected) => Lib.LevelNames[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLessonTagLevelsG = exports.getGrammarTagLevelsG = exports.getUnitTagLevelsG = void 0;
|
|
4
|
+
const createQuizFncG_1 = require("./createQuizFncG");
|
|
5
|
+
const levelsOf = (questions, tag) => {
|
|
6
|
+
const tagName = (0, createQuizFncG_1.gTagOf)(tag);
|
|
7
|
+
return questions.map((question) => question[tagName].level);
|
|
8
|
+
};
|
|
9
|
+
// 章(=ミニテストの束)の問題のタグ
|
|
10
|
+
const getUnitTagLevelsG = (QuestionDB, unitId, tag) => levelsOf((0, createQuizFncG_1.getUnitQuestionsG)(QuestionDB, unitId), tag);
|
|
11
|
+
exports.getUnitTagLevelsG = getUnitTagLevelsG;
|
|
12
|
+
// 文法1つの問題のタグ
|
|
13
|
+
const getGrammarTagLevelsG = (QuestionDB, grammarId, tag) => levelsOf((0, createQuizFncG_1.getGrammarQuestionsG)(QuestionDB, grammarId), tag);
|
|
14
|
+
exports.getGrammarTagLevelsG = getGrammarTagLevelsG;
|
|
15
|
+
// 出題前の画面:選んだ文法(小分類が0なら章全体)のタグ。文法は年度の軸を持たない
|
|
16
|
+
const getLessonTagLevelsG = (QuestionDB, selected) => {
|
|
17
|
+
if (selected.type !== "unit")
|
|
18
|
+
return [];
|
|
19
|
+
const { category, lesson, tagName } = selected;
|
|
20
|
+
if (lesson.key === 0)
|
|
21
|
+
return (0, exports.getUnitTagLevelsG)(QuestionDB, category, tagName);
|
|
22
|
+
return (0, exports.getGrammarTagLevelsG)(QuestionDB, lesson.key, tagName);
|
|
23
|
+
};
|
|
24
|
+
exports.getLessonTagLevelsG = getLessonTagLevelsG;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JAssets } from "@nakamura-123/types";
|
|
2
2
|
import { QSelected, Lib } from "@nakamura-123/types";
|
|
3
3
|
import type { QRJ } from "../types/filterType";
|
|
4
4
|
export declare function getCategoryTagLevelCntsJ(QuestionDB: QRJ, category: number, tag?: JAssets.JTag): Lib.LevelNames[];
|
|
5
5
|
export declare function getUnitSubTagLevelCntsJ(QuestionDB: QRJ, unitId: number, subUnitId: number, tag?: JAssets.JTag): string[];
|
|
6
6
|
export declare const getSubTagLevelCntsJ: (QuestionDB: QRJ, selected: QSelected.SelectedUnit | QSelected.SelectedYear) => Lib.LevelNames[];
|
|
7
|
-
export declare const getTagNameFilterJ: (QuestionDB: QRJ, tagName?:
|
|
7
|
+
export declare const getTagNameFilterJ: (QuestionDB: QRJ, tagName?: JAssets.JTag) => Lib.LevelNames[];
|
|
@@ -28,7 +28,7 @@ exports.getSubTagLevelCntsJ = getSubTagLevelCntsJ;
|
|
|
28
28
|
// 12_11のヘルパー(単元別の5種のタグをカウント)
|
|
29
29
|
const helperUnitTags = (filteredQuestions, selected) => {
|
|
30
30
|
const { category, lesson } = selected;
|
|
31
|
-
const tagName = selected.tagName || "basicTag";
|
|
31
|
+
const tagName = (selected.tagName || "basicTag");
|
|
32
32
|
if (lesson.key === 0)
|
|
33
33
|
return (0, questionFilterJ_1.getUnitQuestionsJ)(filteredQuestions, category).map((question) => question[tagName].level);
|
|
34
34
|
return (0, questionFilterJ_1.getSubUnitQuestionsJ)(filteredQuestions, category, lesson.key).map((question) => question[tagName].level);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useCheckBadgeEligibility: () => () => void;
|
|
1
|
+
export declare const useCheckBadgeEligibility: () => (onlyDailyLog?: boolean) => void;
|
package/dist/hooks/BadgeHook.js
CHANGED
|
@@ -17,15 +17,15 @@ const useCheckBadgeEligibility = () => {
|
|
|
17
17
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
18
18
|
const selected = (0, react_redux_1.useSelector)((state) => state.quiz.selected);
|
|
19
19
|
// 関数を返す
|
|
20
|
-
const handleCheckBadgeEligibility = () => {
|
|
20
|
+
const handleCheckBadgeEligibility = (onlyDailyLog = false) => {
|
|
21
21
|
let eligibleBadges = [];
|
|
22
22
|
// 01.ベーシックの指定カテゴリーのバッジ条件を判定
|
|
23
|
-
if (isBasic(selected.subject)) {
|
|
23
|
+
if (!onlyDailyLog && isBasic(selected.subject)) {
|
|
24
24
|
const basicBadges = (0, badgeFnc_1.checkBasicBadge)(BadgeDB, MiniDB, selected);
|
|
25
25
|
eligibleBadges = [...eligibleBadges, ...basicBadges];
|
|
26
26
|
}
|
|
27
27
|
// 02.模擬試験のバッジ条件を判定
|
|
28
|
-
if (selected.type === "test") {
|
|
28
|
+
if (!onlyDailyLog && selected.type === "test") {
|
|
29
29
|
const testBadges = (0, badgeFnc_1.checkTestBadge)(BadgeDB, TestDB, selected);
|
|
30
30
|
eligibleBadges = [...eligibleBadges, ...testBadges];
|
|
31
31
|
}
|
|
@@ -5,9 +5,11 @@ const react_1 = require("react");
|
|
|
5
5
|
const react_native_1 = require("react-native");
|
|
6
6
|
const native_1 = require("@react-navigation/native");
|
|
7
7
|
const react_redux_1 = require("react-redux");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
8
9
|
const stores_1 = require("@nakamura-123/stores");
|
|
9
10
|
const useConfirmExit = (navigation) => {
|
|
10
11
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
12
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
11
13
|
const key = (0, react_redux_1.useSelector)((state) => state.quiz.selected.subject);
|
|
12
14
|
const onSaveProgress = () => dispatch(stores_1.saveStorage.saveQuizToStorage());
|
|
13
15
|
const removeSave = () => dispatch(stores_1.saveStorage.deleteQuizInStorage(key));
|
|
@@ -15,14 +17,14 @@ const useConfirmExit = (navigation) => {
|
|
|
15
17
|
const unsubscribe = navigation.addListener("beforeRemove", (e) => {
|
|
16
18
|
if (e.data.action.type === "POP") {
|
|
17
19
|
e.preventDefault(); // デフォルトの戻る動作をキャンセル
|
|
18
|
-
showExitConfirmation(() => navigation.dispatch(e.data.action), onSaveProgress, removeSave);
|
|
20
|
+
showExitConfirmation(() => navigation.dispatch(e.data.action), onSaveProgress, removeSave, t);
|
|
19
21
|
}
|
|
20
22
|
});
|
|
21
23
|
return unsubscribe;
|
|
22
24
|
}, []);
|
|
23
25
|
(0, native_1.useFocusEffect)((0, react_1.useCallback)(() => {
|
|
24
26
|
const onBackPress = () => {
|
|
25
|
-
showExitConfirmation(() => navigation.goBack(), onSaveProgress, removeSave);
|
|
27
|
+
showExitConfirmation(() => navigation.goBack(), onSaveProgress, removeSave, t);
|
|
26
28
|
return true; // デフォルトの戻る挙動を無効化
|
|
27
29
|
};
|
|
28
30
|
const subscription = react_native_1.BackHandler.addEventListener("hardwareBackPress", onBackPress);
|
|
@@ -31,18 +33,18 @@ const useConfirmExit = (navigation) => {
|
|
|
31
33
|
};
|
|
32
34
|
exports.useConfirmExit = useConfirmExit;
|
|
33
35
|
// 確認ダイアログを表示する関数
|
|
34
|
-
const showExitConfirmation = (onConfirm, onSaveProgress, removeSave) => {
|
|
35
|
-
react_native_1.Alert.alert("
|
|
36
|
-
{ text: "
|
|
36
|
+
const showExitConfirmation = (onConfirm, onSaveProgress, removeSave, t) => {
|
|
37
|
+
react_native_1.Alert.alert(t("quiz.exit.title"), t("quiz.exit.msg"), [
|
|
38
|
+
{ text: t("quiz.save.cancel"), style: "cancel" },
|
|
37
39
|
{
|
|
38
|
-
text: "
|
|
40
|
+
text: t("quiz.save.noSave"),
|
|
39
41
|
onPress: () => {
|
|
40
42
|
removeSave();
|
|
41
43
|
onConfirm();
|
|
42
44
|
},
|
|
43
45
|
},
|
|
44
46
|
{
|
|
45
|
-
text: "
|
|
47
|
+
text: t("quiz.save.save"),
|
|
46
48
|
onPress: () => {
|
|
47
49
|
onSaveProgress();
|
|
48
50
|
onConfirm();
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { Results } from "realm";
|
|
1
2
|
import { StackNavigationProp } from "@react-navigation/stack";
|
|
2
|
-
import { Nav } from "@nakamura-123/types";
|
|
3
|
+
import { ASetting, Nav } from "@nakamura-123/types";
|
|
3
4
|
import type { QRQuery } from "../types/filterType";
|
|
5
|
+
import { EngineOps } from "../engine";
|
|
4
6
|
export declare const useIsReturnNull: (navigation: StackNavigationProp<Nav.RootStackParamList>) => boolean;
|
|
5
7
|
export declare const useGetAppSystem: () => "drill" | "JLPT";
|
|
8
|
+
export declare const useQuizEngine: () => ASetting.QuizEngine;
|
|
9
|
+
export declare const useEngineQuery: () => {
|
|
10
|
+
engine: ASetting.QuizEngine;
|
|
11
|
+
ops: EngineOps;
|
|
12
|
+
query: Results<any>;
|
|
13
|
+
};
|
|
6
14
|
export declare const useGetQuestionQuery: () => QRQuery;
|
package/dist/hooks/basicHook.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useGetQuestionQuery = exports.useGetAppSystem = exports.useIsReturnNull = void 0;
|
|
3
|
+
exports.useGetQuestionQuery = exports.useEngineQuery = exports.useQuizEngine = exports.useGetAppSystem = exports.useIsReturnNull = void 0;
|
|
4
4
|
const react_redux_1 = require("react-redux");
|
|
5
5
|
const native_1 = require("@react-navigation/native");
|
|
6
6
|
const react_1 = require("@realm/react");
|
|
7
|
-
const
|
|
7
|
+
const engine_1 = require("../engine");
|
|
8
8
|
const useIsReturnNull = (navigation) => {
|
|
9
9
|
const isFocused = (0, native_1.useIsFocused)();
|
|
10
10
|
const currentRoute = navigation.getState().routes[navigation.getState().index].name;
|
|
@@ -21,12 +21,21 @@ const useGetAppSystem = () => {
|
|
|
21
21
|
return appSystem;
|
|
22
22
|
};
|
|
23
23
|
exports.useGetAppSystem = useGetAppSystem;
|
|
24
|
+
// アプリのエンジン(出題の仕組み)。アプリの中で変わらない
|
|
25
|
+
const useQuizEngine = () => (0, engine_1.resolveEngine)((0, react_redux_1.useSelector)((state) => state.app.appSetting.setting));
|
|
26
|
+
exports.useQuizEngine = useQuizEngine;
|
|
27
|
+
// エンジンの中身(engine/の対応表)と、そのエンジンの問題の表
|
|
28
|
+
const useEngineQuery = () => {
|
|
29
|
+
const engine = (0, exports.useQuizEngine)();
|
|
30
|
+
const ops = engine_1.engines[engine];
|
|
31
|
+
return { engine, ops, query: (0, react_1.useQuery)(ops.schema) };
|
|
32
|
+
};
|
|
33
|
+
exports.useEngineQuery = useEngineQuery;
|
|
34
|
+
// 対応表に移っていない画面のために残している。systemは問題の表がJLPT単語かどうか
|
|
24
35
|
const useGetQuestionQuery = () => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
else
|
|
30
|
-
return { system: "drill", query: (0, react_1.useQuery)(db_1.DQuestionSchema) };
|
|
36
|
+
const { engine, query } = (0, exports.useEngineQuery)();
|
|
37
|
+
return engine === "tango"
|
|
38
|
+
? { system: "JLPT", query }
|
|
39
|
+
: { system: "drill", query };
|
|
31
40
|
};
|
|
32
41
|
exports.useGetQuestionQuery = useGetQuestionQuery;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { StackNavigationProp } from "@react-navigation/stack";
|
|
2
2
|
import { JStore, Nav, Storage, Store } from "@nakamura-123/types";
|
|
3
|
+
import type { QuizList } from "../engine";
|
|
3
4
|
export declare const useNextQuizAction: () => (navigation: StackNavigationProp<Nav.RootStackParamList>) => void;
|
|
4
|
-
export declare const useStartQuizAction: () => (subjectName: Storage.SaveQuizKey, quizList:
|
|
5
|
+
export declare const useStartQuizAction: () => (subjectName: Storage.SaveQuizKey, quizList: QuizList) => boolean;
|
|
5
6
|
export declare const useChangeModeToCheck: (system?: "JLPT" | "drill", jQuestion?: JStore.JQInStore | null) => ((isCorrected: boolean, onSound?: boolean) => void) | null;
|
|
7
|
+
export declare const useAnswerGrammarAction: () => (isCorrected: boolean) => void;
|
|
6
8
|
export declare const useNextMultiQuisAction: (question: Store.DQInStoreMulti) => (i: number) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useNextMultiQuisAction = exports.useChangeModeToCheck = exports.useStartQuizAction = exports.useNextQuizAction = void 0;
|
|
3
|
+
exports.useNextMultiQuisAction = exports.useAnswerGrammarAction = exports.useChangeModeToCheck = exports.useStartQuizAction = exports.useNextQuizAction = void 0;
|
|
4
4
|
const react_redux_1 = require("react-redux");
|
|
5
5
|
const react_native_1 = require("react-native");
|
|
6
6
|
const react_1 = require("@realm/react");
|
|
@@ -99,6 +99,38 @@ const useChangeModeToCheck = (system, jQuestion = null) => {
|
|
|
99
99
|
return handleModeChange;
|
|
100
100
|
};
|
|
101
101
|
exports.useChangeModeToCheck = useChangeModeToCheck;
|
|
102
|
+
// 文法の問題に答えたとき。意味を取る問題は答えたあとも押し直せ、最後に押したほうで決まる。
|
|
103
|
+
// 押し直しでは、タグは解き始めの段階から動かし直し、点数は差し引きし、その日の解いた数は増やさない
|
|
104
|
+
const useAnswerGrammarAction = () => {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
107
|
+
const realm = (0, react_1.useRealm)();
|
|
108
|
+
const playSound = common_1.commonHook.usePlaySound();
|
|
109
|
+
const question = (0, quizHook_1.useQuestionDataG)();
|
|
110
|
+
const tagId = (0, quizHook_1.useTagIdG)((_a = question === null || question === void 0 ? void 0 : question.quizId) !== null && _a !== void 0 ? _a : -1, (_b = question === null || question === void 0 ? void 0 : question.tagName) !== null && _b !== void 0 ? _b : "meaningTag");
|
|
111
|
+
const handleAnswer = (isCorrected) => {
|
|
112
|
+
if (!question)
|
|
113
|
+
return;
|
|
114
|
+
const before = question.isCorrected;
|
|
115
|
+
if (before === isCorrected)
|
|
116
|
+
return;
|
|
117
|
+
const isFirst = before === undefined;
|
|
118
|
+
playSound(isCorrected ? "correct" : "btn");
|
|
119
|
+
dispatch(stores_1.quizAction.changeMode("check"));
|
|
120
|
+
dispatch(stores_1.quizAction.setIsCorrected(isCorrected));
|
|
121
|
+
if (tagId)
|
|
122
|
+
dispatch(db_1.TagModel.autoChangeTagLevel(realm, tagId, question.startTag, isCorrected));
|
|
123
|
+
if (isCorrected)
|
|
124
|
+
dispatch(stores_1.quizAction.addOnePoint());
|
|
125
|
+
else if (!isFirst)
|
|
126
|
+
dispatch(stores_1.quizAction.removeOnePoint());
|
|
127
|
+
if (isFirst)
|
|
128
|
+
dispatch(db_1.DailyLogModel.addOneCntToday(realm));
|
|
129
|
+
dispatch(stores_1.saveStorage.saveQuizToStorage());
|
|
130
|
+
};
|
|
131
|
+
return handleAnswer;
|
|
132
|
+
};
|
|
133
|
+
exports.useAnswerGrammarAction = useAnswerGrammarAction;
|
|
102
134
|
const useNextMultiQuisAction = (question) => {
|
|
103
135
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
104
136
|
const playSound = common_1.commonHook.usePlaySound();
|
package/dist/hooks/quizHook.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import Realm from "realm";
|
|
2
|
-
import {
|
|
2
|
+
import { GAssets, GStore, JAssets, JStore, Store } from "@nakamura-123/types";
|
|
3
3
|
type DQInStoreKey = keyof Store.DQInStore;
|
|
4
4
|
export declare const useQuestionDataD: () => Store.DQInStore | null;
|
|
5
5
|
export declare const useQuestionDataJ: () => JStore.JQInStore | null;
|
|
6
|
+
export declare const useQuestionDataG: () => GStore.GQInStore | null;
|
|
6
7
|
export declare const useOneQuestionData: (key: DQInStoreKey) => Store.DQInStore[DQInStoreKey];
|
|
7
8
|
export declare const useGetMode: () => Store.Mode;
|
|
8
9
|
export declare const useTagIdByObjectId: (tagObjectId: string) => Realm.BSON.ObjectId;
|
|
9
10
|
export declare const useTagId: (tagObjectId: string | undefined, yearId: number, num: number) => Realm.BSON.ObjectId;
|
|
10
|
-
export declare const useTagIdJ: (quizId: string, tagName?:
|
|
11
|
+
export declare const useTagIdJ: (quizId: string, tagName?: JAssets.JTag) => Realm.BSON.ObjectId;
|
|
12
|
+
export declare const useTagIdG: (quizId: number, tagName: GStore.GTag) => Realm.BSON.ObjectId | null;
|
|
13
|
+
export declare const useGrammarLang: () => GAssets.GLang;
|
|
14
|
+
export declare const useGrammarTrans: (quizId: number | undefined) => string | null;
|
|
11
15
|
export declare const useIsLastCheckTurn: () => boolean;
|
|
12
16
|
export interface ScoreInfo {
|
|
13
17
|
score: number;
|
package/dist/hooks/quizHook.js
CHANGED
|
@@ -3,18 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useGetBothVoicePath = exports.useGetVoicePath = exports.useScoreInfo = exports.useIsLastCheckTurn = exports.useTagIdJ = exports.useTagId = exports.useTagIdByObjectId = exports.useGetMode = exports.useOneQuestionData = exports.useQuestionDataJ = exports.useQuestionDataD = void 0;
|
|
6
|
+
exports.useGetBothVoicePath = exports.useGetVoicePath = exports.useScoreInfo = exports.useIsLastCheckTurn = exports.useGrammarTrans = exports.useGrammarLang = exports.useTagIdG = exports.useTagIdJ = exports.useTagId = exports.useTagIdByObjectId = exports.useGetMode = exports.useOneQuestionData = exports.useQuestionDataG = exports.useQuestionDataJ = exports.useQuestionDataD = void 0;
|
|
7
7
|
const realm_1 = __importDefault(require("realm"));
|
|
8
8
|
const react_redux_1 = require("react-redux");
|
|
9
9
|
const react_1 = require("@realm/react");
|
|
10
10
|
const db_1 = require("@nakamura-123/db");
|
|
11
|
+
// 過去問の問題か。D・Jで判定を揃える(以前はD側が「JLPTでなければ」、J側が「drillでなければ」で、
|
|
12
|
+
// 第3の系統の問題が両方を素通りした)。systemのない問題は古い保存データの過去問として扱う
|
|
13
|
+
const isDrillQuestion = (question) => question.system === undefined || question.system === "drill";
|
|
11
14
|
// クイズデータ一式を取得
|
|
12
15
|
const useQuestionDataD = () => {
|
|
13
16
|
const { turn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
14
17
|
const question = (0, react_redux_1.useSelector)((state) => state.quiz.quizList[turn]);
|
|
15
18
|
if (!question)
|
|
16
19
|
return null;
|
|
17
|
-
if (question
|
|
20
|
+
if (!isDrillQuestion(question))
|
|
18
21
|
return null;
|
|
19
22
|
return question;
|
|
20
23
|
};
|
|
@@ -24,16 +27,26 @@ const useQuestionDataJ = () => {
|
|
|
24
27
|
const question = (0, react_redux_1.useSelector)((state) => state.quiz.quizList[turn]);
|
|
25
28
|
if (!question)
|
|
26
29
|
return null;
|
|
27
|
-
if (question.system
|
|
30
|
+
if (question.system !== "JLPT")
|
|
28
31
|
return null;
|
|
29
32
|
return question;
|
|
30
33
|
};
|
|
31
34
|
exports.useQuestionDataJ = useQuestionDataJ;
|
|
35
|
+
const useQuestionDataG = () => {
|
|
36
|
+
const { turn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
|
|
37
|
+
const question = (0, react_redux_1.useSelector)((state) => state.quiz.quizList[turn]);
|
|
38
|
+
if (!question)
|
|
39
|
+
return null;
|
|
40
|
+
if (question.system !== "grammar")
|
|
41
|
+
return null;
|
|
42
|
+
return question;
|
|
43
|
+
};
|
|
44
|
+
exports.useQuestionDataG = useQuestionDataG;
|
|
32
45
|
// クイズデータのうち、指定したキーのデータを取得
|
|
33
46
|
const useOneQuestionData = (key) => {
|
|
34
47
|
const turn = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state.turn);
|
|
35
48
|
const question = (0, react_redux_1.useSelector)((state) => state.quiz.quizList[turn]);
|
|
36
|
-
if (question
|
|
49
|
+
if (!isDrillQuestion(question))
|
|
37
50
|
return null;
|
|
38
51
|
const value = question[key];
|
|
39
52
|
return value;
|
|
@@ -74,6 +87,28 @@ const useTagIdJ = (quizId, tagName = "basicTag") => {
|
|
|
74
87
|
return tagId;
|
|
75
88
|
};
|
|
76
89
|
exports.useTagIdJ = useTagIdJ;
|
|
90
|
+
// 文法のタグIDを取得
|
|
91
|
+
const useTagIdG = (quizId, tagName) => {
|
|
92
|
+
const questions = (0, react_1.useQuery)(db_1.GQuestionSchema);
|
|
93
|
+
const question = questions.filtered("quizId == $0", quizId)[0];
|
|
94
|
+
return question ? question[tagName]._id : null;
|
|
95
|
+
};
|
|
96
|
+
exports.useTagIdG = useTagIdG;
|
|
97
|
+
// 文法(G系)の例文の訳の言語。画面の言語に合わせ、日本語のときは訳が無いので英語
|
|
98
|
+
const useGrammarLang = () => {
|
|
99
|
+
const language = (0, react_redux_1.useSelector)((state) => state.setting.language);
|
|
100
|
+
return language === "ja" ? "en" : language;
|
|
101
|
+
};
|
|
102
|
+
exports.useGrammarLang = useGrammarLang;
|
|
103
|
+
const useGrammarTrans = (quizId) => {
|
|
104
|
+
var _a;
|
|
105
|
+
const lang = (0, exports.useGrammarLang)();
|
|
106
|
+
const trans = (0, react_redux_1.useSelector)((state) => state.app.grammarTrans[lang]);
|
|
107
|
+
if (quizId === undefined || !trans)
|
|
108
|
+
return null;
|
|
109
|
+
return (_a = trans[quizId]) !== null && _a !== void 0 ? _a : null;
|
|
110
|
+
};
|
|
111
|
+
exports.useGrammarTrans = useGrammarTrans;
|
|
77
112
|
// 現在のターンが最後のターンかどうかを取得
|
|
78
113
|
const useIsLastTurn = () => {
|
|
79
114
|
const quizCnt = (0, react_redux_1.useSelector)((state) => state.quiz.quizList).length;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Nav, QSelected } from "@nakamura-123/types";
|
|
2
|
+
export declare const useFrozenOnRetry: <T>(value: T) => T;
|
|
3
|
+
export declare const useWrongCount: () => number;
|
|
4
|
+
export declare const useRetryQuizAction: (navigation: Nav.NavigationProp<"Result">) => (onlyWrong: boolean) => void;
|
|
5
|
+
export declare const useMakeNext: () => (via: "lesson" | "list", type: "unit" | "year", category: number, key: number) => QSelected.NextItem | undefined;
|
|
6
|
+
export type NextInResult = {
|
|
7
|
+
kind: "article" | "unit";
|
|
8
|
+
go: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const useNextInResult: (navigation: Nav.NavigationProp<"Result">) => NextInResult | null;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNextInResult = exports.useMakeNext = exports.useRetryQuizAction = exports.useWrongCount = exports.useFrozenOnRetry = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_redux_1 = require("react-redux");
|
|
6
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
7
|
+
const nextItemFnc_1 = require("../functions/nextItemFnc");
|
|
8
|
+
const retryQuizFnc_1 = require("../functions/retryQuizFnc");
|
|
9
|
+
// やり直すとstoreは先に次の出題の状態(点数0など)へ変わるが、結果画面は切り替えのアニメーションが
|
|
10
|
+
// 終わるまで見えている。その間は直前の結果を見せ続ける。
|
|
11
|
+
// 結果画面のmodeはcheckかresultで、quizになるのはやり直しで離れるときだけ
|
|
12
|
+
const useFrozenOnRetry = (value) => {
|
|
13
|
+
const isLeaving = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state.mode === "quiz");
|
|
14
|
+
const last = (0, react_1.useRef)(value);
|
|
15
|
+
if (!isLeaving)
|
|
16
|
+
last.current = value;
|
|
17
|
+
return last.current;
|
|
18
|
+
};
|
|
19
|
+
exports.useFrozenOnRetry = useFrozenOnRetry;
|
|
20
|
+
// ○でなかった問題(×と、答えずに進めた問題)の数
|
|
21
|
+
const useWrongCount = () => (0, react_redux_1.useSelector)((state) => state.quiz.quizList.filter((q) => q.isCorrected !== true).length);
|
|
22
|
+
exports.useWrongCount = useWrongCount;
|
|
23
|
+
// 結果画面から、同じ問題(または×だけ)を同じ順で1問目から解き直す。
|
|
24
|
+
// 復習なので、試験の記録・履歴には残さない。その日の問題数には数える(isRetry)
|
|
25
|
+
const useRetryQuizAction = (navigation) => {
|
|
26
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
27
|
+
const quizList = (0, react_redux_1.useSelector)((state) => state.quiz.quizList);
|
|
28
|
+
const subject = (0, react_redux_1.useSelector)((state) => state.quiz.selected.subject);
|
|
29
|
+
return (onlyWrong) => {
|
|
30
|
+
const reset = (0, retryQuizFnc_1.toRetryQuizList)(quizList, onlyWrong);
|
|
31
|
+
if (reset.length === 0)
|
|
32
|
+
return;
|
|
33
|
+
dispatch(stores_1.quizAction.resetCurrentInfo());
|
|
34
|
+
dispatch(stores_1.quizAction.markRetry());
|
|
35
|
+
dispatch(stores_1.saveStorage.deleteQuizInStorage(subject));
|
|
36
|
+
dispatch(stores_1.quizAction.setQuizList(reset));
|
|
37
|
+
navigation.replace("Quiz");
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
exports.useRetryQuizAction = useRetryQuizAction;
|
|
41
|
+
// 問題を始める画面が「次へ」の行き先を決める。via は、始めた画面が見せている並び
|
|
42
|
+
// (レッスンの一覧・説明画面なら "lesson"、単元別・試験別の一覧なら "list")
|
|
43
|
+
const useMakeNext = () => {
|
|
44
|
+
const unitList = (0, react_redux_1.useSelector)((state) => state.app.unitList);
|
|
45
|
+
const yearList = (0, react_redux_1.useSelector)((state) => state.app.yearList);
|
|
46
|
+
const articleList = (0, react_redux_1.useSelector)((state) => state.app.articleList);
|
|
47
|
+
const articleContents = (0, react_redux_1.useSelector)((state) => state.app.articleContents);
|
|
48
|
+
return (via, type, category, key) => via === "lesson"
|
|
49
|
+
? (0, nextItemFnc_1.getNextInLesson)(articleList, articleContents, unitList, category, key)
|
|
50
|
+
: (0, nextItemFnc_1.getNextInList)(type === "unit" ? unitList : yearList, type, category, key);
|
|
51
|
+
};
|
|
52
|
+
exports.useMakeNext = useMakeNext;
|
|
53
|
+
// 結果画面の「次へ」。始めるときに決めておいた行き先(selected.next)へ進む。無ければnull
|
|
54
|
+
const useNextInResult = (navigation) => {
|
|
55
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
56
|
+
const selected = (0, react_redux_1.useSelector)((state) => state.quiz.selected);
|
|
57
|
+
const makeNext = (0, exports.useMakeNext)();
|
|
58
|
+
if (selected.type !== "unit" && selected.type !== "year")
|
|
59
|
+
return null;
|
|
60
|
+
const next = selected.next;
|
|
61
|
+
if (!next)
|
|
62
|
+
return null;
|
|
63
|
+
if (next.type === "article")
|
|
64
|
+
return {
|
|
65
|
+
kind: "article",
|
|
66
|
+
go: () => navigation.replace("ArticleDetail", {
|
|
67
|
+
subject: selected.subject,
|
|
68
|
+
chapterKey: next.chapterKey,
|
|
69
|
+
articleId: next.articleId,
|
|
70
|
+
title: next.title,
|
|
71
|
+
tag: selected.tagName,
|
|
72
|
+
system: selected.system,
|
|
73
|
+
}),
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
kind: "unit",
|
|
77
|
+
go: () => {
|
|
78
|
+
// 次の単元に進むときも、同じ並びでその次を決め直す
|
|
79
|
+
const following = makeNext(next.via, selected.type, next.category, next.lesson.key);
|
|
80
|
+
dispatch(stores_1.quizAction.setLesson(Object.assign(Object.assign({}, selected), { category: next.category, lesson: next.lesson, next: following })));
|
|
81
|
+
navigation.replace("QuizSetup");
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
exports.useNextInResult = useNextInResult;
|
|
@@ -35,14 +35,17 @@ const stores_1 = require("@nakamura-123/stores");
|
|
|
35
35
|
const ArticleContentView_1 = __importDefault(require("../component/Article/ArticleContentView"));
|
|
36
36
|
const articleContentFnc_1 = require("../functions/articleContentFnc");
|
|
37
37
|
const articleListFnc_1 = require("../functions/articleListFnc");
|
|
38
|
+
const resultHook_1 = require("../hooks/resultHook");
|
|
38
39
|
const ArticleDetail = ({ navigation, route }) => {
|
|
39
|
-
const { subject, chapterKey, articleId, title } = route.params;
|
|
40
|
+
const { subject, chapterKey, articleId, title, tag, system, isGuide } = route.params;
|
|
40
41
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
42
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
41
43
|
const isRead = (0, react_redux_1.useSelector)((state) => { var _a; return !!((_a = state.setting.articles[articleId]) === null || _a === void 0 ? void 0 : _a.isRead); });
|
|
42
44
|
const flagColor = (0, react_redux_1.useSelector)((state) => { var _a, _b; return (_b = (_a = state.setting.articles[articleId]) === null || _a === void 0 ? void 0 : _a.flag) !== null && _b !== void 0 ? _b : null; });
|
|
43
45
|
const rawContent = (0, react_redux_1.useSelector)((state) => state.app.articleContents[articleId]);
|
|
44
46
|
const articleList = (0, react_redux_1.useSelector)((state) => state.app.articleList);
|
|
45
47
|
const unitList = (0, react_redux_1.useSelector)((state) => state.app.unitList);
|
|
48
|
+
const makeNext = (0, resultHook_1.useMakeNext)();
|
|
46
49
|
// 未読の場合のみ既読を記録する(既読済みなら毎回AsyncStorageへ書き込まない)
|
|
47
50
|
(0, react_1.useEffect)(() => {
|
|
48
51
|
if (isRead)
|
|
@@ -50,8 +53,10 @@ const ArticleDetail = ({ navigation, route }) => {
|
|
|
50
53
|
dispatch({ type: "setting/markArticleAsRead", payload: { articleId } });
|
|
51
54
|
dispatch(stores_1.settingStorage.saveSetting());
|
|
52
55
|
}, [articleId, isRead]);
|
|
53
|
-
// この記事を開いたことを記録する(単元一覧の赤枠と排他表示するため)
|
|
56
|
+
// この記事を開いたことを記録する(単元一覧の赤枠と排他表示するため)。問題画面から開いたときは記録しない
|
|
54
57
|
(0, react_1.useEffect)(() => {
|
|
58
|
+
if (isGuide)
|
|
59
|
+
return;
|
|
55
60
|
dispatch({
|
|
56
61
|
type: "setting/saveArticlePreSelect",
|
|
57
62
|
payload: { subject, articleId },
|
|
@@ -65,8 +70,11 @@ const ArticleDetail = ({ navigation, route }) => {
|
|
|
65
70
|
// articleListの並び順で「次の要素」を見て末尾ボタンの内容を決める
|
|
66
71
|
const chapterEntry = articleList.find((entry) => entry.key === chapterKey);
|
|
67
72
|
const itemIndex = chapterEntry === null || chapterEntry === void 0 ? void 0 : chapterEntry.items.findIndex((item) => item.type === "article" && item.key === Number(articleId));
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
// 見出しは押せないので飛ばす
|
|
74
|
+
const nextItem = !isGuide && chapterEntry && itemIndex !== undefined && itemIndex !== -1
|
|
75
|
+
? chapterEntry.items
|
|
76
|
+
.slice(itemIndex + 1)
|
|
77
|
+
.find((item) => item.type !== "heading")
|
|
70
78
|
: undefined;
|
|
71
79
|
const handleStartQuiz = () => {
|
|
72
80
|
if (!nextItem || nextItem.type !== "unit")
|
|
@@ -80,6 +88,9 @@ const ArticleDetail = ({ navigation, route }) => {
|
|
|
80
88
|
subject,
|
|
81
89
|
category: chapterKey,
|
|
82
90
|
lesson: Object.assign(Object.assign({}, subUnit), { title: `${chapter.label} ${subUnit.title}` }),
|
|
91
|
+
tagName: tag,
|
|
92
|
+
system,
|
|
93
|
+
next: makeNext("lesson", "unit", chapterKey, subUnit.key),
|
|
83
94
|
};
|
|
84
95
|
dispatch(stores_1.quizAction.setLesson(selected));
|
|
85
96
|
navigation.replace("QuizSetup");
|
|
@@ -92,26 +103,28 @@ const ArticleDetail = ({ navigation, route }) => {
|
|
|
92
103
|
chapterKey,
|
|
93
104
|
articleId: (0, articleListFnc_1.getArticleId)(nextItem.key),
|
|
94
105
|
title: nextItem.title,
|
|
106
|
+
tag,
|
|
107
|
+
system,
|
|
95
108
|
});
|
|
96
109
|
};
|
|
97
110
|
return (<react_native_1.ScrollView style={styles.container} contentContainerStyle={styles.content}>
|
|
98
|
-
{rawContent ? (<ArticleContentView_1.default content={(0, articleContentFnc_1.parseArticleContent)(rawContent)}/>) : (<react_native_1.View style={styles.placeholder}>
|
|
111
|
+
{rawContent ? (<ArticleContentView_1.default content={(0, articleContentFnc_1.parseArticleContent)(rawContent)} articleId={articleId}/>) : (<react_native_1.View style={styles.placeholder}>
|
|
99
112
|
<common_1.MyText fsize="lg" weight={700} style={styles.placeholderTitle}>
|
|
100
113
|
{title}
|
|
101
114
|
</common_1.MyText>
|
|
102
115
|
<common_1.MyText fsize="sm" color="ltBlack">
|
|
103
|
-
|
|
116
|
+
{t("article.preparing")}
|
|
104
117
|
</common_1.MyText>
|
|
105
118
|
</react_native_1.View>)}
|
|
106
119
|
|
|
107
120
|
{(nextItem === null || nextItem === void 0 ? void 0 : nextItem.type) === "unit" && (<common_1.PressAnimatedWrap onPress={handleStartQuiz} style={styles.ctaButton}>
|
|
108
121
|
<common_1.MyText fsize="sm" weight={700}>
|
|
109
|
-
|
|
122
|
+
{t("article.startQuiz")}
|
|
110
123
|
</common_1.MyText>
|
|
111
124
|
</common_1.PressAnimatedWrap>)}
|
|
112
125
|
{(nextItem === null || nextItem === void 0 ? void 0 : nextItem.type) === "article" && (<common_1.PressAnimatedWrap onPress={handleGoToNextArticle} style={styles.ctaButton}>
|
|
113
|
-
<common_1.MyText fsize="sm" weight={700}
|
|
114
|
-
|
|
126
|
+
<common_1.MyText fsize="sm" weight={700}>
|
|
127
|
+
{t("article.next")}
|
|
115
128
|
</common_1.MyText>
|
|
116
129
|
</common_1.PressAnimatedWrap>)}
|
|
117
130
|
|
|
@@ -119,13 +132,13 @@ const ArticleDetail = ({ navigation, route }) => {
|
|
|
119
132
|
<common_1.PressAnimatedWrap onPress={handleToggleFlag} outerStyle={styles.bottomButtonOuter} style={styles.bottomButton}>
|
|
120
133
|
<common_1.Icon5 name="bookmark" size={16} color={flagColor ? "yellow" : "ltBlack"} solid={!!flagColor} style={styles.bottomButtonIcon}/>
|
|
121
134
|
<common_1.MyText fsize="sm" weight={700} color="text">
|
|
122
|
-
|
|
135
|
+
{t("article.flag")}
|
|
123
136
|
</common_1.MyText>
|
|
124
137
|
</common_1.PressAnimatedWrap>
|
|
125
138
|
<common_1.PressAnimatedWrap onPress={() => navigation.goBack()} outerStyle={styles.bottomButtonOuter} style={styles.bottomButton}>
|
|
126
139
|
<common_1.Icon5 name="arrow-left" size={16} color="ltBlack" style={styles.bottomButtonIcon}/>
|
|
127
140
|
<common_1.MyText fsize="sm" weight={700} color="text">
|
|
128
|
-
|
|
141
|
+
{isGuide ? t("article.backToQuiz") : t("article.backToList")}
|
|
129
142
|
</common_1.MyText>
|
|
130
143
|
</common_1.PressAnimatedWrap>
|
|
131
144
|
</react_native_1.View>
|
|
@@ -135,7 +148,7 @@ const ArticleDetail = ({ navigation, route }) => {
|
|
|
135
148
|
})} style={styles.reportLink}>
|
|
136
149
|
<common_1.Icon5 name="envelope" size={14} color="ltBlack" style={styles.bottomButtonIcon}/>
|
|
137
150
|
<common_1.MyText fsize="xs" color="ltBlack">
|
|
138
|
-
|
|
151
|
+
{t("article.report")}
|
|
139
152
|
</common_1.MyText>
|
|
140
153
|
</common_1.PressAnimatedWrap>
|
|
141
154
|
</react_native_1.ScrollView>);
|
package/dist/page/CoinPage.js
CHANGED
|
@@ -64,7 +64,7 @@ const CoinPage = ({ navigation, comments = [], warningContent, }) => {
|
|
|
64
64
|
setLoading(true); // 処理開始
|
|
65
65
|
try {
|
|
66
66
|
console.log("購入処理開始: ", productId);
|
|
67
|
-
const purchase = yield (0, CoinFnc_1.handlePurchase)(productId);
|
|
67
|
+
const purchase = yield (0, CoinFnc_1.handlePurchase)(productId, t);
|
|
68
68
|
if (!purchase) {
|
|
69
69
|
console.warn("購入がキャンセルまたは失敗しました");
|
|
70
70
|
return;
|
|
@@ -100,7 +100,7 @@ const CoinPage = ({ navigation, comments = [], warningContent, }) => {
|
|
|
100
100
|
let receipts = null; // スコープを外に出す
|
|
101
101
|
try {
|
|
102
102
|
console.log("復元処理開始");
|
|
103
|
-
receipts = yield (0, CoinFnc_1.restorePurchases)(dispatch,
|
|
103
|
+
receipts = yield (0, CoinFnc_1.restorePurchases)(dispatch, t);
|
|
104
104
|
if (receipts) {
|
|
105
105
|
console.log("復元されたアイテム: ", receipts.length, "件");
|
|
106
106
|
receipts.forEach((receipt) => {
|
package/dist/page/FAQPage.js
CHANGED
|
@@ -36,8 +36,9 @@ const faqEn_1 = require("../component/FAQ/faqEn");
|
|
|
36
36
|
const react_redux_1 = require("react-redux");
|
|
37
37
|
const FAQPage = () => {
|
|
38
38
|
const [openIndexes, setOpenIndexes] = (0, react_1.useState)(new Set());
|
|
39
|
-
const { i18n } = (0, common_1.useDrillTranslation)();
|
|
40
|
-
|
|
39
|
+
const { t, i18n } = (0, common_1.useDrillTranslation)();
|
|
40
|
+
// 日本語と英語しか無いので、日本語以外は英語を出す
|
|
41
|
+
const faqDatas = (i18n === null || i18n === void 0 ? void 0 : i18n.language) === "ja" ? faqJa_1.faqJaDatas : faqEn_1.faqEnDatas;
|
|
41
42
|
const isJLPT = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem) === "JLPT";
|
|
42
43
|
const toggleCollapse = (groupIndex, questionIndex) => {
|
|
43
44
|
const uniqueKey = `${groupIndex}-${questionIndex}`;
|
|
@@ -52,7 +53,7 @@ const FAQPage = () => {
|
|
|
52
53
|
};
|
|
53
54
|
if (isJLPT) {
|
|
54
55
|
return (<react_native_1.View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
|
|
55
|
-
<common_1.MyText>
|
|
56
|
+
<common_1.MyText>{t("help.faqPreparing")}</common_1.MyText>
|
|
56
57
|
</react_native_1.View>);
|
|
57
58
|
}
|
|
58
59
|
return (<react_native_1.View style={styles.container}>
|
|
@@ -40,6 +40,7 @@ const common_1 = require("@nakamura-123/common");
|
|
|
40
40
|
const lib_1 = require("@nakamura-123/lib");
|
|
41
41
|
const GetBadgePage = ({ navigation }) => {
|
|
42
42
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
43
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
43
44
|
const imgs = (0, react_redux_1.useSelector)((state) => state.app.imgs);
|
|
44
45
|
const showCharactor = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.showCharactor; }) || false;
|
|
45
46
|
const notification = (0, react_redux_1.useSelector)((state) => state.score.notification);
|
|
@@ -73,9 +74,9 @@ const GetBadgePage = ({ navigation }) => {
|
|
|
73
74
|
});
|
|
74
75
|
return (<react_native_1.View style={styles.page}>
|
|
75
76
|
<Animatable.View ref={animatableRef} animation="fadeIn" duration={300} style={styles.card}>
|
|
76
|
-
<common_1.MyText fsize="xl">
|
|
77
|
+
<common_1.MyText fsize="xl">{t("grade.getBadge.congrats")}</common_1.MyText>
|
|
77
78
|
<common_1.MyText fsize="md" style={styles.txt}>
|
|
78
|
-
|
|
79
|
+
{t("grade.getBadge.title")}
|
|
79
80
|
</common_1.MyText>
|
|
80
81
|
|
|
81
82
|
{
|
|
@@ -88,8 +89,8 @@ const GetBadgePage = ({ navigation }) => {
|
|
|
88
89
|
</common_1.MyText>
|
|
89
90
|
</react_native_1.View>
|
|
90
91
|
<react_native_1.View style={styles.btnBox}>
|
|
91
|
-
<common_1.MiniIconBtn onPress={() => navigation.navigate("Badge")} icon="shield-alt" title="
|
|
92
|
-
<common_1.MiniIconBtn onPress={handleNext} icon="arrow-right" title="
|
|
92
|
+
<common_1.MiniIconBtn onPress={() => navigation.navigate("Badge")} icon="shield-alt" title={t("grade.getBadge.list")} color="ltBlack" outerStyle={styles.miniBtnOuter}/>
|
|
93
|
+
<common_1.MiniIconBtn onPress={handleNext} icon="arrow-right" title={t("grade.getBadge.next")} color="blue" outerStyle={styles.miniBtnOuter}/>
|
|
93
94
|
</react_native_1.View>
|
|
94
95
|
</Animatable.View>
|
|
95
96
|
</react_native_1.View>);
|