@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.
Files changed (119) hide show
  1. package/dist/component/Article/ArticleCategoryList.js +88 -33
  2. package/dist/component/Article/ArticleContentView.d.ts +1 -0
  3. package/dist/component/Article/ArticleContentView.js +56 -14
  4. package/dist/component/Article/ArticleRow.d.ts +3 -2
  5. package/dist/component/Article/ArticleRow.js +42 -16
  6. package/dist/component/Basic/BasicProgressBar.js +7 -5
  7. package/dist/component/Basic/MiniTestCard.js +15 -9
  8. package/dist/component/Basic/Paw5s.js +2 -1
  9. package/dist/component/Basic/SubCategoryList.js +13 -18
  10. package/dist/component/Coin/CoinCheck.js +1 -1
  11. package/dist/component/Coin/CoinFnc.d.ts +2 -2
  12. package/dist/component/Coin/CoinFnc.js +13 -11
  13. package/dist/component/Coin/WaitingPayBanner.js +2 -3
  14. package/dist/component/Grade/GAllTags.d.ts +3 -0
  15. package/dist/component/Grade/GAllTags.js +45 -0
  16. package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +7 -3
  17. package/dist/component/Grade/GradeCard/DatePickerModal.js +2 -1
  18. package/dist/component/Grade/GradeCard/Square3sGrade.js +1 -1
  19. package/dist/component/Grade/GradeCard/TargetDate.js +1 -1
  20. package/dist/component/Grade/QuizCntGraph.js +2 -1
  21. package/dist/component/Grade/Square4s.js +4 -4
  22. package/dist/component/Grade/UnitCircles.d.ts +4 -2
  23. package/dist/component/Grade/UnitCircles.js +6 -5
  24. package/dist/component/Grade/YearCircles.d.ts +4 -2
  25. package/dist/component/Grade/YearCircles.js +7 -5
  26. package/dist/component/KeyboardCloseBar.js +2 -1
  27. package/dist/component/QuizSet/QuizOptionDrill.js +3 -14
  28. package/dist/component/Result/QuizFlatList.js +161 -57
  29. package/dist/component/Result/ResultActions.d.ts +7 -0
  30. package/dist/component/Result/ResultActions.js +107 -0
  31. package/dist/component/Result/ResultHero.d.ts +7 -0
  32. package/dist/component/Result/ResultHero.js +166 -0
  33. package/dist/component/SettingBtns/LanguageModal.d.ts +9 -0
  34. package/dist/component/SettingBtns/LanguageModal.js +103 -0
  35. package/dist/component/SettingBtns/TransBtn.js +7 -84
  36. package/dist/component/Tag5s.js +2 -2
  37. package/dist/component/TagBadge5s.js +7 -5
  38. package/dist/component/TestPage/BarChartContainer.js +2 -1
  39. package/dist/component/TestPage/Square3s.js +3 -2
  40. package/dist/engine/components.d.ts +19 -0
  41. package/dist/engine/components.js +19 -0
  42. package/dist/engine/drill.d.ts +3 -0
  43. package/dist/engine/drill.js +24 -0
  44. package/dist/engine/grammar.d.ts +3 -0
  45. package/dist/engine/grammar.js +22 -0
  46. package/dist/engine/index.d.ts +5 -0
  47. package/dist/engine/index.js +17 -0
  48. package/dist/engine/tango.d.ts +3 -0
  49. package/dist/engine/tango.js +28 -0
  50. package/dist/engine/types.d.ts +46 -0
  51. package/dist/engine/types.js +2 -0
  52. package/dist/functions/createQuizFncG.d.ts +12 -0
  53. package/dist/functions/createQuizFncG.js +40 -0
  54. package/dist/functions/nextItemFnc.d.ts +12 -0
  55. package/dist/functions/nextItemFnc.js +56 -0
  56. package/dist/functions/questionFormatD.d.ts +1 -0
  57. package/dist/functions/questionFormatD.js +14 -13
  58. package/dist/functions/questionFormatG.d.ts +7 -0
  59. package/dist/functions/questionFormatG.js +31 -0
  60. package/dist/functions/retryQuizFnc.d.ts +1 -0
  61. package/dist/functions/retryQuizFnc.js +13 -0
  62. package/dist/functions/tagFncG.d.ts +5 -0
  63. package/dist/functions/tagFncG.js +24 -0
  64. package/dist/functions/tagFncJ.d.ts +2 -2
  65. package/dist/functions/tagFncJ.js +1 -1
  66. package/dist/hooks/BadgeHook.d.ts +1 -1
  67. package/dist/hooks/BadgeHook.js +3 -3
  68. package/dist/hooks/ExitQuizHook.js +9 -7
  69. package/dist/hooks/basicHook.d.ts +9 -1
  70. package/dist/hooks/basicHook.js +17 -8
  71. package/dist/hooks/quizActionHook.d.ts +3 -1
  72. package/dist/hooks/quizActionHook.js +33 -1
  73. package/dist/hooks/quizHook.d.ts +6 -2
  74. package/dist/hooks/quizHook.js +39 -4
  75. package/dist/hooks/resultHook.d.ts +10 -0
  76. package/dist/hooks/resultHook.js +85 -0
  77. package/dist/page/ArticleDetail.js +25 -12
  78. package/dist/page/CoinPage.js +2 -2
  79. package/dist/page/FAQPage.js +4 -3
  80. package/dist/page/GetBadgePage.js +5 -4
  81. package/dist/page/GradePage.js +6 -9
  82. package/dist/page/HistoryPage.js +7 -4
  83. package/dist/page/HomePage.js +7 -3
  84. package/dist/page/QuizPage.js +4 -4
  85. package/dist/page/QuizSettingPage.js +3 -6
  86. package/dist/page/QuizSetupPage.js +6 -14
  87. package/dist/page/ReportPage.js +1 -1
  88. package/dist/page/ResultPage.js +8 -25
  89. package/dist/page/SettingPage.js +36 -3
  90. package/dist/page/TestPage.js +7 -14
  91. package/dist/quiz/Title.js +5 -2
  92. package/dist/quiz/check/Check.js +11 -7
  93. package/dist/quiz/check/NextQuizBtn.js +3 -2
  94. package/dist/quiz/check/SelectTag.js +7 -0
  95. package/dist/quiz/common/MyTextqqyy.d.ts +1 -0
  96. package/dist/quiz/common/MyTextqqyy.js +2 -2
  97. package/dist/quiz/common/RenderImgOrText.d.ts +2 -0
  98. package/dist/quiz/common/RenderImgOrText.js +2 -2
  99. package/dist/quiz/common/RubyText.d.ts +3 -1
  100. package/dist/quiz/common/RubyText.js +20 -5
  101. package/dist/quiz/grammar/GAnswer.d.ts +8 -0
  102. package/dist/quiz/grammar/GAnswer.js +115 -0
  103. package/dist/quiz/grammar/GGuideBtn.d.ts +8 -0
  104. package/dist/quiz/grammar/GGuideBtn.js +43 -0
  105. package/dist/quiz/grammar/GQuestion.d.ts +8 -0
  106. package/dist/quiz/grammar/GQuestion.js +109 -0
  107. package/dist/quiz/grammar/QuizContentsGrammar.d.ts +10 -0
  108. package/dist/quiz/grammar/QuizContentsGrammar.js +31 -0
  109. package/dist/quiz/jAnswer/JAnswerContents.js +12 -5
  110. package/dist/quiz/jQuestion/JQuestionBottomText.d.ts +2 -1
  111. package/dist/quiz/jQuestion/JQuestionBottomText.js +3 -1
  112. package/dist/quiz/save/QuizSaveData.js +1 -1
  113. package/dist/quiz/setting/Above3BtnJ.js +5 -4
  114. package/dist/quiz/setting/Bottom3Btn.js +5 -4
  115. package/dist/quiz/setting/GuideBtn.js +3 -2
  116. package/dist/quiz/setting/RepeatBtn.js +2 -1
  117. package/dist/tsconfig.tsbuildinfo +1 -1
  118. package/dist/types/filterType.d.ts +2 -1
  119. package/package.json +23 -3
@@ -9,7 +9,7 @@ const MyTextqqyy_1 = __importDefault(require("./MyTextqqyy"));
9
9
  const react_redux_1 = require("react-redux");
10
10
  const lib_1 = require("@nakamura-123/lib");
11
11
  const common_1 = require("@nakamura-123/common");
12
- const RubyText = ({ fsize, cStyle, isNoWrap, children, }) => {
12
+ const RubyText = ({ fsize, cStyle, isNoWrap, udlMode = "underline", udlColor, children, }) => {
13
13
  const parsedText = lib_1.utilFnc.parseRubyText(children);
14
14
  let fontSize = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption.fsize);
15
15
  // const nextSize = getNextFontSize(fontSize);
@@ -18,7 +18,15 @@ const RubyText = ({ fsize, cStyle, isNoWrap, children, }) => {
18
18
  const flexWrap = isNoWrap ? "nowrap" : "wrap";
19
19
  const { bHeight, oHeight } = getLineHeight(fontSize);
20
20
  return (<react_native_1.View style={Object.assign(Object.assign({}, styles.lineWrap), { flexWrap })}>
21
- {parsedText.map((part, index) => part.ruby ? (<react_native_1.View key={index}>
21
+ {parsedText.map((part, index) => {
22
+ var _a;
23
+ // 空欄は udl[ ] のひとまとまりに1つだけ出す(ふりがなで部分が分かれていても)
24
+ if (udlMode === "blank" && part.udl) {
25
+ if ((_a = parsedText[index - 1]) === null || _a === void 0 ? void 0 : _a.udl)
26
+ return null;
27
+ return (<react_native_1.View key={index} style={Object.assign(Object.assign({}, styles.blank), { height: oHeight - 6 })}/>);
28
+ }
29
+ return part.ruby ? (<react_native_1.View key={index}>
22
30
  <react_native_1.Text key={index} style={Object.assign(Object.assign({}, styles.rubyWrapper), cStyle)}>
23
31
  <MyTextqqyy_1.default style={Object.assign({}, styles.ruby)} fsize="xs">
24
32
  {part.ruby}
@@ -28,13 +36,14 @@ const RubyText = ({ fsize, cStyle, isNoWrap, children, }) => {
28
36
  {part.base}
29
37
  </MyTextqqyy_1.default>
30
38
  </react_native_1.Text>
31
- {part.udl && <common_1.UnderLine />}
39
+ {part.udl && <common_1.UnderLine color={udlColor}/>}
32
40
  </react_native_1.View>) : (<react_native_1.View key={index}>
33
41
  <MyTextqqyy_1.default style={Object.assign(Object.assign({}, styles.onlyBase), { lineHeight: oHeight })} fsize={fontSize}>
34
42
  {part.base}
35
43
  </MyTextqqyy_1.default>
36
- {part.udl && <common_1.UnderLine />}
37
- </react_native_1.View>))}
44
+ {part.udl && <common_1.UnderLine color={udlColor}/>}
45
+ </react_native_1.View>);
46
+ })}
38
47
  </react_native_1.View>);
39
48
  };
40
49
  // LineHeightを算出し、返す
@@ -67,6 +76,12 @@ const styles = react_native_1.StyleSheet.create({
67
76
  lineHeight: 20,
68
77
  textAlign: "center",
69
78
  },
79
+ blank: {
80
+ minWidth: 80,
81
+ marginHorizontal: 3,
82
+ borderBottomWidth: 2,
83
+ borderBottomColor: lib_1.colors.text,
84
+ },
70
85
  onlyBase: {
71
86
  lineHeight: 35,
72
87
  margin: 0,
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { StackNavigationProp } from "@react-navigation/stack";
3
+ import { Nav } from "@nakamura-123/types";
4
+ type Prop = {
5
+ navigation: StackNavigationProp<Nav.RootStackParamList>;
6
+ };
7
+ declare const GAnswer: React.FC<Prop>;
8
+ export default GAnswer;
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const react_redux_1 = require("react-redux");
9
+ const common_1 = require("@nakamura-123/common");
10
+ const lib_1 = require("@nakamura-123/lib");
11
+ const stores_1 = require("@nakamura-123/stores");
12
+ const JAnswerContents_1 = __importDefault(require("../jAnswer/JAnswerContents"));
13
+ const GGuideBtn_1 = __importDefault(require("./GGuideBtn"));
14
+ const getChoiceStyle_1 = require("../answer/styles/getChoiceStyle");
15
+ const quizHook_1 = require("../../hooks/quizHook");
16
+ const quizActionHook_1 = require("../../hooks/quizActionHook");
17
+ const GAnswer = ({ navigation }) => {
18
+ const dispatch = (0, react_redux_1.useDispatch)();
19
+ const { t } = (0, common_1.useDrillTranslation)();
20
+ const pawIcon = (0, common_1.usePawIcon)();
21
+ const question = (0, quizHook_1.useQuestionDataG)();
22
+ const mode = (0, quizHook_1.useGetMode)();
23
+ const handleAnswer = (0, quizActionHook_1.useAnswerGrammarAction)();
24
+ const { isDoublePress } = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
25
+ const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
26
+ if (!question)
27
+ return null;
28
+ // 穴埋め:単語と同じ4択。答えたら変えられない
29
+ if (question.form === "blank") {
30
+ const { choices, selectedIndexes } = question;
31
+ const handleChoice = (i) => {
32
+ if (mode !== "quiz")
33
+ return;
34
+ dispatch(stores_1.quizAction.replaceSelectedIndex([i]));
35
+ handleAnswer(choices[i].isCorrect);
36
+ };
37
+ const wordAndColors = choices.map(({ choice, isCorrect }, i) => ({
38
+ word: choice,
39
+ color: (0, getChoiceStyle_1.getChoiceOutlineColor)(selectedIndexes, mode, isCorrect, i),
40
+ }));
41
+ return (<react_native_1.View>
42
+ <react_native_1.View style={styles.btnRow}>
43
+ <GGuideBtn_1.default navigation={navigation}/>
44
+ </react_native_1.View>
45
+ <JAnswerContents_1.default wordAndColors={wordAndColors} isDoublePress={isDoublePress} handleChoice={handleChoice} isNotSearch={true} navigation={navigation} isCorrected={question.isCorrected === false ? false : null}/>
46
+ </react_native_1.View>);
47
+ }
48
+ // 意味を取る問題:わかった/わからなかった。今解いている問題なら、答えたあとも押し直せる
49
+ const canAnswer = mode === "quiz" || (mode === "check" && turn === activeTurn);
50
+ const cards = [
51
+ { ok: true, label: t("quiz.result.understood"), color: "red" },
52
+ {
53
+ ok: false,
54
+ label: t("quiz.grammar.notUnderstood"),
55
+ color: "blue",
56
+ },
57
+ ];
58
+ return (<react_native_1.View>
59
+ <react_native_1.View style={styles.btnRow}>
60
+ <GGuideBtn_1.default navigation={navigation}/>
61
+ </react_native_1.View>
62
+ <react_native_1.View style={styles.container}>
63
+ {cards.map(({ ok, label, color }) => {
64
+ const isOn = mode !== "quiz" && question.isCorrected === ok;
65
+ return (<common_1.DoubleTapWrapper key={label} onPress={() => canAnswer && handleAnswer(ok)} isDoublePress={isDoublePress}>
66
+ <react_native_1.View style={Object.assign(Object.assign({}, styles.choice), { borderColor: isOn ? lib_1.colors[color] : lib_1.colors.light })}>
67
+ {isOn && ok && (<react_native_1.View style={styles.maruBox}>
68
+ <common_1.IconInCircle name="check" size={15} iconColor="green" cStyle={{ width: 25, height: 25 }}/>
69
+ </react_native_1.View>)}
70
+ {isOn && (<common_1.BoundText color={color}>
71
+ {ok ? t("quiz.result.understood") : t("quiz.grammar.again")}
72
+ <common_1.Icon5 name={pawIcon} size={15} color={color}/>
73
+ </common_1.BoundText>)}
74
+ <common_1.MyText>{label}</common_1.MyText>
75
+ </react_native_1.View>
76
+ </common_1.DoubleTapWrapper>);
77
+ })}
78
+ </react_native_1.View>
79
+ </react_native_1.View>);
80
+ };
81
+ const styles = react_native_1.StyleSheet.create({
82
+ // 単語の問題画面の Repeat・Search・Guide の段と同じ位置。音声(Repeat)は段7で足す
83
+ btnRow: {
84
+ flexDirection: "row",
85
+ marginHorizontal: 10,
86
+ minHeight: 40,
87
+ },
88
+ container: {
89
+ justifyContent: "space-between",
90
+ flexDirection: "row",
91
+ marginHorizontal: 5,
92
+ marginBottom: 60,
93
+ },
94
+ maruBox: {
95
+ position: "absolute",
96
+ top: 3,
97
+ left: 3,
98
+ zIndex: 1,
99
+ borderRadius: 10,
100
+ backgroundColor: lib_1.colors.bkBeige,
101
+ justifyContent: "center",
102
+ alignItems: "center",
103
+ },
104
+ choice: {
105
+ position: "relative",
106
+ backgroundColor: lib_1.colors.bkBeige,
107
+ justifyContent: "center",
108
+ alignItems: "center",
109
+ width: "49.8%",
110
+ aspectRatio: 3 / 2,
111
+ borderRadius: 5,
112
+ borderWidth: 2,
113
+ },
114
+ });
115
+ exports.default = GAnswer;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { StackNavigationProp } from "@react-navigation/stack";
3
+ import { Nav } from "@nakamura-123/types";
4
+ type Props = {
5
+ navigation: StackNavigationProp<Nav.RootStackParamList>;
6
+ };
7
+ declare const GGuideBtn: React.FC<Props>;
8
+ export default GGuideBtn;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const react_redux_1 = require("react-redux");
9
+ const common_1 = require("@nakamura-123/common");
10
+ const quizHook_1 = require("../../hooks/quizHook");
11
+ const articleListFnc_1 = require("../../functions/articleListFnc");
12
+ // 答えたあとに、その文法の説明(Lesson)を問題の上に開く。説明のkeyは文法番号
13
+ const GGuideBtn = ({ navigation }) => {
14
+ const { t } = (0, common_1.useDrillTranslation)();
15
+ const question = (0, quizHook_1.useQuestionDataG)();
16
+ const mode = (0, quizHook_1.useGetMode)();
17
+ const unitList = (0, react_redux_1.useSelector)((state) => state.app.unitList);
18
+ const articleContents = (0, react_redux_1.useSelector)((state) => state.app.articleContents);
19
+ if (!question || mode === "quiz")
20
+ return <react_native_1.View />;
21
+ const articleId = (0, articleListFnc_1.getArticleId)(question.grammarId);
22
+ if (!articleContents[articleId])
23
+ return <react_native_1.View />;
24
+ const chapter = unitList.find((u) => u.sub.some((s) => s.key === question.grammarId));
25
+ const btn = {
26
+ icon: "book",
27
+ text: t("quiz.bottom.guide"),
28
+ onPress: () => {
29
+ var _a;
30
+ return navigation.navigate("ArticleDetail", {
31
+ subject: "basic1",
32
+ chapterKey: (_a = chapter === null || chapter === void 0 ? void 0 : chapter.key) !== null && _a !== void 0 ? _a : 0,
33
+ articleId,
34
+ title: question.grammar,
35
+ isGuide: true,
36
+ });
37
+ },
38
+ };
39
+ return (<react_native_1.View style={{ marginLeft: "auto" }}>
40
+ <common_1.IconTextBtn btn={btn}/>
41
+ </react_native_1.View>);
42
+ };
43
+ exports.default = GGuideBtn;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { StackNavigationProp } from "@react-navigation/stack";
3
+ import { Nav } from "@nakamura-123/types";
4
+ type Props = {
5
+ navigation: StackNavigationProp<Nav.RootStackParamList>;
6
+ };
7
+ declare const GQuestion: React.FC<Props>;
8
+ export default GQuestion;
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_1 = __importStar(require("react"));
30
+ const react_native_1 = require("react-native");
31
+ const lib_1 = require("@nakamura-123/lib");
32
+ const common_1 = require("@nakamura-123/common");
33
+ const QuizCnt_1 = __importDefault(require("../jQuestion/QuizCnt"));
34
+ const RubyText_1 = __importDefault(require("../common/RubyText"));
35
+ const Above3BtnJ_1 = __importDefault(require("../setting/Above3BtnJ"));
36
+ const quizHook_1 = require("../../hooks/quizHook");
37
+ // 例文と訳。意味を取る問題は文法の部分に下線を引き、答える前でもタップで訳を見られる。
38
+ // 穴埋めは答える前は文法の部分を空欄にし、答えたら埋めて訳を出す
39
+ const GQuestion = ({ navigation }) => {
40
+ const { t } = (0, common_1.useDrillTranslation)();
41
+ const question = (0, quizHook_1.useQuestionDataG)();
42
+ const mode = (0, quizHook_1.useGetMode)();
43
+ const trans = (0, quizHook_1.useGrammarTrans)(question === null || question === void 0 ? void 0 : question.quizId);
44
+ // 訳を見た問題。問題が替わったら閉じる
45
+ const [peekId, setPeekId] = (0, react_1.useState)(null);
46
+ if (!question)
47
+ return null;
48
+ const isQuiz = mode === "quiz";
49
+ const isBlank = question.form === "blank";
50
+ const isPeek = peekId === question.quizId;
51
+ const showTrans = !isQuiz || (!isBlank && isPeek);
52
+ return (<react_native_1.View>
53
+ <react_native_1.View style={styles.container}>
54
+ <QuizCnt_1.default />
55
+ <react_native_1.View style={styles.sentence}>
56
+ <RubyText_1.default udlMode={isBlank && isQuiz ? "blank" : "underline"} udlColor={isBlank ? "red" : "blue"}>
57
+ {question.sentence}
58
+ </RubyText_1.default>
59
+ </react_native_1.View>
60
+ <react_native_1.View style={styles.bottom}>
61
+ {showTrans && trans && (<common_1.MyText fsize="sm" style={styles.trans}>
62
+ {trans}
63
+ </common_1.MyText>)}
64
+ {isQuiz && !isBlank && !isPeek && (<react_native_1.Pressable style={styles.peek} onPress={() => setPeekId(question.quizId)}>
65
+ <common_1.MyText fsize="xs" color="ltBlack">
66
+ <common_1.Icon5 name="eye" size={12} color="ltBlack"/>{" "}
67
+ {t("article.tapToShowTrans")}
68
+ </common_1.MyText>
69
+ </react_native_1.Pressable>)}
70
+ {mode === "check" && !isBlank && (<common_1.MyText fsize="xs" color="ltBlack" style={styles.note}>
71
+ {t("quiz.grammar.canChange")}
72
+ </common_1.MyText>)}
73
+ </react_native_1.View>
74
+ </react_native_1.View>
75
+ <Above3BtnJ_1.default navigation={navigation}/>
76
+ </react_native_1.View>);
77
+ };
78
+ const styles = react_native_1.StyleSheet.create({
79
+ container: {
80
+ backgroundColor: lib_1.colors.bkBeige,
81
+ alignItems: "center",
82
+ minHeight: 270,
83
+ paddingHorizontal: 15,
84
+ paddingBottom: 10,
85
+ },
86
+ sentence: {
87
+ minHeight: 110,
88
+ justifyContent: "center",
89
+ },
90
+ bottom: {
91
+ alignItems: "center",
92
+ },
93
+ trans: {
94
+ textAlign: "center",
95
+ },
96
+ peek: {
97
+ marginTop: 8,
98
+ paddingVertical: 5,
99
+ paddingHorizontal: 14,
100
+ borderWidth: 1,
101
+ borderStyle: "dashed",
102
+ borderColor: lib_1.colors.ltBlack,
103
+ borderRadius: 16,
104
+ },
105
+ note: {
106
+ marginTop: 4,
107
+ },
108
+ });
109
+ exports.default = GQuestion;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { Store } from "@nakamura-123/types";
3
+ interface Props {
4
+ navigation: any;
5
+ guideName: keyof Store.GuideType;
6
+ showSwipe1Guide: boolean;
7
+ showSwipe2Guide: boolean;
8
+ }
9
+ declare const QuizContentsGrammar: React.FC<Props>;
10
+ export default QuizContentsGrammar;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const react_1 = __importDefault(require("react"));
7
+ const react_native_1 = require("react-native");
8
+ const Guide_1 = __importDefault(require("../../component/Guide"));
9
+ const PageContainerWrap_1 = __importDefault(require("../common/PageContainerWrap"));
10
+ const GQuestion_1 = __importDefault(require("./GQuestion"));
11
+ const GAnswer_1 = __importDefault(require("./GAnswer"));
12
+ // 文法(G系)の問題画面。形は単語(QuizContentsJLPT)にそろえる
13
+ const QuizContentsGrammar = ({ navigation, guideName, showSwipe1Guide, showSwipe2Guide, }) => {
14
+ return (<PageContainerWrap_1.default scrollViewRef={null} navigation={navigation}>
15
+ <Guide_1.default name={guideName} isVisible={showSwipe1Guide || showSwipe2Guide}>
16
+ <react_native_1.View></react_native_1.View>
17
+ </Guide_1.default>
18
+ <react_native_1.View style={styles.container}>
19
+ <GQuestion_1.default navigation={navigation}/>
20
+ <GAnswer_1.default navigation={navigation}/>
21
+ </react_native_1.View>
22
+ <></>
23
+ </PageContainerWrap_1.default>);
24
+ };
25
+ const styles = react_native_1.StyleSheet.create({
26
+ container: {
27
+ flex: 1,
28
+ justifyContent: "space-between",
29
+ },
30
+ });
31
+ exports.default = QuizContentsGrammar;
@@ -11,6 +11,8 @@ const lib_1 = require("@nakamura-123/lib");
11
11
  const RepeatBtn_1 = __importDefault(require("../setting/RepeatBtn"));
12
12
  const GuideBtn_1 = __importDefault(require("../setting/GuideBtn"));
13
13
  const JAnswerContents = ({ wordAndColors, isDoublePress, handleChoice, isNotSearch, navigation, isCorrected, }) => {
14
+ const { t } = (0, common_1.useDrillTranslation)();
15
+ const pawIcon = (0, common_1.usePawIcon)();
14
16
  return (<react_native_1.View>
15
17
  <react_native_1.View style={styles.bottomBtnBox}>
16
18
  <RepeatBtn_1.default isPreLoad={true}/>
@@ -24,15 +26,15 @@ const JAnswerContents = ({ wordAndColors, isDoublePress, handleChoice, isNotSear
24
26
  <common_1.IconInCircle name="check" size={15} iconColor="green" cStyle={{ width: 25, height: 25 }}/>
25
27
  </react_native_1.View>
26
28
  <common_1.BoundText color="red">
27
- せいかい
28
- <common_1.Icon5 name="paw" size={15} color="red"/>
29
+ {t("quiz.judge.correct")}
30
+ <common_1.Icon5 name={pawIcon} size={15} color="red"/>
29
31
  </common_1.BoundText>
30
32
  </>)}
31
33
  {color === "blue" && isCorrected === false && (<common_1.BoundText color="blue">
32
- まちがい
33
- <common_1.Icon5 name="paw" size={15} color="blue"/>
34
+ {t("quiz.judge.wrong")}
35
+ <common_1.Icon5 name={pawIcon} size={15} color="blue"/>
34
36
  </common_1.BoundText>)}
35
- <RenderImgOrText_1.default word={word} isNotSearch={isNotSearch}/>
37
+ <RenderImgOrText_1.default word={word} isNotSearch={isNotSearch} textStyle={styles.choiceText}/>
36
38
  </react_native_1.View>
37
39
  </common_1.DoubleTapWrapper>))}
38
40
  </react_native_1.View>
@@ -70,8 +72,13 @@ const styles = react_native_1.StyleSheet.create({
70
72
  width: "49.8%",
71
73
  aspectRatio: 3 / 2,
72
74
  marginBottom: 5,
75
+ paddingHorizontal: 6,
73
76
  borderRadius: 5,
74
77
  borderWidth: 2,
75
78
  },
79
+ // 長い選択肢(文法の穴埋めの「〜か〜ないかのうちに」など)が2行に折れても左に寄らないように
80
+ choiceText: {
81
+ textAlign: "center",
82
+ },
76
83
  });
77
84
  exports.default = JAnswerContents;
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- import { JStore } from "@nakamura-123/types";
2
+ import { JStore, QSelected } from "@nakamura-123/types";
3
3
  type Prop = {
4
4
  question: JStore.JQInStore | null;
5
5
  };
6
6
  declare const JQuestionBottomText: React.FC<Prop>;
7
+ export declare const getAnswerText: (question: JStore.JQInStore | null, form: QSelected.JForm | undefined) => string;
7
8
  export default JQuestionBottomText;
@@ -3,6 +3,7 @@ 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.getAnswerText = void 0;
6
7
  const react_1 = __importDefault(require("react"));
7
8
  const react_native_1 = require("react-native");
8
9
  const quizHook_1 = require("../../hooks/quizHook");
@@ -10,7 +11,7 @@ const RubyText_1 = __importDefault(require("../common/RubyText"));
10
11
  const JQuestionBottomText = ({ question }) => {
11
12
  const mode = (0, quizHook_1.useGetMode)();
12
13
  const form = question === null || question === void 0 ? void 0 : question.form;
13
- const answerText = getAnswerText(question, form);
14
+ const answerText = (0, exports.getAnswerText)(question, form);
14
15
  if (mode === "quiz")
15
16
  return null;
16
17
  return (<react_native_1.View style={styles.container}>
@@ -32,6 +33,7 @@ const getAnswerText = (question, form) => {
32
33
  return jpWord;
33
34
  return enWord; // fallback
34
35
  };
36
+ exports.getAnswerText = getAnswerText;
35
37
  const styles = react_native_1.StyleSheet.create({
36
38
  container: {
37
39
  padding: 10,
@@ -95,7 +95,7 @@ const QuizSaveData = ({ navigation, saveKey }) => {
95
95
  if (!isExistedSaveData)
96
96
  return null;
97
97
  const title = t("quiz.continue.title");
98
- const note = `【${lessonTitle}】${turn + 1}${t("quiz.continue.note")}`;
98
+ const note = `【${lessonTitle}】${t("quiz.continue.note", { n: turn + 1 })}`;
99
99
  const onPress = () => {
100
100
  navigation.navigate("Quiz");
101
101
  };
@@ -11,6 +11,7 @@ const stores_1 = require("@nakamura-123/stores");
11
11
  const quizHook_1 = require("../../hooks/quizHook");
12
12
  const quizActionHook_1 = require("../../hooks/quizActionHook");
13
13
  const Bottom3BtnJ = ({ navigation }) => {
14
+ const { t } = (0, common_1.useDrillTranslation)();
14
15
  const dispatch = (0, react_redux_1.useDispatch)();
15
16
  const mode = (0, quizHook_1.useGetMode)();
16
17
  const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
@@ -18,13 +19,13 @@ const Bottom3BtnJ = ({ navigation }) => {
18
19
  const isActiveTurn = turn === activeTurn;
19
20
  const btnList = [
20
21
  // 1つ目
21
- createBtnInfo("arrow-left", "Back", () => dispatch(stores_1.quizAction.beforeTurn())),
22
+ createBtnInfo("arrow-left", t("quiz.bottom.back"), () => dispatch(stores_1.quizAction.beforeTurn())),
22
23
  // 2つ目
23
- createBtnInfo("envelope", "Mail", () => navigation.navigate("Report")),
24
+ createBtnInfo("envelope", t("quiz.bottom.report"), () => navigation.navigate("Report")),
24
25
  // 3つ目 quizなら「パス」、checkなら「次へ」
25
26
  mode === "quiz"
26
- ? createBtnInfo("arrow-right", "Skip", () => dispatch(stores_1.quizAction.changeMode("check")))
27
- : createBtnInfo("arrow-right", "Next", () => {
27
+ ? createBtnInfo("arrow-right", t("quiz.bottom.pass"), () => dispatch(stores_1.quizAction.changeMode("check")))
28
+ : createBtnInfo("arrow-right", t("quiz.bottom.next"), () => {
28
29
  if (mode === "result" || !isActiveTurn)
29
30
  dispatch(stores_1.quizAction.nextTurn());
30
31
  else
@@ -12,19 +12,20 @@ const quizHook_1 = require("../../hooks/quizHook");
12
12
  const quizActionHook_1 = require("../../hooks/quizActionHook");
13
13
  const NextQuiz = ({ navigation }) => {
14
14
  const dispatch = (0, react_redux_1.useDispatch)();
15
+ const { t } = (0, common_1.useDrillTranslation)();
15
16
  const mode = (0, quizHook_1.useGetMode)();
16
17
  const nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
17
18
  const { turn, activeTurn } = (0, react_redux_1.useSelector)((state) => state.quiz.currentInfo.state);
18
19
  const isActiveTurn = turn === activeTurn;
19
20
  const btnList = [
20
21
  // 1つ目
21
- createBtnInfo("arrow-left", "戻る", () => dispatch(stores_1.quizAction.beforeTurn())),
22
+ createBtnInfo("arrow-left", t("quiz.bottom.back"), () => dispatch(stores_1.quizAction.beforeTurn())),
22
23
  // 2つ目
23
- createBtnInfo("envelope", "報告", () => navigation.navigate("Report")),
24
+ createBtnInfo("envelope", t("quiz.bottom.report"), () => navigation.navigate("Report")),
24
25
  // 3つ目 quizなら「パス」、checkなら「次へ」
25
26
  mode === "quiz"
26
- ? createBtnInfo("question-circle", "パス", () => dispatch(stores_1.quizAction.changeMode("check")))
27
- : createBtnInfo("arrow-right", "次へ", () => {
27
+ ? createBtnInfo("question-circle", t("quiz.bottom.pass"), () => dispatch(stores_1.quizAction.changeMode("check")))
28
+ : createBtnInfo("arrow-right", t("quiz.bottom.next"), () => {
28
29
  if (mode === "result" || !isActiveTurn)
29
30
  dispatch(stores_1.quizAction.nextTurn());
30
31
  else
@@ -9,6 +9,7 @@ const common_1 = require("@nakamura-123/common");
9
9
  const quizHook_1 = require("../../hooks/quizHook");
10
10
  const lib_1 = require("@nakamura-123/lib");
11
11
  const GuideBtn = ({ navigation }) => {
12
+ const { t } = (0, common_1.useDrillTranslation)();
12
13
  const question = (0, quizHook_1.useQuestionDataJ)();
13
14
  const mode = (0, quizHook_1.useGetMode)();
14
15
  if (mode === "quiz")
@@ -19,12 +20,12 @@ const GuideBtn = ({ navigation }) => {
19
20
  const quizType = question.form === "basicSelImg" || question.form === "listenSelImg"
20
21
  ? "jpSentence"
21
22
  : "jpWord";
22
- const searchBtn = createBtnInfo("search", "Search", () => {
23
+ const searchBtn = createBtnInfo("search", t("quiz.bottom.search"), () => {
23
24
  const searchWord = lib_1.utilFnc.parseRubyText(question[quizType]);
24
25
  const removeRuby = lib_1.utilFnc.removeRuby(searchWord);
25
26
  lib_1.utilFnc.handleSearchTrans(removeRuby);
26
27
  });
27
- const guideBtn = createBtnInfo("book", "Guide", () => navigation.navigate("Guide", { quizId: quizId }));
28
+ const guideBtn = createBtnInfo("book", t("quiz.bottom.guide"), () => navigation.navigate("Guide", { quizId: quizId }));
28
29
  return (<react_native_1.View style={{ flexDirection: "row", alignItems: "center" }}>
29
30
  <common_1.IconTextBtn btn={searchBtn} style={{ marginLeft: "auto" }} key={searchBtn.text}/>
30
31
  <common_1.IconTextBtn btn={guideBtn} key={guideBtn.text}/>
@@ -31,6 +31,7 @@ const common_1 = require("@nakamura-123/common");
31
31
  const quizHook_1 = require("../../hooks/quizHook");
32
32
  const react_redux_2 = require("react-redux");
33
33
  const RepeatBtn = ({ isPreLoad }) => {
34
+ const { t } = (0, common_1.useDrillTranslation)();
34
35
  const dispatch = (0, react_redux_1.useDispatch)();
35
36
  const question = (0, quizHook_1.useQuestionDataJ)();
36
37
  const quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
@@ -61,7 +62,7 @@ const RepeatBtn = ({ isPreLoad }) => {
61
62
  }, [quizId]);
62
63
  if (!voice)
63
64
  return <react_native_1.View></react_native_1.View>; // voiceがnullの場合は何も表示しない
64
- const btn = createBtnInfo("volume-up", "Repeat", () => lib_1.voiceFnc.playVoice(voice, voiceVolume));
65
+ const btn = createBtnInfo("volume-up", t("quiz.bottom.repeat"), () => lib_1.voiceFnc.playVoice(voice, voiceVolume));
65
66
  return (<common_1.IconTextBtn btn={btn} style={{ marginRight: "auto" }} key={btn.text}/> // IconTextBtnを使用
66
67
  );
67
68
  };