@nakamura-123/pages 0.1.1 → 0.1.2

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.
@@ -37,12 +37,16 @@ var TagBadge5s_1 = __importDefault(require("../TagBadge5s"));
37
37
  var SubCategoryList_1 = __importDefault(require("../SubCategoryList"));
38
38
  var MiniTestCard_1 = __importDefault(require("../MiniTestCard"));
39
39
  var BasicSetting_1 = __importDefault(require("../BasicSetting"));
40
+ var Guide_1 = __importDefault(require("../Guide"));
40
41
  var BasicPage = function (_a) {
41
42
  var navigation = _a.navigation, subject = _a.subject, index = _a.index;
42
43
  var dispatch = (0, react_redux_1.useDispatch)();
43
44
  // // Reduxから必要なデータを一括取得
44
45
  var categoryList = (0, react_redux_1.useSelector)(function (state) { return state.app[subject.list]; });
45
46
  var activeIndex = (0, react_redux_1.useSelector)(function (state) { return state.setting.viewSet[subject.name].activeIndex; });
47
+ var guide = (0, react_redux_1.useSelector)(function (state) { return state.setting.guide; });
48
+ var isShowGuide = guide.basicPageNav || guide.basicPageSwipe;
49
+ var guideName = guide.basicPageNav ? "basicPageNav" : "basicPageSwipe";
46
50
  // 選択されたカテゴリー情報を取得
47
51
  var selectedList = categoryList[index];
48
52
  // カテゴリー名を計算
@@ -89,6 +93,9 @@ var BasicPage = function (_a) {
89
93
  if (activeIndex !== index)
90
94
  return null;
91
95
  return (<react_native_gesture_handler_1.ScrollView style={styles.scrollContainer} contentContainerStyle={styles.container} showsVerticalScrollIndicator={false} ref={scrollViewRef} onMomentumScrollEnd={handleEndScroll}>
96
+ <Guide_1.default name={guideName} isVisible={isShowGuide}>
97
+ <react_native_1.View style={styles.navBar}/>
98
+ </Guide_1.default>
92
99
  <common_1.RoundRectangle title={categoryName} style={styles.categoryName}/>
93
100
  <common_1.HelpMark name="basicList" marginTop={20} top={-23}/>
94
101
  <SubCategoryList_1.default navigation={navigation} subject={subject} index={index}/>
@@ -103,6 +110,7 @@ var BasicPage = function (_a) {
103
110
  </react_native_gesture_handler_1.ScrollView>);
104
111
  };
105
112
  var styles = react_native_1.StyleSheet.create({
113
+ navBar: {},
106
114
  scrollContainer: {
107
115
  padding: 20,
108
116
  },
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- 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);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -42,32 +42,32 @@ var toolkit_1 = require("@reduxjs/toolkit");
42
42
  var CoinFnc_1 = require("./CoinFnc");
43
43
  var stores_1 = require("@nakamura-123/stores");
44
44
  // 00.メイン関数
45
- exports.coinCheckFnc = (0, toolkit_1.createAsyncThunk)("coin/check", function (allFreeId_1, _a) { return __awaiter(void 0, [allFreeId_1, _a], void 0, function (allFreeId, _b) {
46
- var receipts, isExistedId, todayStr;
47
- var dispatch = _b.dispatch;
48
- return __generator(this, function (_c) {
49
- switch (_c.label) {
50
- case 0: return [4 /*yield*/, (0, CoinFnc_1.restorePurchases)(dispatch, false)];
51
- case 1:
52
- receipts = _c.sent();
53
- isExistedId = hasPurchasedItems(receipts, allFreeId);
54
- if (!isExistedId) {
55
- // 返金などをされていて、flaseの場合、このIDのアイテムを削除し、store更新
56
- stores_1.coinStorage.removePurchasedItem(allFreeId);
57
- dispatch({ type: "setting/updateAllFreeState", payload: "none" });
58
- }
59
- todayStr = lib_1.timeFnc.getTodayString();
60
- dispatch({ type: "setting/updateLastCheckedDate", payload: todayStr });
61
- return [2 /*return*/];
62
- }
45
+ exports.coinCheckFnc = (0, toolkit_1.createAsyncThunk)("coin/check", function (allFreeId, _a) {
46
+ var dispatch = _a.dispatch;
47
+ return __awaiter(void 0, void 0, void 0, function () {
48
+ var receipts, isExistedId;
49
+ return __generator(this, function (_b) {
50
+ switch (_b.label) {
51
+ case 0: return [4 /*yield*/, (0, CoinFnc_1.restorePurchases)(dispatch, false)];
52
+ case 1:
53
+ receipts = _b.sent();
54
+ isExistedId = hasPurchasedItems(receipts, allFreeId);
55
+ if (!isExistedId) {
56
+ // 返金などをされていて、flaseの場合、このIDのアイテムを削除し、store更新
57
+ stores_1.coinStorage.removePurchasedItem(allFreeId);
58
+ dispatch({ type: "setting/updateAllFreeState", payload: "none" });
59
+ }
60
+ return [2 /*return*/];
61
+ }
62
+ });
63
63
  });
64
- }); });
64
+ });
65
65
  // 91. 復元を行い、チェックが必要か判定
66
66
  var isCheckRequired = function (allFreeState, lastCheckedDate) {
67
67
  if (allFreeState === "none")
68
68
  return false;
69
- var inThisWeek = lib_1.timeFnc.isWithinWeek(lastCheckedDate);
70
- if (inThisWeek && allFreeState === "paid")
69
+ var isOver3Days = lib_1.timeFnc.isOver3Days(lastCheckedDate);
70
+ if (!isOver3Days && allFreeState === "paid")
71
71
  return false;
72
72
  return true;
73
73
  };
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- 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);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -35,12 +35,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
39
  exports.updateAllFreeState = exports.restorePurchases = exports.handlePurchase = exports.initializeIAP = void 0;
43
- var netinfo_1 = __importDefault(require("@react-native-community/netinfo")); // ネットワーク状態確認用ライブラリ
44
40
  var react_native_1 = require("react-native");
45
41
  var react_native_iap_1 = require("react-native-iap");
46
42
  var stores_1 = require("@nakamura-123/stores");
@@ -87,18 +83,13 @@ var handlePurchase = function (productId, dispatch) { return __awaiter(void 0, v
87
83
  var params, purchase, receipt, isValid, err_2;
88
84
  return __generator(this, function (_a) {
89
85
  switch (_a.label) {
90
- case 0: return [4 /*yield*/, isNetworkAvailable()];
91
- case 1:
92
- if (!(_a.sent())) {
93
- alert("インターネットに接続されていません。");
94
- throw new Error("インターネットに接続されていません。");
95
- }
86
+ case 0:
96
87
  params = react_native_1.Platform.OS === "ios" ? { sku: productId } : { skus: [productId] };
97
- _a.label = 2;
98
- case 2:
99
- _a.trys.push([2, 7, , 8]);
88
+ _a.label = 1;
89
+ case 1:
90
+ _a.trys.push([1, 6, , 7]);
100
91
  return [4 /*yield*/, (0, react_native_iap_1.requestPurchase)(params)];
101
- case 3:
92
+ case 2:
102
93
  purchase = _a.sent();
103
94
  dispatch(pushCoinLog({ title: "Purchase", log: purchase }));
104
95
  if (Array.isArray(purchase))
@@ -118,22 +109,22 @@ var handlePurchase = function (productId, dispatch) { return __awaiter(void 0, v
118
109
  dispatch(pushCoinWarn({ title: "購入検証に失敗しました", log: purchase }));
119
110
  throw new Error("購入検証に失敗しました");
120
111
  }
121
- if (!(react_native_1.Platform.OS === "android" && purchase.purchaseStateAndroid === 2)) return [3 /*break*/, 4];
112
+ if (!(react_native_1.Platform.OS === "android" && purchase.purchaseStateAndroid === 2)) return [3 /*break*/, 3];
122
113
  alert("手続きが完了しました。。支払いが完了したら、このページにある「以前購入した方はこちらから復元」をタップしてください。");
123
- return [3 /*break*/, 6];
124
- case 4: return [4 /*yield*/, (0, react_native_iap_1.finishTransaction)({ purchase: purchase, isConsumable: false })];
125
- case 5:
114
+ return [3 /*break*/, 5];
115
+ case 3: return [4 /*yield*/, (0, react_native_iap_1.finishTransaction)({ purchase: purchase, isConsumable: false })];
116
+ case 4:
126
117
  _a.sent();
127
118
  alert("購入が完了しました!");
128
- _a.label = 6;
129
- case 6: return [2 /*return*/, purchase]; // 成功時に購入データを返す
130
- case 7:
119
+ _a.label = 5;
120
+ case 5: return [2 /*return*/, purchase]; // 成功時に購入データを返す
121
+ case 6:
131
122
  err_2 = _a.sent();
132
123
  // エラー処理を整理
133
124
  dispatch(pushCoinError({ title: "購入処理中にエラーが発生しました", log: err_2 }));
134
125
  alert("購入に失敗しました。\nしばらく時間を置いた後、もう一度実行してみてください。もしそれでも購入できない場合は「よくある質問」をご確認いただくか、必要に応じて「お問い合わせフォーム」からご連絡ください。");
135
126
  return [2 /*return*/, null]; // 失敗時はnullを返す
136
- case 8: return [2 /*return*/];
127
+ case 7: return [2 /*return*/];
137
128
  }
138
129
  });
139
130
  }); };
@@ -144,58 +135,55 @@ var restorePurchases = function (dispatch, isAlert) { return __awaiter(void 0, v
144
135
  return __generator(this, function (_a) {
145
136
  switch (_a.label) {
146
137
  case 0:
147
- _a.trys.push([0, 9, , 10]);
148
- return [4 /*yield*/, isNetworkAvailable()];
149
- case 1:
150
- if (!(_a.sent())) {
151
- isAlert && alert("インターネットに接続されていません。");
152
- throw new Error("インターネットに接続されていません。");
153
- }
138
+ _a.trys.push([0, 8, , 9]);
139
+ console.log("restorePurchases");
154
140
  return [4 /*yield*/, (0, react_native_iap_1.getAvailablePurchases)()];
155
- case 2:
141
+ case 1:
156
142
  purchases = _a.sent();
143
+ console.log("purchases", purchases);
157
144
  dispatch(pushCoinLog({ title: "Purchases", log: purchases }));
158
145
  receipts = [];
159
146
  _i = 0, purchases_1 = purchases;
160
- _a.label = 3;
161
- case 3:
162
- if (!(_i < purchases_1.length)) return [3 /*break*/, 6];
147
+ _a.label = 2;
148
+ case 2:
149
+ if (!(_i < purchases_1.length)) return [3 /*break*/, 5];
163
150
  purchase = purchases_1[_i];
164
151
  receipt = (0, ReceiptFnc_1.unifyReceipt)(purchase);
165
152
  if (receipt) {
166
153
  dispatch((0, exports.updateAllFreeState)(receipt));
167
154
  receipts.push(receipt);
168
155
  }
169
- if (!checkNeedFinish(purchase)) return [3 /*break*/, 5];
156
+ if (!checkNeedFinish(purchase)) return [3 /*break*/, 4];
170
157
  return [4 /*yield*/, (0, react_native_iap_1.finishTransaction)({ purchase: purchase, isConsumable: false })];
171
- case 4:
158
+ case 3:
172
159
  _a.sent();
173
- _a.label = 5;
174
- case 5:
160
+ _a.label = 4;
161
+ case 4:
175
162
  _i++;
176
- return [3 /*break*/, 3];
177
- case 6:
163
+ return [3 /*break*/, 2];
164
+ case 5:
178
165
  if (receipts.length === 0)
179
166
  dispatch((0, exports.updateAllFreeState)(null)); // 購入アイテムがない場合はAllFreeの状態を更新
180
167
  dispatch(pushCoinLog({ title: "Receipts", log: receipts }));
181
- if (!(receipts.length > 0)) return [3 /*break*/, 8];
168
+ if (!(receipts.length > 0)) return [3 /*break*/, 7];
182
169
  return [4 /*yield*/, stores_1.coinStorage.replacePurchasedItems(receipts)];
183
- case 7:
170
+ case 6:
184
171
  _a.sent();
185
- _a.label = 8;
186
- case 8:
172
+ _a.label = 7;
173
+ case 7:
187
174
  isAlert &&
188
175
  (receipts.length > 0
189
176
  ? alert("購入アイテムを復元しました!")
190
177
  : alert("購入済みのアイテムがありませんでした"));
191
178
  return [2 /*return*/, receipts]; // 復元アイテムがあればpurchasesを返す
192
- case 9:
179
+ case 8:
193
180
  error_1 = _a.sent();
181
+ console.warn("Restore Error: ", error_1);
194
182
  dispatch(pushCoinError({ title: "購入復元に失敗しました", log: error_1 }));
195
183
  isAlert &&
196
184
  alert("購入アイテムの復元に失敗しました。しばらく時間を置いた後、もう一度実行してみてください。もしそれでも購入できない場合は「よくある質問」をご確認いただくか、必要に応じて「お問い合わせフォーム」からご連絡ください。");
197
185
  return [2 /*return*/, null]; // エラーが発生した場合もnullを返す
198
- case 10: return [2 /*return*/];
186
+ case 9: return [2 /*return*/];
199
187
  }
200
188
  });
201
189
  }); };
@@ -223,18 +211,3 @@ exports.updateAllFreeState = updateAllFreeState;
223
211
  var checkNeedFinish = function (purchase) {
224
212
  return purchase.purchaseStateAndroid === 1 && !purchase.isAcknowledgedAndroid;
225
213
  };
226
- // 93. ネットワーク状態の確認
227
- var isNetworkAvailable = function () { return __awaiter(void 0, void 0, void 0, function () {
228
- var state, isConnected, isInternetReachable;
229
- var _a, _b;
230
- return __generator(this, function (_c) {
231
- switch (_c.label) {
232
- case 0: return [4 /*yield*/, netinfo_1.default.fetch()];
233
- case 1:
234
- state = _c.sent();
235
- isConnected = (_a = state.isConnected) !== null && _a !== void 0 ? _a : false;
236
- isInternetReachable = (_b = state.isInternetReachable) !== null && _b !== void 0 ? _b : false;
237
- return [2 /*return*/, isConnected && isInternetReachable];
238
- }
239
- });
240
- }); };
@@ -10,7 +10,7 @@ var ChangeWeeklyModal = function (_a) {
10
10
  var visible = _a.visible, optionInfo = _a.optionInfo, handleChange = _a.handleChange, selectedValue = _a.selectedValue, onClose = _a.onClose;
11
11
  return (<common_1.BaseModal isVisible={visible} onClose={onClose}>
12
12
  <common_1.MyText fsize="lg">目標を選んでください</common_1.MyText>
13
- <react_native_1.FlatList data={optionInfo} keyExtractor={function (item) { return item.value.toString(); }} style={styles.listContainer} renderItem={function (_a) {
13
+ <react_native_1.FlatList data={optionInfo} keyExtractor={function (item) { return item.value.toString(); }} style={styles.listContainer} showsVerticalScrollIndicator={false} renderItem={function (_a) {
14
14
  var item = _a.item;
15
15
  var color = item.value === selectedValue ? "red" : "black";
16
16
  return (<react_native_1.TouchableOpacity onPress={function () { return handleChange(item.value); }} style={styles.option}>
@@ -20,6 +20,13 @@ var DatePickerModal = function (_a) {
20
20
  dispatch({ type: "setting/updateTargetDay", payload: day.dateString });
21
21
  dispatch(stores_1.settingStorage.saveSetting());
22
22
  };
23
+ var renderCustomHeader = function (date) {
24
+ var month = date.getMonth() + 1; // 月を取得(0ベースのため +1)
25
+ var year = date.getFullYear(); // 年を取得
26
+ return (<common_1.MyText style={styles.headerText}>
27
+ {year}年 {month}月
28
+ </common_1.MyText>);
29
+ };
23
30
  return (<common_1.CloseBtnModal isVisible={isVisible} onClose={onClose}>
24
31
  <react_native_1.View style={styles.container}>
25
32
  <react_native_calendars_1.Calendar onDayPress={handleDateSelect} // 日付選択イベント
@@ -29,7 +36,8 @@ var DatePickerModal = function (_a) {
29
36
  marked: true,
30
37
  selectedColor: lib_1.colors.red,
31
38
  },
32
- _b} theme={{
39
+ _b} renderHeader={renderCustomHeader} // ヘッダーをカスタマイズ
40
+ theme={{
33
41
  calendarBackground: "white",
34
42
  selectedDayBackgroundColor: lib_1.colors.red,
35
43
  todayTextColor: lib_1.colors.red,
@@ -49,10 +57,11 @@ var styles = react_native_1.StyleSheet.create({
49
57
  alignItems: "center",
50
58
  height: "65%",
51
59
  },
52
- btnBox: {
53
- flexDirection: "row",
54
- justifyContent: "space-around",
55
- marginTop: 20,
60
+ headerText: {
61
+ fontSize: 18,
62
+ fontWeight: "bold",
63
+ color: lib_1.colors.text,
64
+ textAlign: "center",
56
65
  },
57
66
  });
58
67
  exports.default = DatePickerModal;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { Store } from "@nakamura-123/types";
3
+ interface GuideProps {
4
+ children: React.ReactNode;
5
+ isVisible?: boolean;
6
+ name: keyof Store.GuideType;
7
+ }
8
+ declare const Guide: React.FC<GuideProps>;
9
+ export default Guide;
@@ -0,0 +1,40 @@
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 common_1 = require("@nakamura-123/common");
7
+ var react_1 = __importDefault(require("react"));
8
+ var NAV_GUIDE_MSG = "タブをスクロールして、項目も選択してください。また左右のスワイプでも移動することができます。";
9
+ var SWIPE_GUIDE_MSG = "ページ内を左右にスワイプすることでも、他の項目に移動できます。";
10
+ var GUIDE_MSG1 = "画面内の任意の場所を左にスワイプすることで、次の問題に進むことができます。";
11
+ var GUIDE_MSG2 = "画面内の任意の場所を右にスワイプすることで、前の問題に戻ることができます。";
12
+ var GUIDE_MSG_TAG = "ここで「ふせん」を手動で選択することもできます。また、右端のボタンで次の問題へ進みます。";
13
+ var TAG_GUIDE_MSG = "ここをタップすると、「ふせん」の種類によって出題範囲を変更することができます。";
14
+ // ガイド情報を取得
15
+ var getGuideInfo = function (guideName) {
16
+ switch (guideName) {
17
+ case "basicPageNav":
18
+ return { msg: NAV_GUIDE_MSG, name: "basicPageNav", position: "bottom" };
19
+ case "basicPageSwipe":
20
+ return { msg: SWIPE_GUIDE_MSG, name: "basicPageSwipe", position: "left" };
21
+ case "setupPageTag":
22
+ return { msg: TAG_GUIDE_MSG, name: "setupPageTag", position: "bottom" };
23
+ case "quizPageTag":
24
+ return { msg: GUIDE_MSG_TAG, name: "quizPageTag", position: "top" };
25
+ case "quizPageSwipe1":
26
+ return { msg: GUIDE_MSG1, name: "quizPageSwipe1", position: "bottom" };
27
+ case "quizPageSwipe2":
28
+ return { msg: GUIDE_MSG2, name: "quizPageSwipe2", position: "bottom" };
29
+ default:
30
+ return { msg: NAV_GUIDE_MSG, name: "basicPageNav", position: "bottom" };
31
+ }
32
+ };
33
+ var Guide = function (_a) {
34
+ var children = _a.children, name = _a.name, isVisible = _a.isVisible;
35
+ var guideInfo = getGuideInfo(name);
36
+ return (<common_1.Tooltip content={guideInfo.msg} isVisible={isVisible} placement={guideInfo.position} guideName={guideInfo.name}>
37
+ {children}
38
+ </common_1.Tooltip>);
39
+ };
40
+ exports.default = Guide;
@@ -11,6 +11,7 @@ var lib_1 = require("@nakamura-123/lib");
11
11
  var CaraCard = function (_a) {
12
12
  var scoreInfo = _a.scoreInfo;
13
13
  var imgs = (0, react_redux_1.useSelector)(function (state) { return state.app.imgs; });
14
+ var showCharactor = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.showCharactor; }) || false;
14
15
  var imgPath = imgs.chara.lv1;
15
16
  // 正答割合を取得
16
17
  var percent = scoreInfo.percent;
@@ -22,7 +23,7 @@ var CaraCard = function (_a) {
22
23
  return (<react_native_1.View style={styles.container}>
23
24
  <common_1.MyText style={styles.title}>{enTitle}</common_1.MyText>
24
25
  <common_1.MyText color="gray">{jpTitle}</common_1.MyText>
25
- <react_native_1.Image style={styles.imgBox} source={imgPath}/>
26
+ {showCharactor && <react_native_1.Image style={styles.imgBox} source={imgPath}/>}
26
27
  </react_native_1.View>);
27
28
  };
28
29
  var styles = react_native_1.StyleSheet.create({
@@ -18,14 +18,22 @@ var QuizFlatList = function (_a) {
18
18
  var id = String(quiz.yearId) + String(quiz.num);
19
19
  var question = "(".concat(i + 1, ") ").concat(quiz.question[0]);
20
20
  var color = lib_1.tagLevels.filter(function (item) { return item.level === quiz.tag; })[0].color;
21
- return { id: id, question: question, color: color, index: i };
21
+ var isCorrected = quiz.isCorrected;
22
+ return { id: id, question: question, color: color, index: i, isCorrected: isCorrected };
22
23
  });
23
24
  // 02_リストアイテムのレンダリング
24
25
  var renderItem = function (_a) {
25
26
  var item = _a.item;
26
27
  var text = item.question.replace(/zz/g, " 空欄");
28
+ var icon = item.isCorrected ? "circle" : "times";
29
+ var iconColor = item.isCorrected ? "red" : "blue";
27
30
  return (<react_native_1.TouchableOpacity style={styles.itemContainer} activeOpacity={0.7} onPress={function () { return handlePress(item.index); }}>
28
- <common_1.IconInCircle name="tag" circleColor={item.color} size={11} iconColor="white"/>
31
+ <react_native_1.View>
32
+ <common_1.IconInCircle name="tag" circleColor={item.color} size={11} iconColor="white"/>
33
+ <react_native_1.View style={{ position: "absolute", top: -5, right: -5 }}>
34
+ <common_1.Icon5 name={icon} size={11} color={iconColor}/>
35
+ </react_native_1.View>
36
+ </react_native_1.View>
29
37
  <react_native_1.View style={styles.questionBox}>
30
38
  <MyTextqqyy_1.default isNotSearch fsize="xs">
31
39
  {text}
@@ -15,7 +15,12 @@ var TagBadge5sPress = function (_a) {
15
15
  var tagActives = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.startCfg.tags; });
16
16
  var tagInfos = (0, tagFnc_1.countTagsByLevelSelected)(categoryTags, tagActives);
17
17
  return (<react_native_1.View style={styles.container}>
18
- {tagInfos.map(function (tag, i) { return (<common_1.Badge key={i} name={String(tag.cnt)} icon={"tag"} circleColor={tag.circle} badgeColor={tag.badge} iconColor={tag.icon} onPress={function () { return dispatch(stores_1.cfgAction.changeTagActive(tag.level)); }}/>); })}
18
+ {tagInfos.map(function (tag, i) { return (<react_native_1.View key={i} style={{ alignItems: "center" }}>
19
+ <common_1.Badge name={String(tag.cnt)} icon={"tag"} circleColor={tag.circle} badgeColor={tag.badge} iconColor={tag.icon} onPress={function () { return dispatch(stores_1.cfgAction.changeTagActive(tag.level)); }}/>
20
+ <common_1.MyText fsize="xs" style={styles.txt}>
21
+ {tag.circle === "white" ? "OFF" : "ON"}
22
+ </common_1.MyText>
23
+ </react_native_1.View>); })}
19
24
  </react_native_1.View>);
20
25
  };
21
26
  var styles = react_native_1.StyleSheet.create({
@@ -25,5 +30,8 @@ var styles = react_native_1.StyleSheet.create({
25
30
  width: "100%",
26
31
  marginBottom: 10,
27
32
  },
33
+ txt: {
34
+ marginTop: 3,
35
+ },
28
36
  });
29
37
  exports.default = TagBadge5sPress;
@@ -22,7 +22,8 @@ var getBasicQuizList = function (QuestionDB, startCfg, selected) {
22
22
  var key = lesson.key;
23
23
  if (key === 0)
24
24
  questions = (0, questionFilter_1.getYearQuestions)(QuestionDB, category);
25
- questions = (0, questionFilter_1.getSubYearQuestions)(QuestionDB, category, key);
25
+ else
26
+ questions = (0, questionFilter_1.getSubYearQuestions)(QuestionDB, category, key);
26
27
  }
27
28
  // 04_タグによる絞り込み
28
29
  questions = (0, questionFilter_1.filterByTags)(questions, startCfg);
@@ -0,0 +1,4 @@
1
+ import Realm from "realm";
2
+ import { ASetting } from "@nakamura-123/types";
3
+ import { AppDispatch } from "@nakamura-123/stores";
4
+ export declare const handleOldData: (realm: Realm, oldInfo: ASetting.OldInfo, dispatch: AppDispatch, msg?: string) => Promise<void>;