@nakamura-123/pages 0.1.21 → 0.1.22

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 (126) hide show
  1. package/dist/component/Basic/BasicContents.js +3 -1
  2. package/dist/component/Basic/MiniTestCard.js +11 -3
  3. package/dist/component/Basic/SelectedExamCnt.js +3 -0
  4. package/dist/component/Basic/SubCategoryList.d.ts +1 -1
  5. package/dist/component/Basic/SubCategoryList.js +28 -19
  6. package/dist/component/Grade/AllTags.d.ts +2 -2
  7. package/dist/component/Grade/AllTags.js +2 -2
  8. package/dist/component/Grade/JAllTags.d.ts +5 -0
  9. package/dist/component/Grade/JAllTags.js +45 -0
  10. package/dist/component/QuizSet/QuizOptionDrill.d.ts +2 -2
  11. package/dist/component/QuizSet/QuizOptionDrill.js +9 -5
  12. package/dist/component/Result/QuizFlatList.js +20 -7
  13. package/dist/component/SettingBtns/TransBtn.d.ts +4 -0
  14. package/dist/component/SettingBtns/TransBtn.js +119 -0
  15. package/dist/component/Tag5s.js +2 -2
  16. package/dist/component/TagBadge5s.js +14 -33
  17. package/dist/component/TagBadge5sPress.js +2 -2
  18. package/dist/functions/commonFilter.d.ts +0 -0
  19. package/dist/functions/commonFilter.js +12 -0
  20. package/dist/functions/createQuizFnc.d.ts +6 -13
  21. package/dist/functions/createQuizFnc.js +18 -18
  22. package/dist/functions/createQuizFncD.d.ts +18 -0
  23. package/dist/functions/createQuizFncD.js +80 -0
  24. package/dist/functions/createQuizFncJ.d.ts +9 -0
  25. package/dist/functions/createQuizFncJ.js +63 -0
  26. package/dist/functions/questionFilter.d.ts +1 -3
  27. package/dist/functions/questionFilterD.d.ts +14 -0
  28. package/dist/functions/questionFilterD.js +79 -0
  29. package/dist/functions/questionFilterJ.d.ts +10 -0
  30. package/dist/functions/questionFilterJ.js +36 -0
  31. package/dist/functions/questionFilterJLPT.d.ts +5 -0
  32. package/dist/functions/questionFilterJLPT.js +17 -0
  33. package/dist/functions/questionFormat copy.d.ts +7 -0
  34. package/dist/functions/questionFormat copy.js +103 -0
  35. package/dist/functions/questionFormat.d.ts +2 -2
  36. package/dist/functions/questionFormatD.d.ts +7 -0
  37. package/dist/functions/questionFormatD.js +104 -0
  38. package/dist/functions/questionFormatJ.d.ts +8 -0
  39. package/dist/functions/questionFormatJ.js +95 -0
  40. package/dist/functions/tagFnc.js +14 -14
  41. package/dist/functions/tagFncD.d.ts +18 -0
  42. package/dist/functions/tagFncD.js +114 -0
  43. package/dist/functions/tagFncJ.d.ts +7 -0
  44. package/dist/functions/tagFncJ.js +44 -0
  45. package/dist/functions/tagFncJLPT.d.ts +5 -0
  46. package/dist/functions/tagFncJLPT.js +18 -0
  47. package/dist/hooks/basicHook.d.ts +3 -0
  48. package/dist/hooks/basicHook.js +20 -1
  49. package/dist/hooks/quizActionHook.d.ts +3 -3
  50. package/dist/hooks/quizActionHook.js +22 -5
  51. package/dist/hooks/quizHook.d.ts +9 -2
  52. package/dist/hooks/quizHook.js +51 -5
  53. package/dist/index.d.ts +4 -1
  54. package/dist/index.js +7 -1
  55. package/dist/page/BootPage.js +6 -6
  56. package/dist/page/DatailSettingPage.d.ts +3 -0
  57. package/dist/page/DatailSettingPage.js +25 -0
  58. package/dist/page/GetBadgePage.js +1 -1
  59. package/dist/page/GradePage.js +5 -2
  60. package/dist/page/GuidePage.d.ts +10 -0
  61. package/dist/page/GuidePage.js +112 -0
  62. package/dist/page/JDatailSettingPage.d.ts +3 -0
  63. package/dist/page/JDatailSettingPage.js +25 -0
  64. package/dist/page/JDetailSettingPage.d.ts +3 -0
  65. package/dist/page/JDetailSettingPage.js +51 -0
  66. package/dist/page/QuizPage.js +15 -69
  67. package/dist/page/QuizSetupPage.js +20 -8
  68. package/dist/page/ReportPage.js +1 -1
  69. package/dist/page/TestPage.js +15 -5
  70. package/dist/quiz/QuizContentDrill.d.ts +15 -0
  71. package/dist/quiz/QuizContentDrill.js +34 -0
  72. package/dist/quiz/QuizContentsDrill.d.ts +16 -0
  73. package/dist/quiz/QuizContentsDrill.js +70 -0
  74. package/dist/quiz/QuizContentsJLPT.d.ts +16 -0
  75. package/dist/quiz/QuizContentsJLPT.js +31 -0
  76. package/dist/quiz/Title.js +3 -1
  77. package/dist/quiz/answer/Answer.js +7 -6
  78. package/dist/quiz/answer/BlankBtn.js +7 -2
  79. package/dist/quiz/answer/Input/InputAnswerBtn.js +1 -1
  80. package/dist/quiz/answer/MultiChoice.js +2 -0
  81. package/dist/quiz/answer/NormalChoice.js +1 -1
  82. package/dist/quiz/check/NextQuizBtn.js +1 -0
  83. package/dist/quiz/check/SelectTag.js +21 -5
  84. package/dist/quiz/common/MyTextqqyy.js +1 -2
  85. package/dist/quiz/common/PageContainerWrap.d.ts +1 -1
  86. package/dist/quiz/common/RenderImgOrText.d.ts +4 -4
  87. package/dist/quiz/common/RenderImgOrText.js +7 -3
  88. package/dist/quiz/common/RubyText.d.ts +6 -1
  89. package/dist/quiz/common/RubyText.js +58 -39
  90. package/dist/quiz/common/ZoomableImage.d.ts +1 -0
  91. package/dist/quiz/common/ZoomableImage.js +2 -2
  92. package/dist/quiz/explain/Explain.js +4 -2
  93. package/dist/quiz/jAnswer/JAnswer.d.ts +8 -0
  94. package/dist/quiz/jAnswer/JAnswer.js +57 -0
  95. package/dist/quiz/jAnswer/JAnswerContents.d.ts +16 -0
  96. package/dist/quiz/jAnswer/JAnswerContents.js +82 -0
  97. package/dist/quiz/jQuestion/JQuestion.d.ts +8 -0
  98. package/dist/quiz/jQuestion/JQuestion.js +41 -0
  99. package/dist/quiz/jQuestion/JQuestionBottomText.d.ts +7 -0
  100. package/dist/quiz/jQuestion/JQuestionBottomText.js +46 -0
  101. package/dist/quiz/jQuestion/JQuestionText.d.ts +7 -0
  102. package/dist/quiz/jQuestion/JQuestionText.js +43 -0
  103. package/dist/quiz/jQuestion/QuizCnt.d.ts +3 -0
  104. package/dist/quiz/jQuestion/QuizCnt.js +44 -0
  105. package/dist/quiz/jQuestion/TimeLimit.d.ts +6 -0
  106. package/dist/quiz/jQuestion/TimeLimit.js +97 -0
  107. package/dist/quiz/question/Question.js +3 -1
  108. package/dist/quiz/setting/Above3BtnJ copy.d.ts +8 -0
  109. package/dist/quiz/setting/Above3BtnJ copy.js +78 -0
  110. package/dist/quiz/setting/Above3BtnJ.d.ts +8 -0
  111. package/dist/quiz/setting/Above3BtnJ.js +56 -0
  112. package/dist/quiz/setting/Bottom2BtnJ.d.ts +8 -0
  113. package/dist/quiz/setting/Bottom2BtnJ.js +86 -0
  114. package/dist/quiz/setting/Bottom3Btn.js +1 -23
  115. package/dist/quiz/setting/Bottom3BtnJ.d.ts +8 -0
  116. package/dist/quiz/setting/Bottom3BtnJ.js +78 -0
  117. package/dist/quiz/setting/GuideBtn.d.ts +8 -0
  118. package/dist/quiz/setting/GuideBtn.js +38 -0
  119. package/dist/quiz/setting/RepeatBtn.d.ts +6 -0
  120. package/dist/quiz/setting/RepeatBtn.js +77 -0
  121. package/dist/quiz/system/QuizContentDrill.d.ts +0 -0
  122. package/dist/quiz/system/QuizContentDrill.js +1 -0
  123. package/dist/tsconfig.tsbuildinfo +1 -1
  124. package/dist/types/filterType.d.ts +15 -0
  125. package/dist/types/filterType.js +2 -0
  126. package/package.json +2 -2
@@ -0,0 +1,86 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ var react_1 = __importStar(require("react"));
27
+ var react_native_1 = require("react-native");
28
+ var react_redux_1 = require("react-redux");
29
+ var lib_1 = require("@nakamura-123/lib");
30
+ var common_1 = require("@nakamura-123/common");
31
+ var quizHook_1 = require("../../hooks/quizHook");
32
+ var Bottom2BtnJ = function (_a) {
33
+ var navigation = _a.navigation;
34
+ var dispatch = (0, react_redux_1.useDispatch)();
35
+ var question = (0, quizHook_1.useQuestionDataJ)();
36
+ var quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
37
+ if (quizId === null)
38
+ return null; // quizIdがnullの場合は何も表示しない
39
+ // 音声の設定
40
+ var voice = (0, quizHook_1.useGetVoicePath)(quizId);
41
+ var finishedVoice = function () {
42
+ return dispatch({ type: "quiz/changeFinishVoice", payload: true });
43
+ };
44
+ // 音声のプリロード・初回再生
45
+ (0, react_1.useEffect)(function () {
46
+ if (voice)
47
+ lib_1.voiceFnc.preloadVoiceById(voice, true, finishedVoice);
48
+ else
49
+ finishedVoice();
50
+ return function () {
51
+ if (voice)
52
+ lib_1.voiceFnc.unloadVoiceById(voice);
53
+ dispatch({ type: "quiz/changeFinishVoice", payload: false });
54
+ };
55
+ }, [quizId]);
56
+ var btnList = [
57
+ voice
58
+ ? createBtnInfo("volume-up", "Repeat", function () { return lib_1.voiceFnc.playVoice(voice, 1); })
59
+ : null,
60
+ createBtnInfo("book", "Guide", function () {
61
+ return navigation.navigate("Guide", { quizId: quizId });
62
+ }),
63
+ ].filter(Boolean); // falsyな要素を削除
64
+ return (<react_native_1.View style={styles.container}>
65
+ {btnList.map(function (btn) {
66
+ if (btn === null)
67
+ return null; // nullを除く
68
+ return (<common_1.IconTextBtn btn={btn} key={btn.text}/> // IconTextBtnを使用
69
+ );
70
+ })}
71
+ </react_native_1.View>);
72
+ };
73
+ var createBtnInfo = function (icon, text, onPress) { return ({
74
+ icon: icon,
75
+ text: text,
76
+ onPress: onPress,
77
+ }); };
78
+ var styles = react_native_1.StyleSheet.create({
79
+ container: {
80
+ flexDirection: "row",
81
+ justifyContent: "space-between",
82
+ marginBottom: 10,
83
+ marginHorizontal: 10,
84
+ },
85
+ });
86
+ exports.default = Bottom2BtnJ;
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
7
  var react_native_1 = require("react-native");
8
8
  var react_redux_1 = require("react-redux");
9
- var lib_1 = require("@nakamura-123/lib");
10
9
  var common_1 = require("@nakamura-123/common");
11
10
  var stores_1 = require("@nakamura-123/stores");
12
11
  var quizHook_1 = require("../../hooks/quizHook");
@@ -38,14 +37,7 @@ var NextQuiz = function (_a) {
38
37
  }),
39
38
  ];
40
39
  return (<react_native_1.View style={styles.container}>
41
- {btnList.map(function (btn) { return (<react_native_1.Pressable key={btn.text} onPress={btn.onPress} style={styles.button}>
42
- <react_native_1.View style={styles.iconContainer}>
43
- <common_1.Icon5 name={btn.icon} size={15}/>
44
- </react_native_1.View>
45
- <common_1.MyText style={styles.text} fsize="sm">
46
- {btn.text}
47
- </common_1.MyText>
48
- </react_native_1.Pressable>); })}
40
+ {btnList.map(function (btn) { return (<common_1.IconTextBtn btn={btn} key={btn.text}/>); })}
49
41
  </react_native_1.View>);
50
42
  };
51
43
  var createBtnInfo = function (icon, text, onPress) { return ({
@@ -60,19 +52,5 @@ var styles = react_native_1.StyleSheet.create({
60
52
  alignItems: "center",
61
53
  marginTop: 20,
62
54
  },
63
- button: {
64
- justifyContent: "center",
65
- alignItems: "center",
66
- borderRadius: 50, // 丸い形にする
67
- height: 50,
68
- width: 50,
69
- backgroundColor: lib_1.colors.ltBeige,
70
- marginHorizontal: 10,
71
- },
72
- iconContainer: {},
73
- text: {
74
- marginTop: 1,
75
- color: lib_1.colors.text,
76
- },
77
55
  });
78
56
  exports.default = NextQuiz;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { StackNavigationProp } from "@react-navigation/stack";
3
+ import { Nav } from "@nakamura-123/types";
4
+ interface NextQuizProps {
5
+ navigation: StackNavigationProp<Nav.RootStackParamList>;
6
+ }
7
+ declare const Bottom3BtnJ: React.FC<NextQuizProps>;
8
+ export default Bottom3BtnJ;
@@ -0,0 +1,78 @@
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
+ var react_1 = __importDefault(require("react"));
7
+ var react_native_1 = require("react-native");
8
+ var react_redux_1 = require("react-redux");
9
+ var lib_1 = require("@nakamura-123/lib");
10
+ var common_1 = require("@nakamura-123/common");
11
+ var stores_1 = require("@nakamura-123/stores");
12
+ var quizHook_1 = require("../../hooks/quizHook");
13
+ var quizActionHook_1 = require("../../hooks/quizActionHook");
14
+ var Bottom3BtnJ = function (_a) {
15
+ var navigation = _a.navigation;
16
+ var dispatch = (0, react_redux_1.useDispatch)();
17
+ var mode = (0, quizHook_1.useGetMode)();
18
+ var nextQuizAction = (0, quizActionHook_1.useNextQuizAction)();
19
+ var _b = (0, react_redux_1.useSelector)(function (state) { return state.quiz.currentInfo.state; }), turn = _b.turn, activeTurn = _b.activeTurn;
20
+ var isActiveTurn = turn === activeTurn;
21
+ var btnList = [
22
+ // 1つ目
23
+ createBtnInfo("arrow-left", "Back", function () {
24
+ return dispatch(stores_1.quizAction.beforeTurn());
25
+ }),
26
+ // 2つ目
27
+ createBtnInfo("envelope", "Mail", function () { return navigation.navigate("Report"); }),
28
+ // 3つ目 quizなら「パス」、checkなら「次へ」
29
+ mode === "quiz"
30
+ ? createBtnInfo("arrow-right", "Skip", function () {
31
+ return dispatch(stores_1.quizAction.changeMode("check"));
32
+ })
33
+ : createBtnInfo("arrow-right", "Next", function () {
34
+ if (mode === "result" || !isActiveTurn)
35
+ dispatch(stores_1.quizAction.nextTurn());
36
+ else
37
+ nextQuizAction(navigation);
38
+ }),
39
+ ];
40
+ return (<react_native_1.View style={styles.container}>
41
+ {btnList.map(function (btn) { return (<react_native_1.Pressable key={btn.text} onPress={btn.onPress} style={styles.button}>
42
+ <react_native_1.View style={styles.iconContainer}>
43
+ <common_1.Icon5 name={btn.icon} size={15}/>
44
+ </react_native_1.View>
45
+ <common_1.MyText style={styles.text} fsize="sm">
46
+ {btn.text}
47
+ </common_1.MyText>
48
+ </react_native_1.Pressable>); })}
49
+ </react_native_1.View>);
50
+ };
51
+ var createBtnInfo = function (icon, text, onPress) { return ({
52
+ icon: icon,
53
+ text: text,
54
+ onPress: onPress,
55
+ }); };
56
+ var styles = react_native_1.StyleSheet.create({
57
+ container: {
58
+ flexDirection: "row",
59
+ justifyContent: "center",
60
+ alignItems: "center",
61
+ marginTop: 10,
62
+ },
63
+ button: {
64
+ justifyContent: "center",
65
+ alignItems: "center",
66
+ borderRadius: 50, // 丸い形にする
67
+ height: 50,
68
+ width: 50,
69
+ backgroundColor: lib_1.colors.ltBeige,
70
+ marginHorizontal: 10,
71
+ },
72
+ iconContainer: {},
73
+ text: {
74
+ marginTop: 1,
75
+ color: lib_1.colors.text,
76
+ },
77
+ });
78
+ exports.default = Bottom3BtnJ;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { StackNavigationProp } from "@react-navigation/stack";
3
+ import { Nav } from "@nakamura-123/types";
4
+ interface NextQuizProps {
5
+ navigation: StackNavigationProp<Nav.RootStackParamList>;
6
+ }
7
+ declare const GuideBtn: React.FC<NextQuizProps>;
8
+ export default GuideBtn;
@@ -0,0 +1,38 @@
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
+ var react_1 = __importDefault(require("react"));
7
+ var react_native_1 = require("react-native");
8
+ var common_1 = require("@nakamura-123/common");
9
+ var quizHook_1 = require("../../hooks/quizHook");
10
+ var lib_1 = require("@nakamura-123/lib");
11
+ var GuideBtn = function (_a) {
12
+ var navigation = _a.navigation;
13
+ var question = (0, quizHook_1.useQuestionDataJ)();
14
+ var quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
15
+ if (quizId === null || !question)
16
+ return <react_native_1.View></react_native_1.View>; // quizIdがnullの場合は何も表示しない
17
+ var quizType = question.form === "basicSelImg" || question.form === "listenSelImg"
18
+ ? "jpSentence"
19
+ : "jpWord";
20
+ var searchBtn = createBtnInfo("search", "Search", function () {
21
+ var searchWord = lib_1.utilFnc.parseRubyText(question[quizType]);
22
+ var removeRuby = lib_1.utilFnc.removeRuby(searchWord);
23
+ lib_1.utilFnc.handleSearchTrans(removeRuby);
24
+ });
25
+ var guideBtn = createBtnInfo("book", "Guide", function () {
26
+ return navigation.navigate("Guide", { quizId: quizId });
27
+ });
28
+ return (<react_native_1.View style={{ flexDirection: "row", alignItems: "center" }}>
29
+ <common_1.IconTextBtn btn={searchBtn} style={{ marginLeft: "auto" }} key={searchBtn.text}/>
30
+ <common_1.IconTextBtn btn={guideBtn} key={guideBtn.text}/>
31
+ </react_native_1.View>);
32
+ };
33
+ var createBtnInfo = function (icon, text, onPress) { return ({
34
+ icon: icon,
35
+ text: text,
36
+ onPress: onPress,
37
+ }); };
38
+ exports.default = GuideBtn;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface NextQuizProps {
3
+ isPreLoad?: boolean;
4
+ }
5
+ declare const RepeatBtn: React.FC<NextQuizProps>;
6
+ export default RepeatBtn;
@@ -0,0 +1,77 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ var react_1 = __importStar(require("react"));
27
+ var react_native_1 = require("react-native");
28
+ var react_redux_1 = require("react-redux");
29
+ var lib_1 = require("@nakamura-123/lib");
30
+ var common_1 = require("@nakamura-123/common");
31
+ var quizHook_1 = require("../../hooks/quizHook");
32
+ var RepeatBtn = function (_a) {
33
+ var isPreLoad = _a.isPreLoad;
34
+ var dispatch = (0, react_redux_1.useDispatch)();
35
+ var question = (0, quizHook_1.useQuestionDataJ)();
36
+ var quizId = (question === null || question === void 0 ? void 0 : question.quizId) || null;
37
+ if (quizId === null)
38
+ return <react_native_1.View></react_native_1.View>; // quizIdがnullの場合は何も表示しない
39
+ // 音声の設定
40
+ var voice = (0, quizHook_1.useGetVoicePath)(quizId);
41
+ var wordVoice = (0, quizHook_1.useGetVoicePath)(quizId, "word");
42
+ var sentenceVoice = (0, quizHook_1.useGetVoicePath)(quizId, "sentence");
43
+ var finishedVoice = function () {
44
+ return dispatch({ type: "quiz/changeFinishVoice", payload: true });
45
+ };
46
+ var finishedVoiceReset = function () {
47
+ return dispatch({ type: "quiz/changeFinishVoice", payload: false });
48
+ };
49
+ // 音声のプリロード・初回再生
50
+ (0, react_1.useEffect)(function () {
51
+ if (!isPreLoad || !wordVoice || !sentenceVoice)
52
+ return;
53
+ if (voice)
54
+ lib_1.voiceFnc.preloadVoiceById(voice, true, finishedVoice, 0.6);
55
+ else
56
+ finishedVoice();
57
+ return function () {
58
+ // if (voice) voiceFnc.unloadVoiceById(voice);
59
+ lib_1.voiceFnc.unloadVoiceById(wordVoice);
60
+ lib_1.voiceFnc.unloadVoiceById(sentenceVoice);
61
+ finishedVoiceReset();
62
+ };
63
+ }, [quizId]);
64
+ if (!voice)
65
+ return <react_native_1.View></react_native_1.View>; // voiceがnullの場合は何も表示しない
66
+ var btn = createBtnInfo("volume-up", "Repeat", function () {
67
+ return lib_1.voiceFnc.playVoice(voice, 0.6);
68
+ });
69
+ return (<common_1.IconTextBtn btn={btn} style={{ marginRight: "auto" }} key={btn.text}/> // IconTextBtnを使用
70
+ );
71
+ };
72
+ var createBtnInfo = function (icon, text, onPress) { return ({
73
+ icon: icon,
74
+ text: text,
75
+ onPress: onPress,
76
+ }); };
77
+ exports.default = RepeatBtn;
File without changes
@@ -0,0 +1 @@
1
+ "use strict";