@nakamura-123/pages 1.1.15 → 1.1.18
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 -28
- 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 +33 -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 -55
- package/dist/hooks/quizHook.js +43 -44
- 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 +35 -50
- 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
|
@@ -1,51 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return __assign(__assign({}, badge), { isExist: isExist });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_2 = require("@realm/react");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const db_1 = require("@nakamura-123/db");
|
|
12
|
+
const Badge5s = ({ badgeType, subject, category }) => {
|
|
13
|
+
const BadgesDB = (0, react_2.useQuery)(db_1.BadgeSchema);
|
|
14
|
+
const badge5s = lib_1.badgeSet.badge5Sets[badgeType];
|
|
15
|
+
const badge5sInfos = badge5s.map((badge) => {
|
|
16
|
+
const matchingBadges = getBadge(BadgesDB, subject, badge.id, category);
|
|
17
|
+
const isExist = matchingBadges.length > 0;
|
|
18
|
+
return Object.assign(Object.assign({}, badge), { isExist });
|
|
31
19
|
});
|
|
32
20
|
return (<>
|
|
33
21
|
<react_native_1.View style={styles.container}>
|
|
34
|
-
{badge5sInfos.map(
|
|
22
|
+
{badge5sInfos.map((badge) => (<common_1.Badge key={badge.id} name={badge.name} icon={badge.icon} badgeColor={badge.color} isEmpty={!badge.isExist}/>))}
|
|
35
23
|
</react_native_1.View>
|
|
36
24
|
</>);
|
|
37
25
|
};
|
|
38
|
-
|
|
26
|
+
const getBadge = (BadgesDB, subject, badgeId, category) => {
|
|
39
27
|
if (!category) {
|
|
40
|
-
|
|
28
|
+
const badges = BadgesDB.filtered("subject == $0 AND badgeId == $1", subject, badgeId);
|
|
41
29
|
return badges;
|
|
42
30
|
}
|
|
43
31
|
else {
|
|
44
|
-
|
|
32
|
+
const badges = BadgesDB.filtered("subject == $0 AND category == $1 AND badgeId == $2", subject, String(category), badgeId);
|
|
45
33
|
return badges;
|
|
46
34
|
}
|
|
47
35
|
};
|
|
48
|
-
|
|
36
|
+
const styles = react_native_1.StyleSheet.create({
|
|
49
37
|
container: {
|
|
50
38
|
flexDirection: "row",
|
|
51
39
|
justifyContent: "space-between",
|
|
@@ -26,62 +26,61 @@ 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
|
-
|
|
45
|
-
|
|
46
|
-
var t = (0, common_1.useDrillTranslation)().t;
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
32
|
+
const react_redux_1 = require("react-redux");
|
|
33
|
+
const common_1 = require("@nakamura-123/common");
|
|
34
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
35
|
+
const Badge5s_1 = __importDefault(require("./Badge5s"));
|
|
36
|
+
const TagBadge5s_1 = __importDefault(require("../TagBadge5s"));
|
|
37
|
+
const SubCategoryList_1 = __importDefault(require("./SubCategoryList"));
|
|
38
|
+
const MiniTestCard_1 = __importDefault(require("./MiniTestCard"));
|
|
39
|
+
const BasicSetting_1 = __importDefault(require("./BasicSetting"));
|
|
40
|
+
const Guide_1 = __importDefault(require("../Guide"));
|
|
41
|
+
const SelectedExamCnt_1 = __importDefault(require("./SelectedExamCnt"));
|
|
42
|
+
const BasicProgressBar_1 = __importDefault(require("./BasicProgressBar"));
|
|
43
|
+
const BasicPage = ({ navigation, subject, index }) => {
|
|
44
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
45
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
47
46
|
// // Reduxから必要なデータを一括取得
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const categoryList = (0, react_redux_1.useSelector)((state) => state.app[subject.list]);
|
|
48
|
+
const activeIndex = (0, react_redux_1.useSelector)((state) => state.setting.viewSet[subject.name].activeIndex);
|
|
49
|
+
const guide = (0, react_redux_1.useSelector)((state) => state.setting.guide);
|
|
50
|
+
const isShowGuide = guide.basicPageNav || guide.basicPageSwipe;
|
|
51
|
+
const guideName = guide.basicPageNav ? "basicPageNav" : "basicPageSwipe";
|
|
53
52
|
// 選択されたカテゴリー情報を取得
|
|
54
|
-
|
|
53
|
+
const selectedList = categoryList[index];
|
|
55
54
|
// カテゴリー名を計算
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
const categoryName = `${selectedList.label} ${selectedList.title}`.trim();
|
|
56
|
+
const selectKey = selectedList.key;
|
|
57
|
+
const categoryLabel = selectedList.label + selectedList.title;
|
|
58
|
+
const initScrollY = (0, react_redux_1.useSelector)((state) => state.setting.viewSet[subject.name].scrollY);
|
|
59
|
+
const scrollViewRef = (0, react_1.useRef)(null);
|
|
61
60
|
// 移動を監視
|
|
62
|
-
|
|
63
|
-
(0, react_1.useEffect)(
|
|
61
|
+
const [isReady, setIsReady] = (0, react_1.useState)(false);
|
|
62
|
+
(0, react_1.useEffect)(() => {
|
|
64
63
|
if (scrollViewRef.current)
|
|
65
64
|
setIsReady(true); // 準備完了
|
|
66
65
|
}, [scrollViewRef.current]); // scrollViewRef.current の変更を監視
|
|
67
|
-
(0, react_1.useEffect)(
|
|
66
|
+
(0, react_1.useEffect)(() => {
|
|
68
67
|
var _a;
|
|
69
68
|
if (isReady)
|
|
70
69
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({ y: initScrollY, animated: false });
|
|
71
70
|
}, [isReady]);
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const handleEndScroll = (event) => {
|
|
72
|
+
const scrollY = event.nativeEvent.contentOffset.y;
|
|
74
73
|
dispatch({ type: "setting/setScrollY", payload: scrollY });
|
|
75
74
|
};
|
|
76
75
|
// 全問スタートのハンドラー関数
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const isLocked = common_1.commonHook.useIsLocked(subject.type, selectKey);
|
|
77
|
+
const allQuizIcon = isLocked ? "lock" : "pencil-alt";
|
|
78
|
+
const handleAllQuiz = () => {
|
|
80
79
|
if (isLocked) {
|
|
81
80
|
navigation.navigate("Coin");
|
|
82
81
|
return;
|
|
83
82
|
}
|
|
84
|
-
|
|
83
|
+
const ALL_NUM = 0;
|
|
85
84
|
dispatch(stores_1.quizAction.setLesson({
|
|
86
85
|
subject: subject.name,
|
|
87
86
|
type: subject.type,
|
|
@@ -117,7 +116,7 @@ var BasicPage = function (_a) {
|
|
|
117
116
|
<BasicSetting_1.default navigation={navigation} subjectType={subject.type}/>
|
|
118
117
|
</react_native_gesture_handler_1.ScrollView>);
|
|
119
118
|
};
|
|
120
|
-
|
|
119
|
+
const styles = react_native_1.StyleSheet.create({
|
|
121
120
|
navBar: {},
|
|
122
121
|
scrollContainer: {
|
|
123
122
|
padding: 20,
|
|
@@ -3,25 +3,24 @@ 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
|
-
var outOfYearRange = subject.type === "unit" ? outOfYearRangeStore : undefined;
|
|
6
|
+
const common_1 = require("@nakamura-123/common");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const basicHook_1 = require("../../hooks/basicHook");
|
|
11
|
+
const tagFncJ_1 = require("../../functions/tagFncJ");
|
|
12
|
+
const tagFncD_1 = require("../../functions/tagFncD");
|
|
13
|
+
const BasicProgressBar = ({ subject, index }) => {
|
|
14
|
+
const selectKey = (0, react_redux_1.useSelector)((state) => state.app[subject.list][index].key);
|
|
15
|
+
const outOfYearRangeStore = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange);
|
|
16
|
+
const outOfYearRange = subject.type === "unit" ? outOfYearRangeStore : undefined;
|
|
18
17
|
// Realm データベースクエリ
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const QuestionDBInfo = (0, basicHook_1.useGetQuestionQuery)();
|
|
19
|
+
const getCategoryTags = QuestionDBInfo.system === "JLPT"
|
|
21
20
|
? (0, tagFncJ_1.getCategoryTagLevelCntsJ)(QuestionDBInfo.query, selectKey, subject.tag)
|
|
22
21
|
: (0, tagFncD_1.getCategoryTagLevelCntsD)(QuestionDBInfo.query, selectKey, subject.type, outOfYearRange);
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const rate = Math.round((0, tagFncD_1.getCategoryRate)(getCategoryTags));
|
|
23
|
+
const progressColor = rate > 85 ? "red" : rate > 70 ? "green" : rate > 50 ? "yellow" : "blue";
|
|
25
24
|
return (<react_native_1.View style={styles.container}>
|
|
26
25
|
<react_native_1.View style={styles.progressBox}>
|
|
27
26
|
<common_1.ProgressBar progress={rate} barColor={progressColor} height={20}/>
|
|
@@ -31,7 +30,7 @@ var BasicProgressBar = function (_a) {
|
|
|
31
30
|
</react_native_1.View>
|
|
32
31
|
</react_native_1.View>);
|
|
33
32
|
};
|
|
34
|
-
|
|
33
|
+
const styles = react_native_1.StyleSheet.create({
|
|
35
34
|
container: {
|
|
36
35
|
// marginTop: 10,
|
|
37
36
|
// marginBottom: 5,
|
|
@@ -3,26 +3,25 @@ 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
|
-
var isRange = isRangeYear && isUnit && !isJLPT;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_redux_1 = require("react-redux");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const Range_1 = __importDefault(require("../SettingBtns/Range"));
|
|
11
|
+
const BasicSetting = ({ navigation, subjectType, }) => {
|
|
12
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
13
|
+
const isRangeYear = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.basic.isRangeYearInUnit; });
|
|
14
|
+
const isJLPT = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem) === "JLPT";
|
|
15
|
+
const isUnit = subjectType === "unit";
|
|
16
|
+
const isRange = isRangeYear && isUnit && !isJLPT;
|
|
18
17
|
return (<react_native_1.View style={styles.row}>
|
|
19
|
-
<common_1.SettingBtn icon="envelope" title={t("basic.setting.report")} onPress={
|
|
18
|
+
<common_1.SettingBtn icon="envelope" title={t("basic.setting.report")} onPress={() => navigation.navigate("Report")}/>
|
|
20
19
|
|
|
21
20
|
{isRange && <Range_1.default />}
|
|
22
|
-
<common_1.SettingBtn icon="chart-line" title={t("basic.setting.grade")} onPress={
|
|
21
|
+
<common_1.SettingBtn icon="chart-line" title={t("basic.setting.grade")} onPress={() => navigation.navigate("Grade")}/>
|
|
23
22
|
</react_native_1.View>);
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
const styles = react_native_1.StyleSheet.create({
|
|
26
25
|
row: {
|
|
27
26
|
width: 250,
|
|
28
27
|
flexDirection: "row",
|
|
@@ -26,39 +26,38 @@ 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
|
-
var t = (0, common_1.useDrillTranslation)().t;
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const common_1 = require("@nakamura-123/common");
|
|
32
|
+
const react_2 = require("@realm/react");
|
|
33
|
+
const react_redux_1 = require("react-redux");
|
|
34
|
+
const db_1 = require("@nakamura-123/db");
|
|
35
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
36
|
+
const testFnc_1 = require("../../functions/testFnc");
|
|
37
|
+
const createQuizFncD_1 = require("../../functions/createQuizFncD");
|
|
38
|
+
const Paw5s_1 = __importDefault(require("./Paw5s"));
|
|
39
|
+
const basicHook_1 = require("../../hooks/basicHook");
|
|
40
|
+
const createQuizFncJ_1 = require("../../functions/createQuizFncJ");
|
|
41
|
+
const TestComponent = ({ navigation, subject, index, }) => {
|
|
42
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
43
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
45
44
|
// topTabsのラベルを取得
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
const categoryList = (0, react_redux_1.useSelector)((state) => state.app[subject.list]);
|
|
46
|
+
const selectedCategory = categoryList[index];
|
|
47
|
+
const selectKey = selectedCategory.key;
|
|
48
|
+
const quizCnt = selectedCategory.miniTestCnt;
|
|
49
|
+
const testTitle = selectedCategory.title + t("basic.miniTest");
|
|
50
|
+
const testDB = (0, react_2.useQuery)(db_1.MiniTestSchema);
|
|
51
|
+
const outOfYearRange = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange);
|
|
53
52
|
// const QuestionDB = useQuery(DQuestionSchema);
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
const QuestionDBInfo = (0, basicHook_1.useGetQuestionQuery)();
|
|
54
|
+
const levels = (0, react_1.useMemo)(() => {
|
|
56
55
|
return (0, testFnc_1.getMiniTestLevelCnts)(testDB, subject.name, selectKey);
|
|
57
56
|
}, [subject.name, selectKey]);
|
|
58
57
|
// 課金ロック
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
const isLocked = common_1.commonHook.useIsLocked(subject.type, selectKey);
|
|
59
|
+
const icon = isLocked ? "lock" : "clipboard";
|
|
60
|
+
const handleStart = () => {
|
|
62
61
|
if (isLocked) {
|
|
63
62
|
navigation.navigate("Coin");
|
|
64
63
|
return;
|
|
@@ -76,8 +75,8 @@ var TestComponent = function (_a) {
|
|
|
76
75
|
});
|
|
77
76
|
dispatch({ type: "quiz/resetCurrentInfo" });
|
|
78
77
|
// クイズ作成
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
const { query, system } = QuestionDBInfo;
|
|
79
|
+
const quizList = system === "JLPT"
|
|
81
80
|
? (0, createQuizFncJ_1.getMiniTestQuestionsJ)(query, selectKey, quizCnt, subject.tag)
|
|
82
81
|
: (0, createQuizFncD_1.getMiniTestQuestions)(query, subject.type, selectKey, quizCnt, outOfYearRange);
|
|
83
82
|
dispatch(stores_1.saveStorage.deleteQuizInStorage(subject.name));
|
|
@@ -85,10 +84,10 @@ var TestComponent = function (_a) {
|
|
|
85
84
|
navigation.navigate("Quiz");
|
|
86
85
|
};
|
|
87
86
|
// カードに表示する問題数
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
const ONEYEAR_TEST_NUMBER = 901;
|
|
88
|
+
const displayQuizCnt = quizCnt === ONEYEAR_TEST_NUMBER ? "1回分" : quizCnt + "問";
|
|
90
89
|
return (<react_native_1.View style={{ marginBottom: 40 }}>
|
|
91
|
-
<common_1.RectangleCard title={testTitle} left={<common_1.IconInCircle name={icon} size={25}/>} bottom={<Paw5s_1.default levels={levels} quizCnt={displayQuizCnt}/>} onPress={
|
|
90
|
+
<common_1.RectangleCard title={testTitle} left={<common_1.IconInCircle name={icon} size={25}/>} bottom={<Paw5s_1.default levels={levels} quizCnt={displayQuizCnt}/>} onPress={() => handleStart()} color="red"/>
|
|
92
91
|
</react_native_1.View>);
|
|
93
92
|
};
|
|
94
93
|
exports.default = TestComponent;
|
|
@@ -3,28 +3,24 @@ 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
|
-
var levels = _a.levels, quizCnt = _a.quizCnt;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const testFnc_1 = require("../../functions/testFnc");
|
|
10
|
+
const Paw5s = ({ levels, quizCnt }) => {
|
|
12
11
|
// Empty function body
|
|
13
|
-
|
|
12
|
+
const levelInfos = (0, testFnc_1.countByLevel)(levels);
|
|
14
13
|
return (<react_native_1.View style={styles.container}>
|
|
15
14
|
<react_native_1.View>
|
|
16
15
|
<common_1.MyText style={styles.cntTxt}>{quizCnt}</common_1.MyText>
|
|
17
16
|
</react_native_1.View>
|
|
18
|
-
{levelInfos.map(
|
|
19
|
-
var cnt = _a.cnt, color = _a.color;
|
|
20
|
-
return (<react_native_1.View key={i} style={styles.tag}>
|
|
17
|
+
{levelInfos.map(({ cnt, color }, i) => (<react_native_1.View key={i} style={styles.tag}>
|
|
21
18
|
<common_1.IconInCircle name="paw" size={10} iconColor={color} circleColor="darkGray" cStyle={styles.icon}/>
|
|
22
19
|
<common_1.MyText style={styles.tagTxt}>{cnt}</common_1.MyText>
|
|
23
|
-
</react_native_1.View>)
|
|
24
|
-
})}
|
|
20
|
+
</react_native_1.View>))}
|
|
25
21
|
</react_native_1.View>);
|
|
26
22
|
};
|
|
27
|
-
|
|
23
|
+
const styles = react_native_1.StyleSheet.create({
|
|
28
24
|
container: {
|
|
29
25
|
flexDirection: "row",
|
|
30
26
|
justifyContent: "space-between",
|
|
@@ -3,29 +3,28 @@ 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
|
-
var isJLPTSystem = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.setting.appSystem === "JLPT"; });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const SelectedExamCnt = ({ type }) => {
|
|
11
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
12
|
+
const isRangeYear = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.basic.isRangeYearInUnit; }) || false;
|
|
13
|
+
const isJLPTSystem = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.appSystem === "JLPT");
|
|
15
14
|
if (isJLPTSystem)
|
|
16
15
|
return null;
|
|
17
16
|
if (type !== "unit" || !isRangeYear)
|
|
18
17
|
return null;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const outOfYearRange = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange);
|
|
19
|
+
const yearList = (0, react_redux_1.useSelector)((state) => state.app.yearList);
|
|
20
|
+
const allExamCnt = yearList.length;
|
|
21
|
+
const selectedExamCnt = allExamCnt - outOfYearRange.length;
|
|
22
|
+
const msg = `${t("basic.selectedExam")}: ${selectedExamCnt} / ${allExamCnt}`;
|
|
24
23
|
return (<common_1.MyText fsize="sm" style={styles.text}>
|
|
25
24
|
{msg}
|
|
26
25
|
</common_1.MyText>);
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
const styles = react_native_1.StyleSheet.create({
|
|
29
28
|
text: {
|
|
30
29
|
textAlign: "center",
|
|
31
30
|
},
|
|
@@ -3,14 +3,13 @@ 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
|
-
var rate = _a.rate, isLocked = _a.isLocked;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const common_1 = require("@nakamura-123/common");
|
|
8
|
+
const SubCategoryLeft = ({ rate, isLocked, }) => {
|
|
10
9
|
if (isLocked)
|
|
11
10
|
return <common_1.IconInCircle name="lock" circleColor="beige" size={25}/>;
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const per = rate;
|
|
12
|
+
const progressColor = per > 85 ? "red" : per > 70 ? "green" : per > 50 ? "yellow" : "blue";
|
|
14
13
|
return <common_1.CircleProgressInNom percentage={per} color={progressColor}/>;
|
|
15
14
|
};
|
|
16
15
|
exports.default = SubCategoryLeft;
|