@nakamura-123/pages 1.1.17 → 1.1.23
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/Basic/Badge5s.js +18 -30
- package/dist/component/Basic/BasicContents.js +38 -39
- package/dist/component/Basic/BasicProgressBar.js +16 -17
- package/dist/component/Basic/BasicSetting.js +14 -15
- package/dist/component/Basic/MiniTestCard.js +32 -33
- package/dist/component/Basic/Paw5s.js +9 -13
- package/dist/component/Basic/SelectedExamCnt.js +14 -15
- package/dist/component/Basic/SubCategoryLeft.js +5 -6
- package/dist/component/Basic/SubCategoryList.js +49 -62
- package/dist/component/Boot/SelectRange.js +18 -21
- package/dist/component/Boot/ToggleRange.js +11 -14
- package/dist/component/Coin/AppReviews.js +9 -10
- package/dist/component/Coin/CatchCopy.js +6 -6
- package/dist/component/Coin/CoinCheck.js +18 -54
- package/dist/component/Coin/CoinFnc.js +210 -282
- package/dist/component/Coin/CoinPageComponent.d.ts +1 -0
- package/dist/component/Coin/CoinPageComponent.js +22 -22
- package/dist/component/Coin/ReceiptFnc.js +3 -3
- package/dist/component/Coin/Recommend.js +10 -10
- package/dist/component/Coin/WaitingPayBanner.js +8 -9
- package/dist/component/Discription.js +6 -7
- package/dist/component/Grade/AllTags.js +12 -12
- package/dist/component/Grade/BasicBadge.js +20 -32
- package/dist/component/Grade/GradeCard/ChangeWeeklyModal.js +8 -10
- package/dist/component/Grade/GradeCard/ChangeWeeklyTargetBtn.js +21 -22
- package/dist/component/Grade/GradeCard/DatePickerModal.js +17 -19
- package/dist/component/Grade/GradeCard/GradeCard.js +19 -20
- package/dist/component/Grade/GradeCard/Square3sGrade.js +16 -17
- package/dist/component/Grade/GradeCard/TargetDate.js +19 -20
- package/dist/component/Grade/GradeCard/WeeklyAchivedRate.js +7 -8
- package/dist/component/Grade/GradeCard/WeeklyProgress.js +19 -29
- package/dist/component/Grade/JAllTags.js +16 -16
- package/dist/component/Grade/QuizCntGraph.js +31 -45
- package/dist/component/Grade/ShareBtn.js +30 -68
- package/dist/component/Grade/Square4s.js +14 -15
- package/dist/component/Grade/UnitCircles.js +18 -23
- package/dist/component/Grade/YearCircles.js +17 -22
- package/dist/component/Guide.js +6 -7
- package/dist/component/Home/OpeningMsg.js +14 -14
- package/dist/component/OnlineInput/OnlineInputFnc.js +6 -6
- package/dist/component/OnlineInput/OnlineSaveBtn.js +7 -8
- package/dist/component/OnlineInput/OnlineSavedList.js +13 -14
- package/dist/component/OnlineInput/PasswardModal.js +64 -110
- package/dist/component/OnlineInput/PasswordIdModal.js +40 -80
- package/dist/component/QuizSet/QuizOptionDrill.js +29 -42
- package/dist/component/Result/AdCard.js +21 -16
- package/dist/component/Result/CharaCard.js +15 -16
- package/dist/component/Result/LessonTitle.js +10 -10
- package/dist/component/Result/QuizFlatList.js +26 -30
- package/dist/component/Result/ScoreCircle.js +8 -9
- package/dist/component/SelectRange/SelectYearRange.js +22 -34
- package/dist/component/SettingBtns/QuizOptionSelector.js +16 -17
- package/dist/component/SettingBtns/Range.js +9 -9
- package/dist/component/SettingBtns/TransBtn.js +17 -17
- package/dist/component/TabAnimeView.js +9 -10
- package/dist/component/Tag5s.js +10 -14
- package/dist/component/TagBadge5s.js +16 -17
- package/dist/component/TagBadge5sPress.js +14 -15
- package/dist/component/TestPage/AverageBar.js +12 -24
- package/dist/component/TestPage/BarChartContainer.js +30 -31
- package/dist/component/TestPage/ChartControl.js +5 -6
- package/dist/component/TestPage/Square3s.js +12 -13
- package/dist/functions/badgeBasicFnc.js +22 -42
- package/dist/functions/badgeDailyFnc.js +24 -35
- package/dist/functions/badgeFilter.js +16 -18
- package/dist/functions/badgeFnc.js +24 -33
- package/dist/functions/createQuizFncD.js +33 -33
- package/dist/functions/createQuizFncJ.js +27 -33
- package/dist/functions/gradeFnc.js +48 -87
- package/dist/functions/oldStorageFnc.js +77 -200
- package/dist/functions/questionFilterD.js +19 -28
- package/dist/functions/questionFilterJ.js +9 -9
- package/dist/functions/questionFormatD.js +34 -47
- package/dist/functions/questionFormatJ.js +30 -41
- package/dist/functions/tagFncD.js +37 -39
- package/dist/functions/tagFncJ.js +16 -19
- package/dist/functions/testFnc.js +6 -7
- package/dist/hooks/BadgeHook.js +24 -35
- package/dist/hooks/ExitQuizHook.js +21 -21
- package/dist/hooks/basicHook.js +12 -12
- package/dist/hooks/quizActionHook.js +44 -57
- package/dist/hooks/quizHook.d.ts +2 -1
- package/dist/hooks/quizHook.js +58 -48
- package/dist/index.js +25 -25
- package/dist/page/BadgePage.js +26 -29
- package/dist/page/BasicPage.js +23 -25
- package/dist/page/BootPage.js +48 -53
- package/dist/page/CoinPage.d.ts +1 -0
- package/dist/page/CoinPage.js +90 -144
- package/dist/page/FAQPage.js +23 -23
- package/dist/page/GetBadgePage.js +35 -71
- package/dist/page/GradePage.js +26 -27
- package/dist/page/GuidePage.js +28 -33
- package/dist/page/HistoryPage.js +25 -33
- package/dist/page/HomePage.d.ts +1 -0
- package/dist/page/HomePage.js +62 -108
- package/dist/page/ImgZoom.js +8 -9
- package/dist/page/InformationPage.js +15 -15
- package/dist/page/JDetailSettingPage.js +23 -25
- package/dist/page/OnlineInputPage.js +19 -20
- package/dist/page/QuizPage.js +25 -26
- package/dist/page/QuizSettingPage.js +19 -19
- package/dist/page/QuizSetupPage.js +40 -43
- package/dist/page/ReportPage.js +55 -94
- package/dist/page/ResultPage.js +55 -103
- package/dist/page/SettingPage.js +35 -40
- package/dist/page/TestPage.js +41 -44
- package/dist/quiz/QuizContentsDrill.js +17 -18
- package/dist/quiz/QuizContentsJLPT.js +8 -9
- package/dist/quiz/Title.js +22 -22
- package/dist/quiz/answer/Answer.js +20 -20
- package/dist/quiz/answer/BlangGuide.js +10 -10
- package/dist/quiz/answer/BlankAnswer.js +11 -12
- package/dist/quiz/answer/BlankBtn.js +10 -10
- package/dist/quiz/answer/CheckButton.js +6 -9
- package/dist/quiz/answer/ChoiceView.js +15 -30
- package/dist/quiz/answer/Input/CollapseExplain.js +10 -11
- package/dist/quiz/answer/Input/InputAnswerBtn.js +9 -9
- package/dist/quiz/answer/Input/InputBox.js +17 -18
- package/dist/quiz/answer/Input/InputCounter.js +6 -7
- package/dist/quiz/answer/Input/InputFnc.js +10 -19
- package/dist/quiz/answer/Input/InputSaveSelector.js +12 -13
- package/dist/quiz/answer/Input/InputTab.js +12 -13
- package/dist/quiz/answer/Input/InputWarnning.js +13 -14
- package/dist/quiz/answer/InputGuide.js +10 -10
- package/dist/quiz/answer/InputNav.js +38 -39
- package/dist/quiz/answer/MultiChoice.js +20 -22
- package/dist/quiz/answer/MultiGuide.js +10 -10
- package/dist/quiz/answer/MultiNextBtn.js +13 -14
- package/dist/quiz/answer/NormalChoice.js +29 -42
- package/dist/quiz/answer/NormalMultiGuide.js +11 -12
- package/dist/quiz/answer/styles/getChoiceStyle.js +4 -4
- package/dist/quiz/check/Check.js +17 -18
- package/dist/quiz/check/NextQuizBtn.js +18 -19
- package/dist/quiz/check/SelectTag.js +36 -51
- package/dist/quiz/common/MyTextqqyy.js +29 -47
- package/dist/quiz/common/PageContainerWrap.js +14 -15
- package/dist/quiz/common/RenderImgOrText.js +17 -18
- package/dist/quiz/common/RubyText.js +21 -35
- package/dist/quiz/common/ZoomableImage.js +6 -9
- package/dist/quiz/explain/CorrectedBar.js +13 -14
- package/dist/quiz/explain/Explain.js +9 -10
- package/dist/quiz/explain/ExplainLogic.js +17 -23
- package/dist/quiz/explain/MovieBtn.js +10 -11
- package/dist/quiz/explain/MultiExplain.js +12 -24
- package/dist/quiz/explain/NormalExplain.js +29 -30
- package/dist/quiz/function/choiceFnc.js +2 -2
- package/dist/quiz/jAnswer/JAnswer.js +24 -26
- package/dist/quiz/jAnswer/JAnswerContents.js +12 -27
- package/dist/quiz/jQuestion/JQuestion.js +12 -13
- package/dist/quiz/jQuestion/JQuestionBottomText.js +14 -15
- package/dist/quiz/jQuestion/JQuestionText.js +13 -14
- package/dist/quiz/jQuestion/QuizCnt.js +9 -9
- package/dist/quiz/jQuestion/TimeLimit.js +23 -25
- package/dist/quiz/question/FillDiagram.js +12 -13
- package/dist/quiz/question/Question.js +25 -26
- package/dist/quiz/question/QuestionFormats.js +29 -45
- package/dist/quiz/question/QuestionReference.js +7 -7
- package/dist/quiz/question/SearchYoutue.js +10 -11
- package/dist/quiz/save/QuizSaveData.js +18 -19
- package/dist/quiz/setting/Above3BtnJ.js +25 -30
- package/dist/quiz/setting/Bottom3Btn.js +25 -30
- package/dist/quiz/setting/GuideBtn.js +19 -22
- package/dist/quiz/setting/RepeatBtn.js +27 -34
- package/dist/quiz/setting/ReturnBtn.js +8 -20
- package/dist/quiz/setting/ReturnSaveBtn.js +21 -33
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/page/BootPage.js
CHANGED
|
@@ -3,59 +3,58 @@ 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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var startCfg = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.startCfg; });
|
|
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 react_2 = require("@realm/react");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const db_1 = require("@nakamura-123/db");
|
|
12
|
+
const QuizSaveData_1 = __importDefault(require("../quiz/save/QuizSaveData"));
|
|
13
|
+
const SelectRange_1 = __importDefault(require("../component/Boot/SelectRange"));
|
|
14
|
+
const TagBadge5sPress_1 = __importDefault(require("../component/TagBadge5sPress"));
|
|
15
|
+
const QuizOptionDrill_1 = __importDefault(require("../component/QuizSet/QuizOptionDrill"));
|
|
16
|
+
const tagFncD_1 = require("../functions/tagFncD");
|
|
17
|
+
const AverageBar_1 = __importDefault(require("../component/TestPage/AverageBar"));
|
|
18
|
+
const createQuizFncD_1 = require("../functions/createQuizFncD");
|
|
19
|
+
const quizActionHook_1 = require("../hooks/quizActionHook");
|
|
20
|
+
const Discription_1 = __importDefault(require("../component/Discription"));
|
|
21
|
+
const BootDiscription = "このモードでは、出題範囲を自由にカスタマイズできます。苦手分野の克服などに、ぜひご活用ください。";
|
|
22
|
+
const BootPage = ({ navigation, subject }) => {
|
|
23
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
24
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
25
|
+
const useStartQuiz = (0, quizActionHook_1.useStartQuizAction)();
|
|
26
|
+
const startCfg = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg);
|
|
28
27
|
// セーブの確認
|
|
29
|
-
|
|
28
|
+
const isExistedSaveData = (0, react_redux_1.useSelector)((state) => state.score.isSave[subject.name]);
|
|
30
29
|
// タグの選択を計算
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
const QuestionDB = (0, react_2.useQuery)(db_1.DQuestionSchema);
|
|
31
|
+
const unitRange = (0, react_redux_1.useSelector)((state) => state.setting.boot.outOfUnit);
|
|
32
|
+
const yearRange = (0, react_redux_1.useSelector)((state) => state.setting.boot.outOfYear);
|
|
33
|
+
const tagLevels = (0, tagFncD_1.getBootTagLevelCnts)(QuestionDB, unitRange, yearRange);
|
|
34
|
+
const unitLength = (0, react_redux_1.useSelector)((state) => state.app.unitList).length;
|
|
35
|
+
const yearLength = (0, react_redux_1.useSelector)((state) => state.app.yearList).length;
|
|
37
36
|
// アベレージバーのデータ生成
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
const l4TagCnt = (0, tagFncD_1.getCompletedTagRate)(tagLevels, true);
|
|
38
|
+
const allQuizCnt = tagLevels.length || 0;
|
|
39
|
+
const average = Math.round((l4TagCnt / allQuizCnt) * 100) || 0;
|
|
40
|
+
const barLabel = t("boot.barLabel") + allQuizCnt;
|
|
42
41
|
// 履歴情報
|
|
43
|
-
|
|
42
|
+
const historyParams = {
|
|
44
43
|
subject: subject.name,
|
|
45
44
|
db: "boot",
|
|
46
45
|
};
|
|
47
46
|
// 課金ロック
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
const isLocked = common_1.commonHook.useIsLocked("boot");
|
|
48
|
+
const startIcon = isLocked ? "lock" : "play";
|
|
49
|
+
const studyIcon = isLocked ? "lock" : "book";
|
|
51
50
|
// スタートボタンの設定
|
|
52
|
-
|
|
51
|
+
const handleStart = () => {
|
|
53
52
|
if (isLocked) {
|
|
54
53
|
navigation.navigate("Coin");
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const quizList = (0, createQuizFncD_1.getBootQuestions)(QuestionDB, startCfg, unitRange, yearRange);
|
|
57
|
+
const quizCnt = quizList.length;
|
|
59
58
|
dispatch({
|
|
60
59
|
type: "quiz/setLesson",
|
|
61
60
|
payload: {
|
|
@@ -65,21 +64,19 @@ var BootPage = function (_a) {
|
|
|
65
64
|
lesson: { title: subject.title, key: quizCnt },
|
|
66
65
|
},
|
|
67
66
|
});
|
|
68
|
-
|
|
67
|
+
const isExistQuiz = useStartQuiz(subject.name, quizList);
|
|
69
68
|
if (!isExistQuiz)
|
|
70
69
|
return;
|
|
71
70
|
navigation.navigate("Quiz");
|
|
72
71
|
};
|
|
73
|
-
|
|
72
|
+
const handlePreStudy = () => {
|
|
74
73
|
handleStart();
|
|
75
74
|
dispatch({ type: "quiz/toResult" });
|
|
76
75
|
};
|
|
77
76
|
// 選択数を計算
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return startCfg.tags.includes(tag);
|
|
82
|
-
}).length;
|
|
77
|
+
const unitRangeCnt = unitLength - unitRange.length;
|
|
78
|
+
const yearRangeCnt = yearLength - yearRange.length;
|
|
79
|
+
const selectedTagCnt = tagLevels.filter((tag) => startCfg.tags.includes(tag)).length;
|
|
83
80
|
return (<react_native_1.SafeAreaView style={{ flex: 1 }}>
|
|
84
81
|
<react_native_1.ScrollView style={styles.container}>
|
|
85
82
|
<Discription_1.default MSG={t("boot.msg")}/>
|
|
@@ -93,12 +90,10 @@ var BootPage = function (_a) {
|
|
|
93
90
|
<common_1.IconTitle icon="sliders-h" title={t("boot.setting")} mt={20}/>
|
|
94
91
|
<QuizOptionDrill_1.default />
|
|
95
92
|
<react_native_1.View style={styles.btnBox}>
|
|
96
|
-
<common_1.MiniIconBtn onPress={
|
|
97
|
-
<common_1.MiniIconBtn onPress={
|
|
93
|
+
<common_1.MiniIconBtn onPress={() => handlePreStudy()} icon={studyIcon} title={t("boot.study")} color="ltBlack"/>
|
|
94
|
+
<common_1.MiniIconBtn onPress={() => handleStart()} icon={startIcon} title={t("boot.start")} color="red"/>
|
|
98
95
|
</react_native_1.View>
|
|
99
|
-
<common_1.RoundRectangleIcon title={t("boot.showHistory")} onPress={
|
|
100
|
-
return navigation.navigate("History", { info: historyParams });
|
|
101
|
-
}} icon="history"/>
|
|
96
|
+
<common_1.RoundRectangleIcon title={t("boot.showHistory")} onPress={() => navigation.navigate("History", { info: historyParams })} icon="history"/>
|
|
102
97
|
<react_native_1.View style={{ height: 50 }}/>
|
|
103
98
|
{isExistedSaveData && <react_native_1.View style={{ height: 100 }}/>}
|
|
104
99
|
</react_native_1.ScrollView>
|
|
@@ -107,7 +102,7 @@ var BootPage = function (_a) {
|
|
|
107
102
|
</react_native_1.View>
|
|
108
103
|
</react_native_1.SafeAreaView>);
|
|
109
104
|
};
|
|
110
|
-
|
|
105
|
+
const styles = react_native_1.StyleSheet.create({
|
|
111
106
|
container: {
|
|
112
107
|
padding: 20,
|
|
113
108
|
marginTop: 20,
|
package/dist/page/CoinPage.d.ts
CHANGED
package/dist/page/CoinPage.js
CHANGED
|
@@ -31,55 +31,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
36
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
34
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
36
|
};
|
|
64
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
(0, react_1.useEffect)(function () {
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const react_redux_1 = require("react-redux");
|
|
40
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
41
|
+
const CoinPageComponent_1 = __importDefault(require("../component/Coin/CoinPageComponent"));
|
|
42
|
+
const CoinFnc_1 = require("../component/Coin/CoinFnc");
|
|
43
|
+
const ReceiptFnc_1 = require("../component/Coin/ReceiptFnc");
|
|
44
|
+
const common_1 = require("@nakamura-123/common");
|
|
45
|
+
const CoinPage = ({ navigation, comments = [], warningContent, }) => {
|
|
46
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
47
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
48
|
+
const allFreeId = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.payment.items.allFreeId; });
|
|
49
|
+
const allFreeState = (0, react_redux_1.useSelector)((state) => state.setting.payment.allFreeState);
|
|
50
|
+
const isAllfreePaid = allFreeState === "paid";
|
|
51
|
+
const [products, setProducts] = (0, react_1.useState)([]);
|
|
52
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
53
|
+
const items = allFreeId ? [allFreeId] : [];
|
|
54
|
+
(0, react_1.useEffect)(() => {
|
|
83
55
|
(0, CoinFnc_1.initializeIAP)(items, setProducts, setLoading);
|
|
84
56
|
// 🔧 修正4: endConnection()を削除(接続を維持)
|
|
85
57
|
// アプリ終了時に自動的に切断されるため、明示的な切断は不要
|
|
@@ -88,107 +60,81 @@ var CoinPage = function (_a) {
|
|
|
88
60
|
// };
|
|
89
61
|
}, []);
|
|
90
62
|
// 02.購入時の処理の実行
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
paymentState: receipt.isPaid ? "paid" : "wait",
|
|
115
|
-
});
|
|
116
|
-
return [4 /*yield*/, stores_1.coinStorage.savePurchasedItems(receipt)];
|
|
117
|
-
case 3:
|
|
118
|
-
_a.sent();
|
|
119
|
-
dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
|
|
120
|
-
console.log("レシート保存完了");
|
|
121
|
-
return [3 /*break*/, 5];
|
|
122
|
-
case 4:
|
|
123
|
-
console.error("レシートの統一に失敗しました", purchase);
|
|
124
|
-
_a.label = 5;
|
|
125
|
-
case 5: return [3 /*break*/, 8];
|
|
126
|
-
case 6:
|
|
127
|
-
error_1 = _a.sent();
|
|
128
|
-
console.error("購入処理中にエラーが発生しました", error_1);
|
|
129
|
-
console.error("エラーの詳細: ", error_1 instanceof Error ? error_1.message : String(error_1));
|
|
130
|
-
return [3 /*break*/, 8];
|
|
131
|
-
case 7:
|
|
132
|
-
dispatch(stores_1.settingStorage.saveSetting());
|
|
133
|
-
setLoading(false); // 処理終了
|
|
134
|
-
return [7 /*endfinally*/];
|
|
135
|
-
case 8: return [2 /*return*/];
|
|
63
|
+
const handlePurchaseItem = (productId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
setLoading(true); // 処理開始
|
|
65
|
+
try {
|
|
66
|
+
console.log("購入処理開始: ", productId);
|
|
67
|
+
const purchase = yield (0, CoinFnc_1.handlePurchase)(productId);
|
|
68
|
+
if (!purchase) {
|
|
69
|
+
console.warn("購入がキャンセルまたは失敗しました");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
console.log("購入成功、レシート処理開始");
|
|
73
|
+
const receipt = (0, ReceiptFnc_1.unifyReceipt)(purchase);
|
|
74
|
+
if (receipt) {
|
|
75
|
+
console.log("レシート情報: ", {
|
|
76
|
+
productId: receipt.productId,
|
|
77
|
+
isPaid: receipt.isPaid,
|
|
78
|
+
paymentState: receipt.isPaid ? "paid" : "wait",
|
|
79
|
+
});
|
|
80
|
+
yield stores_1.coinStorage.savePurchasedItems(receipt);
|
|
81
|
+
dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
|
|
82
|
+
console.log("レシート保存完了");
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
console.error("レシートの統一に失敗しました", purchase);
|
|
136
86
|
}
|
|
137
|
-
}
|
|
138
|
-
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
console.error("購入処理中にエラーが発生しました", error);
|
|
90
|
+
console.error("エラーの詳細: ", error instanceof Error ? error.message : String(error));
|
|
91
|
+
}
|
|
92
|
+
finally {
|
|
93
|
+
dispatch(stores_1.settingStorage.saveSetting());
|
|
94
|
+
setLoading(false); // 処理終了
|
|
95
|
+
}
|
|
96
|
+
});
|
|
139
97
|
// 03.復元処理の実行
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (receipts) {
|
|
155
|
-
console.log("復元されたアイテム: ", receipts.length, "件");
|
|
156
|
-
receipts.forEach(function (receipt) {
|
|
157
|
-
dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
console.log("復元するアイテムがありませんでした");
|
|
162
|
-
}
|
|
163
|
-
return [3 /*break*/, 5];
|
|
164
|
-
case 3:
|
|
165
|
-
error_2 = _a.sent();
|
|
166
|
-
console.error("復元処理中にエラーが発生しました", error_2);
|
|
167
|
-
console.error("エラーの詳細: ", error_2 instanceof Error ? error_2.message : String(error_2));
|
|
168
|
-
return [3 /*break*/, 5];
|
|
169
|
-
case 4:
|
|
170
|
-
// 🔧 修正5(再修正): エラー時のみ保存しない、正常完了時は常に保存
|
|
171
|
-
// receipts === null → 通信エラー等(状態を保持)
|
|
172
|
-
// receipts === [] → 購入なし/返金済み("none"に更新して保存)
|
|
173
|
-
// receipts !== null → 正常に取得完了(常に保存)
|
|
174
|
-
if (receipts !== null) {
|
|
175
|
-
dispatch(stores_1.settingStorage.saveSetting());
|
|
176
|
-
if (receipts.length > 0) {
|
|
177
|
-
console.log("\u5FA9\u5143\u6210\u529F\uFF1A".concat(receipts.length, "\u4EF6\u306E\u8CFC\u5165\u3092\u78BA\u8A8D\u3057\u3001\u8A2D\u5B9A\u3092\u4FDD\u5B58\u3057\u307E\u3057\u305F"));
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
console.log('復元完了:購入アイテムなし(返金済み等)。状態を"none"に更新しました');
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
console.log("復元エラー:通信失敗等のため設定を保存しませんでした(既存状態を保持)");
|
|
185
|
-
}
|
|
186
|
-
setLoading(false); // 処理終了
|
|
187
|
-
return [7 /*endfinally*/];
|
|
188
|
-
case 5: return [2 /*return*/];
|
|
98
|
+
const handleRestore = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
+
setLoading(true); // 処理開始
|
|
100
|
+
let receipts = null; // スコープを外に出す
|
|
101
|
+
try {
|
|
102
|
+
console.log("復元処理開始");
|
|
103
|
+
receipts = yield (0, CoinFnc_1.restorePurchases)(dispatch, true);
|
|
104
|
+
if (receipts) {
|
|
105
|
+
console.log("復元されたアイテム: ", receipts.length, "件");
|
|
106
|
+
receipts.forEach((receipt) => {
|
|
107
|
+
dispatch((0, CoinFnc_1.updateAllFreeState)(receipt));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
console.log("復元するアイテムがありませんでした");
|
|
189
112
|
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error("復元処理中にエラーが発生しました", error);
|
|
116
|
+
console.error("エラーの詳細: ", error instanceof Error ? error.message : String(error));
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
// 🔧 修正5(再修正): エラー時のみ保存しない、正常完了時は常に保存
|
|
120
|
+
// receipts === null → 通信エラー等(状態を保持)
|
|
121
|
+
// receipts === [] → 購入なし/返金済み("none"に更新して保存)
|
|
122
|
+
// receipts !== null → 正常に取得完了(常に保存)
|
|
123
|
+
if (receipts !== null) {
|
|
124
|
+
dispatch(stores_1.settingStorage.saveSetting());
|
|
125
|
+
if (receipts.length > 0) {
|
|
126
|
+
console.log(`復元成功:${receipts.length}件の購入を確認し、設定を保存しました`);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
console.log('復元完了:購入アイテムなし(返金済み等)。状態を"none"に更新しました');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
console.log("復元エラー:通信失敗等のため設定を保存しませんでした(既存状態を保持)");
|
|
134
|
+
}
|
|
135
|
+
setLoading(false); // 処理終了
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return (<CoinPageComponent_1.default navigation={navigation} comments={comments} products={products} onPurchase={handlePurchaseItem} onRestore={handleRestore} loading={loading} isAllfreePaid={isAllfreePaid} warningContent={warningContent}/>);
|
|
193
139
|
};
|
|
194
140
|
exports.default = CoinPage;
|
package/dist/page/FAQPage.js
CHANGED
|
@@ -26,22 +26,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
29
|
+
const common_1 = require("@nakamura-123/common");
|
|
30
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
const react_native_1 = require("react-native");
|
|
33
|
+
const react_native_collapsible_1 = __importDefault(require("react-native-collapsible"));
|
|
34
|
+
const faqJa_1 = require("../component/FAQ/faqJa");
|
|
35
|
+
const faqEn_1 = require("../component/FAQ/faqEn");
|
|
36
|
+
const react_redux_1 = require("react-redux");
|
|
37
|
+
const FAQPage = () => {
|
|
38
|
+
const [openIndexes, setOpenIndexes] = (0, react_1.useState)(new Set());
|
|
39
|
+
const { i18n } = (0, common_1.useDrillTranslation)();
|
|
40
|
+
const faqDatas = (i18n === null || i18n === void 0 ? void 0 : i18n.language) === "en" ? faqEn_1.faqEnDatas : faqJa_1.faqJaDatas;
|
|
41
|
+
const isJLPT = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem) === "JLPT";
|
|
42
|
+
const toggleCollapse = (groupIndex, questionIndex) => {
|
|
43
|
+
const uniqueKey = `${groupIndex}-${questionIndex}`;
|
|
44
|
+
const newOpenIndexes = new Set(openIndexes);
|
|
45
45
|
if (newOpenIndexes.has(uniqueKey)) {
|
|
46
46
|
newOpenIndexes.delete(uniqueKey);
|
|
47
47
|
}
|
|
@@ -58,14 +58,14 @@ var FAQPage = function () {
|
|
|
58
58
|
return (<react_native_1.View style={styles.container}>
|
|
59
59
|
<common_1.MyText style={styles.title}>FAQ</common_1.MyText>
|
|
60
60
|
<react_native_1.ScrollView contentContainerStyle={styles.scrollContainer} showsVerticalScrollIndicator={false}>
|
|
61
|
-
{faqDatas.map(
|
|
61
|
+
{faqDatas.map((group, groupIndex) => (<react_native_1.View key={`group-${groupIndex}`} style={styles.section}>
|
|
62
62
|
{/* セクションタイトル */}
|
|
63
63
|
<common_1.MyText style={styles.sectionTitle}>{group.title}</common_1.MyText>
|
|
64
64
|
{/* 各質問 */}
|
|
65
|
-
{group.lists.map(
|
|
66
|
-
|
|
67
|
-
return (<react_native_1.View style={styles.faqItem} key={
|
|
68
|
-
<react_native_1.TouchableOpacity style={styles.questionContainer} onPress={
|
|
65
|
+
{group.lists.map((item, questionIndex) => {
|
|
66
|
+
const uniqueKey = `${groupIndex}-${questionIndex}`;
|
|
67
|
+
return (<react_native_1.View style={styles.faqItem} key={`item-${uniqueKey}`}>
|
|
68
|
+
<react_native_1.TouchableOpacity style={styles.questionContainer} onPress={() => toggleCollapse(groupIndex, questionIndex)}>
|
|
69
69
|
<react_native_1.View style={styles.titleBox}>
|
|
70
70
|
<common_1.MyText>{item.que}</common_1.MyText>
|
|
71
71
|
</react_native_1.View>
|
|
@@ -80,11 +80,11 @@ var FAQPage = function () {
|
|
|
80
80
|
</react_native_collapsible_1.default>
|
|
81
81
|
</react_native_1.View>);
|
|
82
82
|
})}
|
|
83
|
-
</react_native_1.View>)
|
|
83
|
+
</react_native_1.View>))}
|
|
84
84
|
</react_native_1.ScrollView>
|
|
85
85
|
</react_native_1.View>);
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
const styles = react_native_1.StyleSheet.create({
|
|
88
88
|
container: {
|
|
89
89
|
flex: 1,
|
|
90
90
|
padding: 20,
|
|
@@ -31,82 +31,46 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
36
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var notification = (0, react_redux_1.useSelector)(function (state) { return state.score.notification; });
|
|
35
|
+
const react_1 = __importStar(require("react"));
|
|
36
|
+
const react_native_1 = require("react-native");
|
|
37
|
+
const Animatable = __importStar(require("react-native-animatable"));
|
|
38
|
+
const react_redux_1 = require("react-redux");
|
|
39
|
+
const common_1 = require("@nakamura-123/common");
|
|
40
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
41
|
+
const GetBadgePage = ({ navigation }) => {
|
|
42
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
43
|
+
const imgs = (0, react_redux_1.useSelector)((state) => state.app.imgs);
|
|
44
|
+
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
|
+
const notification = (0, react_redux_1.useSelector)((state) => state.score.notification);
|
|
74
46
|
if (notification.length === 0)
|
|
75
47
|
return null;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
(0, react_1.useEffect)(
|
|
83
|
-
return
|
|
48
|
+
const imgPath = imgs.chara.l3;
|
|
49
|
+
const title = notification[0].title || "";
|
|
50
|
+
const badgeName = notification[0].name || "";
|
|
51
|
+
const badgeColor = notification[0].color || "blue";
|
|
52
|
+
const badgeIcon = notification[0].icon || "star";
|
|
53
|
+
const animatableRef = (0, react_1.useRef)(null);
|
|
54
|
+
(0, react_1.useEffect)(() => {
|
|
55
|
+
return () => {
|
|
84
56
|
dispatch({ type: "score/removeFirstNotification" });
|
|
85
57
|
};
|
|
86
58
|
}, []);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
dispatch({ type: "score/removeFirstNotification" });
|
|
97
|
-
if (!animatableRef.current) return [3 /*break*/, 3];
|
|
98
|
-
return [4 /*yield*/, animatableRef.current.fadeIn(300)];
|
|
99
|
-
case 2:
|
|
100
|
-
_a.sent();
|
|
101
|
-
_a.label = 3;
|
|
102
|
-
case 3: return [3 /*break*/, 5];
|
|
103
|
-
case 4:
|
|
104
|
-
navigation.goBack(); // データがない場合は画面遷移
|
|
105
|
-
_a.label = 5;
|
|
106
|
-
case 5: return [2 /*return*/];
|
|
59
|
+
const handleNext = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
if (animatableRef.current) {
|
|
61
|
+
yield animatableRef.current.fadeOut(300); // アニメーション終了を待つ
|
|
62
|
+
if (notification.length > 1) {
|
|
63
|
+
dispatch({ type: "score/removeFirstNotification" });
|
|
64
|
+
// データが更新された後にフェードインを実行
|
|
65
|
+
if (animatableRef.current) {
|
|
66
|
+
yield animatableRef.current.fadeIn(300);
|
|
67
|
+
}
|
|
107
68
|
}
|
|
108
|
-
|
|
109
|
-
|
|
69
|
+
else {
|
|
70
|
+
navigation.goBack(); // データがない場合は画面遷移
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
110
74
|
return (<react_native_1.View style={styles.page}>
|
|
111
75
|
<Animatable.View ref={animatableRef} animation="fadeIn" duration={300} style={styles.card}>
|
|
112
76
|
<common_1.MyText fsize="xl">Congratulations!</common_1.MyText>
|
|
@@ -124,13 +88,13 @@ var GetBadgePage = function (_a) {
|
|
|
124
88
|
</common_1.MyText>
|
|
125
89
|
</react_native_1.View>
|
|
126
90
|
<react_native_1.View style={styles.btnBox}>
|
|
127
|
-
<common_1.MiniIconBtn onPress={
|
|
91
|
+
<common_1.MiniIconBtn onPress={() => navigation.navigate("Badge")} icon="shield-alt" title="バッジ一覧" color="ltBlack" outerStyle={styles.miniBtnOuter}/>
|
|
128
92
|
<common_1.MiniIconBtn onPress={handleNext} icon="arrow-right" title="次 へ" color="blue" outerStyle={styles.miniBtnOuter}/>
|
|
129
93
|
</react_native_1.View>
|
|
130
94
|
</Animatable.View>
|
|
131
95
|
</react_native_1.View>);
|
|
132
96
|
};
|
|
133
|
-
|
|
97
|
+
const styles = react_native_1.StyleSheet.create({
|
|
134
98
|
page: {
|
|
135
99
|
flex: 1,
|
|
136
100
|
justifyContent: "center",
|