@nakamura-123/pages 1.3.16 → 1.4.0
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 +44 -9
- 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 +159 -56
- 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/questionFormatG.d.ts +7 -0
- package/dist/functions/questionFormatG.js +31 -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 +9 -0
- package/dist/hooks/resultHook.js +74 -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 +6 -24
- 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
|
@@ -59,7 +59,7 @@ const initializeIAP = (paymentItems, setProducts, setLoading) => __awaiter(void
|
|
|
59
59
|
});
|
|
60
60
|
exports.initializeIAP = initializeIAP;
|
|
61
61
|
// 11. 購入処理
|
|
62
|
-
const handlePurchase = (productId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
const handlePurchase = (productId, t) => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
63
|
return new Promise((resolve, reject) => {
|
|
64
64
|
console.log("購入開始: ", productId);
|
|
65
65
|
// リスナーを設定
|
|
@@ -108,11 +108,11 @@ const handlePurchase = (productId) => __awaiter(void 0, void 0, void 0, function
|
|
|
108
108
|
// トランザクションの完了
|
|
109
109
|
if (react_native_1.Platform.OS === "android" &&
|
|
110
110
|
(0, exports.getAndroidPurchaseState)(purchase) === "wait") {
|
|
111
|
-
alert("
|
|
111
|
+
alert(t("coin.alert.waitingAfterPurchase"));
|
|
112
112
|
}
|
|
113
113
|
else {
|
|
114
114
|
yield (0, expo_iap_1.finishTransaction)({ purchase, isConsumable: false });
|
|
115
|
-
alert("
|
|
115
|
+
alert(t("coin.alert.purchased"));
|
|
116
116
|
}
|
|
117
117
|
return purchase; // 成功時に購入データを返す
|
|
118
118
|
}))
|
|
@@ -131,7 +131,7 @@ const handlePurchase = (productId) => __awaiter(void 0, void 0, void 0, function
|
|
|
131
131
|
// pushCoinError({ title: "購入処理中にエラーが発生しました", log:jerr })
|
|
132
132
|
// );
|
|
133
133
|
try {
|
|
134
|
-
alert("
|
|
134
|
+
alert(t("coin.alert.purchaseFailed"));
|
|
135
135
|
}
|
|
136
136
|
catch (alertError) {
|
|
137
137
|
console.error("アラート表示エラー(購入失敗時): ", alertError);
|
|
@@ -141,7 +141,9 @@ const handlePurchase = (productId) => __awaiter(void 0, void 0, void 0, function
|
|
|
141
141
|
});
|
|
142
142
|
exports.handlePurchase = handlePurchase;
|
|
143
143
|
// 21. 購入復元
|
|
144
|
-
const restorePurchases = (dispatch,
|
|
144
|
+
const restorePurchases = (dispatch,
|
|
145
|
+
// 渡したときだけ結果を知らせる
|
|
146
|
+
t) => __awaiter(void 0, void 0, void 0, function* () {
|
|
145
147
|
try {
|
|
146
148
|
console.log("購入復元開始");
|
|
147
149
|
// 🔧 修正3: IAP接続を確実にする(多重接続を避けるため、initializeIAPと共有のPromiseを使う)
|
|
@@ -230,19 +232,19 @@ const restorePurchases = (dispatch, isAlert) => __awaiter(void 0, void 0, void 0
|
|
|
230
232
|
}
|
|
231
233
|
console.log("購入復元完了: ", receipts.length, "件");
|
|
232
234
|
// アラート表示(支払い待ち状態を考慮)
|
|
233
|
-
if (
|
|
235
|
+
if (t) {
|
|
234
236
|
try {
|
|
235
237
|
if (receipts.length === 0) {
|
|
236
|
-
alert("
|
|
238
|
+
alert(t("coin.alert.noItems"));
|
|
237
239
|
}
|
|
238
240
|
else {
|
|
239
241
|
// 支払い待ち状態のアイテムがあるかチェック
|
|
240
242
|
const hasWaitingPayment = receipts.some((receipt) => receipt && !receipt.isPaid);
|
|
241
243
|
if (hasWaitingPayment) {
|
|
242
|
-
alert("
|
|
244
|
+
alert(t("coin.alert.paying"));
|
|
243
245
|
}
|
|
244
246
|
else {
|
|
245
|
-
alert("
|
|
247
|
+
alert(t("coin.alert.restored"));
|
|
246
248
|
}
|
|
247
249
|
}
|
|
248
250
|
}
|
|
@@ -257,9 +259,9 @@ const restorePurchases = (dispatch, isAlert) => __awaiter(void 0, void 0, void 0
|
|
|
257
259
|
console.error("Restore Error: ", error);
|
|
258
260
|
console.error("エラーの詳細: ", error instanceof Error ? error.message : String(error));
|
|
259
261
|
// dispatch(pushCoinError({ title: "購入復元に失敗しました", log: error }));
|
|
260
|
-
if (
|
|
262
|
+
if (t) {
|
|
261
263
|
try {
|
|
262
|
-
alert("
|
|
264
|
+
alert(t("coin.alert.restoreFailed"));
|
|
263
265
|
}
|
|
264
266
|
catch (alertError) {
|
|
265
267
|
console.error("アラート表示エラー(復元失敗時): ", alertError);
|
|
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const react_redux_1 = require("react-redux");
|
|
8
8
|
const common_1 = require("@nakamura-123/common");
|
|
9
|
-
const homeMsg = "支払い後にアンロックページで「以前購入した方はこちらから復元」をタップしてください";
|
|
10
|
-
const coinMsg = "支払い後に「以前購入した方はこちらから復元」をタップしてください";
|
|
11
9
|
const WaitingPayBanner = ({ currentPage }) => {
|
|
12
|
-
const
|
|
10
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
11
|
+
const msg = t(`coin.banner.${currentPage}`);
|
|
13
12
|
const allFreeState = (0, react_redux_1.useSelector)((state) => state.setting.payment.allFreeState);
|
|
14
13
|
if (allFreeState !== "wait")
|
|
15
14
|
return null;
|
|
@@ -0,0 +1,45 @@
|
|
|
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_2 = require("@realm/react");
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const db_1 = require("@nakamura-123/db");
|
|
11
|
+
const common_1 = require("@nakamura-123/common");
|
|
12
|
+
const tagFncD_1 = require("../../functions/tagFncD");
|
|
13
|
+
// 文法(G系)の成績画面の全タグ。科目1=意味を取る問題、科目2=穴埋め
|
|
14
|
+
const GAllTags = () => {
|
|
15
|
+
const questions = (0, react_2.useQuery)(db_1.GQuestionSchema);
|
|
16
|
+
const { basic1, basic2 } = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.basic);
|
|
17
|
+
const rows = [
|
|
18
|
+
{ title: basic1.name, levels: questions.map((q) => q.meaningTag.level) },
|
|
19
|
+
{ title: basic2.name, levels: questions.map((q) => q.blankTag.level) },
|
|
20
|
+
];
|
|
21
|
+
return (<react_native_1.View style={styles.container}>
|
|
22
|
+
{rows.map(({ title, levels }) => (<react_native_1.View key={title}>
|
|
23
|
+
<common_1.MyText>{title}</common_1.MyText>
|
|
24
|
+
<react_native_1.View style={styles.tagBox}>
|
|
25
|
+
{(0, tagFncD_1.countTagsByLevel)(levels).map((tag, i) => (<common_1.Badge key={i} name={String(tag.cnt)} icon={"tag"} circleColor={tag.color} style={styles.badge}/>))}
|
|
26
|
+
</react_native_1.View>
|
|
27
|
+
</react_native_1.View>))}
|
|
28
|
+
</react_native_1.View>);
|
|
29
|
+
};
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
31
|
+
container: {
|
|
32
|
+
marginVertical: 10,
|
|
33
|
+
},
|
|
34
|
+
tagBox: {
|
|
35
|
+
flexDirection: "row",
|
|
36
|
+
justifyContent: "space-between",
|
|
37
|
+
width: "100%",
|
|
38
|
+
marginTop: 5,
|
|
39
|
+
},
|
|
40
|
+
badge: {
|
|
41
|
+
borderWidth: 0,
|
|
42
|
+
backgroundColor: "transparent",
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
exports.default = GAllTags;
|
|
@@ -7,18 +7,22 @@ const react_1 = __importDefault(require("react"));
|
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
8
|
const common_1 = require("@nakamura-123/common");
|
|
9
9
|
const ChangeWeeklyModal = ({ visible, optionInfo, handleChange, selectedValue, onClose, }) => {
|
|
10
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
10
11
|
return (<common_1.BaseModal isVisible={visible} onClose={onClose}>
|
|
11
|
-
<common_1.MyText fsize="lg"
|
|
12
|
+
<common_1.MyText fsize="lg">{t("grade.weekly.title")}</common_1.MyText>
|
|
12
13
|
<react_native_1.FlatList data={optionInfo} keyExtractor={(item) => item.value.toString()} style={styles.listContainer} showsVerticalScrollIndicator={false} renderItem={({ item }) => {
|
|
13
14
|
const color = item.value === selectedValue ? "red" : "black";
|
|
14
15
|
return (<react_native_1.TouchableOpacity onPress={() => handleChange(item.value)} style={styles.option}>
|
|
15
16
|
<common_1.MyText fsize="md" color={color} style={{ textAlign: "center" }}>
|
|
16
|
-
{
|
|
17
|
+
{t("grade.weekly.option", {
|
|
18
|
+
week: item.value,
|
|
19
|
+
day: item.value / 7,
|
|
20
|
+
})}
|
|
17
21
|
</common_1.MyText>
|
|
18
22
|
</react_native_1.TouchableOpacity>);
|
|
19
23
|
}}/>
|
|
20
24
|
<react_native_1.View style={styles.btnBox}>
|
|
21
|
-
<common_1.MiniIconBtn icon="times" title="
|
|
25
|
+
<common_1.MiniIconBtn icon="times" title={t("grade.weekly.close")} color="red" onPress={onClose}/>
|
|
22
26
|
</react_native_1.View>
|
|
23
27
|
</common_1.BaseModal>);
|
|
24
28
|
};
|
|
@@ -12,6 +12,7 @@ const stores_1 = require("@nakamura-123/stores");
|
|
|
12
12
|
const lib_1 = require("@nakamura-123/lib");
|
|
13
13
|
const DatePickerModal = ({ targetDay, isVisible, onClose, }) => {
|
|
14
14
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
15
16
|
const handleDateSelect = (day) => {
|
|
16
17
|
if (lib_1.timeFnc.compareToday(day.dateString) !== "future")
|
|
17
18
|
return;
|
|
@@ -22,7 +23,7 @@ const DatePickerModal = ({ targetDay, isVisible, onClose, }) => {
|
|
|
22
23
|
const month = date.getMonth() + 1; // 月を取得(0ベースのため +1)
|
|
23
24
|
const year = date.getFullYear(); // 年を取得
|
|
24
25
|
return (<common_1.MyText style={styles.headerText}>
|
|
25
|
-
{year
|
|
26
|
+
{t("grade.calendar.yearMonth", { year, month })}
|
|
26
27
|
</common_1.MyText>);
|
|
27
28
|
};
|
|
28
29
|
return (<common_1.CloseBtnModal isVisible={isVisible} onClose={onClose}>
|
|
@@ -52,7 +52,7 @@ const getTargetDayStr = (targetDay, t) => {
|
|
|
52
52
|
if (limitDays < 0)
|
|
53
53
|
return t("grade.gradeCard.pleaseSetTxt");
|
|
54
54
|
const formattedDate = lib_1.timeFnc.formatDateYW(targetDay);
|
|
55
|
-
return
|
|
55
|
+
return t("grade.untilExam", { date: formattedDate, days: limitDays });
|
|
56
56
|
};
|
|
57
57
|
const styles = react_native_1.StyleSheet.create({
|
|
58
58
|
container: {
|
|
@@ -33,6 +33,7 @@ const lib_1 = require("@nakamura-123/lib");
|
|
|
33
33
|
const gradeFnc_1 = require("../../functions/gradeFnc");
|
|
34
34
|
const ChartControl_1 = __importDefault(require("../TestPage/ChartControl"));
|
|
35
35
|
const QuizCntGraph = ({ DailyLogDB }) => {
|
|
36
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
36
37
|
const [isDaily, setIsDaily] = (0, react_1.useState)(true);
|
|
37
38
|
const [graphData, setGraphData] = (0, react_1.useState)([]);
|
|
38
39
|
const [agoDateCnt, setAgoDateCnt] = (0, react_1.useState)(0);
|
|
@@ -56,7 +57,7 @@ const QuizCntGraph = ({ DailyLogDB }) => {
|
|
|
56
57
|
const handleRight = () => isDaily ? setAgoDateCnt(agoDateCnt - 1) : setAgoWeekCnt(agoWeekCnt - 1);
|
|
57
58
|
const showLeft = isDaily ? agoDateCnt < 30 : agoWeekCnt < 5;
|
|
58
59
|
const showRight = agoDateCnt > 0 || agoWeekCnt > 0;
|
|
59
|
-
const title =
|
|
60
|
+
const title = t("grade.graphTotal", { cnt: sumWeeklyQuizCnts });
|
|
60
61
|
return (<react_native_1.View style={styles.container}>
|
|
61
62
|
<ChartControl_1.default title={title} onPressLeft={handleLeft} onPressRight={handleRight} showLeft={showLeft} showRight={showRight}/>
|
|
62
63
|
<common_1.BarChart data={graphData} width={25} maxValue={100} isPercent={false}/>
|
|
@@ -21,25 +21,25 @@ const Square4s = ({ DailyLogDB }) => {
|
|
|
21
21
|
const squareInfo = [
|
|
22
22
|
{
|
|
23
23
|
cnt: maxQuizCnt,
|
|
24
|
-
cntText: "
|
|
24
|
+
cntText: t("count.question"),
|
|
25
25
|
label: t("grade.square4s.maxQuizCnt"),
|
|
26
26
|
icon: "clock",
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
cnt: totalCnt,
|
|
30
|
-
cntText: "
|
|
30
|
+
cntText: t("count.question"),
|
|
31
31
|
label: t("grade.square4s.totalCnt"),
|
|
32
32
|
icon: "layer-group",
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
cnt: longestConsecutiveDays,
|
|
36
|
-
cntText: "
|
|
36
|
+
cntText: t("count.day"),
|
|
37
37
|
label: t("grade.square4s.longestConsecutiveDays"),
|
|
38
38
|
icon: "calendar-alt",
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
cnt: studyDayCnt,
|
|
42
|
-
cntText: "
|
|
42
|
+
cntText: t("count.day"),
|
|
43
43
|
label: t("grade.square4s.studyDayCnt"),
|
|
44
44
|
icon: "calendar",
|
|
45
45
|
},
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Results } from "realm";
|
|
3
|
+
import { EngineOps } from "../../engine";
|
|
3
4
|
type Props = {
|
|
4
|
-
|
|
5
|
+
ops: EngineOps;
|
|
6
|
+
query: Results<any>;
|
|
5
7
|
};
|
|
6
8
|
declare const UnitCircles: React.FC<Props>;
|
|
7
9
|
export default UnitCircles;
|
|
@@ -6,18 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
8
|
const react_redux_1 = require("react-redux");
|
|
9
|
-
const tagFncJ_1 = require("../../functions/tagFncJ");
|
|
10
9
|
const tagFncD_1 = require("../../functions/tagFncD");
|
|
11
10
|
const SubCategoryLeft_1 = __importDefault(require("../Basic/SubCategoryLeft"));
|
|
12
11
|
const lib_1 = require("@nakamura-123/lib");
|
|
13
12
|
const common_1 = require("@nakamura-123/common");
|
|
14
|
-
const UnitCircles = ({
|
|
13
|
+
const UnitCircles = ({ ops, query }) => {
|
|
15
14
|
const unitList = (0, react_redux_1.useSelector)((state) => state.app.unitList);
|
|
16
15
|
const outOfYearRange = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange);
|
|
17
16
|
const circleInfos = unitList.map(({ key, title }) => {
|
|
18
|
-
const tags =
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
const tags = ops.gradeCircleTagLevels(query, {
|
|
18
|
+
axis: "unit",
|
|
19
|
+
key,
|
|
20
|
+
outOfYearRange,
|
|
21
|
+
});
|
|
21
22
|
const rate = Math.round((0, tagFncD_1.getCategoryRate)(tags));
|
|
22
23
|
return { title, rate };
|
|
23
24
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Results } from "realm";
|
|
3
|
+
import { EngineOps } from "../../engine";
|
|
3
4
|
type Props = {
|
|
4
|
-
|
|
5
|
+
ops: EngineOps;
|
|
6
|
+
query: Results<any>;
|
|
5
7
|
};
|
|
6
8
|
declare const YearCircles: React.FC<Props>;
|
|
7
9
|
export default YearCircles;
|
|
@@ -6,17 +6,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
7
|
const react_native_1 = require("react-native");
|
|
8
8
|
const react_redux_1 = require("react-redux");
|
|
9
|
-
const tagFncJ_1 = require("../../functions/tagFncJ");
|
|
10
9
|
const tagFncD_1 = require("../../functions/tagFncD");
|
|
11
10
|
const SubCategoryLeft_1 = __importDefault(require("../Basic/SubCategoryLeft"));
|
|
12
11
|
const lib_1 = require("@nakamura-123/lib");
|
|
13
12
|
const common_1 = require("@nakamura-123/common");
|
|
14
|
-
const YearCircles = ({
|
|
13
|
+
const YearCircles = ({ ops, query }) => {
|
|
15
14
|
const yearList = (0, react_redux_1.useSelector)((state) => state.app.yearList);
|
|
16
15
|
const circleInfos = yearList.map(({ key, title }) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
:
|
|
16
|
+
// 年度の円は試験範囲外の年度で絞らない
|
|
17
|
+
const tags = ops.gradeCircleTagLevels(query, {
|
|
18
|
+
axis: "year",
|
|
19
|
+
key,
|
|
20
|
+
outOfYearRange: [],
|
|
21
|
+
});
|
|
20
22
|
const rate = Math.round((0, tagFncD_1.getCategoryRate)(tags));
|
|
21
23
|
return { title, rate };
|
|
22
24
|
});
|
|
@@ -38,6 +38,7 @@ const isDocked = (metrics) => {
|
|
|
38
38
|
return Math.abs(metrics.screenY + metrics.height - screenHeight) < 1;
|
|
39
39
|
};
|
|
40
40
|
const KeyboardCloseBar = () => {
|
|
41
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
41
42
|
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
42
43
|
const isFocused = (0, native_1.useIsFocused)();
|
|
43
44
|
const [keyboardHeight, setKeyboardHeight] = (0, react_1.useState)(null);
|
|
@@ -64,7 +65,7 @@ const KeyboardCloseBar = () => {
|
|
|
64
65
|
// 画面全体がSafeAreaViewの内側にあるぶん、このバーの座標系は画面下端より insets.bottom 高い
|
|
65
66
|
const bottom = Math.max(0, keyboardHeight - insets.bottom);
|
|
66
67
|
return (<react_native_1.TouchableOpacity style={[styles.container, { bottom }]} activeOpacity={0.7} onPress={() => react_native_1.Keyboard.dismiss()}>
|
|
67
|
-
<common_1.MyText fsize="sm"
|
|
68
|
+
<common_1.MyText fsize="sm">{t("basic.closeKeyboard")}</common_1.MyText>
|
|
68
69
|
</react_native_1.TouchableOpacity>);
|
|
69
70
|
};
|
|
70
71
|
const styles = react_native_1.StyleSheet.create({
|
|
@@ -27,21 +27,20 @@ const react_1 = __importStar(require("react"));
|
|
|
27
27
|
const react_native_1 = require("react-native");
|
|
28
28
|
const react_redux_1 = require("react-redux");
|
|
29
29
|
const common_1 = require("@nakamura-123/common");
|
|
30
|
-
const lib_1 = require("@nakamura-123/lib");
|
|
31
30
|
const stores_1 = require("@nakamura-123/stores");
|
|
31
|
+
const engine_1 = require("../../engine");
|
|
32
|
+
const basicHook_1 = require("../../hooks/basicHook");
|
|
32
33
|
const QuizOption = ({}) => {
|
|
33
34
|
const { t } = (0, common_1.useDrillTranslation)();
|
|
34
35
|
// 設定の選択
|
|
35
36
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
36
37
|
const selected = (0, react_redux_1.useSelector)((state) => state.quiz.selected);
|
|
37
38
|
const noShuffle = selected.lesson.noShuffle;
|
|
38
|
-
const system = selected.system || "drill";
|
|
39
39
|
const storeOption = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.option);
|
|
40
40
|
const handleSelect = (type, value) => {
|
|
41
41
|
dispatch(stores_1.cfgAction.selectOption({ key: type, value }));
|
|
42
42
|
};
|
|
43
|
-
const
|
|
44
|
-
let quizOption = system === "drill" ? lib_1.startOption.dQuizStartOption : jQuizStartOption;
|
|
43
|
+
const quizOption = engine_1.engines[(0, basicHook_1.useQuizEngine)()].startOptions(selected.system);
|
|
45
44
|
(0, react_1.useEffect)(() => {
|
|
46
45
|
if (noShuffle)
|
|
47
46
|
dispatch(stores_1.cfgAction.selectOption({ key: "isShuffle", value: false }));
|
|
@@ -70,14 +69,4 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
70
69
|
marginLeft: 5,
|
|
71
70
|
},
|
|
72
71
|
});
|
|
73
|
-
function removeOptionByValue(quizSystem) {
|
|
74
|
-
if (quizSystem !== "JlptListen")
|
|
75
|
-
return lib_1.startOption.jQuizStartOption;
|
|
76
|
-
const jOption = lib_1.startOption.jQuizStartOption;
|
|
77
|
-
const TARGET_VALUE = "selectJapanese";
|
|
78
|
-
const newOptions = jOption.map((optionGroup) => {
|
|
79
|
-
return Object.assign(Object.assign({}, optionGroup), { options: optionGroup.options.filter((opt) => opt !== TARGET_VALUE) });
|
|
80
|
-
});
|
|
81
|
-
return newOptions;
|
|
82
|
-
}
|
|
83
72
|
exports.default = QuizOption;
|