@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
|
@@ -23,36 +23,41 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const react_redux_1 = require("react-redux");
|
|
28
|
+
const common_1 = require("@nakamura-123/common");
|
|
29
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
30
|
+
const emptyCardInfo = {
|
|
31
31
|
title: "",
|
|
32
32
|
icon: "info",
|
|
33
33
|
color: "blue",
|
|
34
34
|
description: "",
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
(0, react_1.useEffect)(
|
|
36
|
+
const AdCard = () => {
|
|
37
|
+
const infoSetting = (0, react_redux_1.useSelector)((state) => state.app.appSetting.setting.info) || {};
|
|
38
|
+
const adCardInfos = (0, react_redux_1.useSelector)((state) => { var _a; return (_a = state.setting.info) === null || _a === void 0 ? void 0 : _a.adCard; });
|
|
39
|
+
const [isVisible, setIsVisible] = (0, react_1.useState)(false);
|
|
40
|
+
const [cardInfo, setCardInfo] = (0, react_1.useState)(emptyCardInfo);
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
42
|
if (!infoSetting.isDisplayAdCard)
|
|
43
43
|
return;
|
|
44
|
+
// adCardRate が 0 以下の場合は表示しない(getRandomInt は 0 以下で例外をスローする)
|
|
45
|
+
const rate = infoSetting.adCardRate;
|
|
46
|
+
if (!rate || rate <= 0)
|
|
47
|
+
return;
|
|
44
48
|
// 抽選
|
|
45
|
-
|
|
49
|
+
const randomNum = lib_1.utilFnc.getRandomInt(rate);
|
|
46
50
|
if (randomNum !== 0)
|
|
47
51
|
return;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
52
|
+
const cards = adCardInfos !== null && adCardInfos !== void 0 ? adCardInfos : [];
|
|
53
|
+
if (cards.length > 0) {
|
|
54
|
+
const randomIndex = Math.floor(Math.random() * cards.length);
|
|
55
|
+
setCardInfo(cards[randomIndex]);
|
|
51
56
|
setIsVisible(true);
|
|
52
57
|
}
|
|
53
58
|
}, []);
|
|
54
59
|
if (!isVisible)
|
|
55
60
|
return null;
|
|
56
|
-
return (<common_1.InformationCard info={cardInfo} isVisible={isVisible} onClose={
|
|
61
|
+
return (<common_1.InformationCard info={cardInfo} isVisible={isVisible} onClose={() => setIsVisible(false)}/>);
|
|
57
62
|
};
|
|
58
63
|
exports.default = AdCard;
|
|
@@ -3,24 +3,23 @@ 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 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;
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const CaraCard = ({ scoreInfo }) => {
|
|
12
|
+
const imgs = (0, react_redux_1.useSelector)((state) => state.app.imgs);
|
|
13
|
+
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;
|
|
15
14
|
// 正答割合を取得
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { percent } = scoreInfo;
|
|
16
|
+
const scoreItem = lib_1.scoreLevels.find((item) => {
|
|
18
17
|
return percent <= item.maxPercent;
|
|
19
18
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const enTitle = (scoreItem === null || scoreItem === void 0 ? void 0 : scoreItem.enTitle) || "Great Job";
|
|
20
|
+
const jpTitle = (scoreItem === null || scoreItem === void 0 ? void 0 : scoreItem.jpTitle) || "なかなかやるね";
|
|
21
|
+
const level = (scoreItem === null || scoreItem === void 0 ? void 0 : scoreItem.level) || "l2";
|
|
22
|
+
const imgPath = imgs.chara[level];
|
|
24
23
|
return (<react_native_1.View style={styles.container}>
|
|
25
24
|
{/* <View style={styles.circle} /> */}
|
|
26
25
|
<common_1.MyText style={styles.title}>{enTitle}</common_1.MyText>
|
|
@@ -28,7 +27,7 @@ var CaraCard = function (_a) {
|
|
|
28
27
|
{showCharactor && <react_native_1.Image style={styles.imgBox} source={imgPath}/>}
|
|
29
28
|
</react_native_1.View>);
|
|
30
29
|
};
|
|
31
|
-
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
32
31
|
container: {
|
|
33
32
|
alignItems: "center",
|
|
34
33
|
padding: 10,
|
|
@@ -3,15 +3,15 @@ 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
|
-
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
11
|
+
const LessonTitle = ({}) => {
|
|
12
|
+
const lessonName = (0, react_redux_1.useSelector)((state) => state.quiz.selected.lesson.title);
|
|
13
|
+
const isShuffle = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.option.isShuffle);
|
|
14
|
+
const text = isShuffle ? "(ランダム)" : "(順番通り)";
|
|
15
15
|
return (<react_native_1.View style={styles.container}>
|
|
16
16
|
<react_native_1.View style={styles.rectangle}>
|
|
17
17
|
<common_1.MyText fsize="sm" style={styles.name}>
|
|
@@ -23,7 +23,7 @@ var LessonTitle = function (_a) {
|
|
|
23
23
|
</react_native_1.View>
|
|
24
24
|
</react_native_1.View>);
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
const styles = react_native_1.StyleSheet.create({
|
|
27
27
|
container: {
|
|
28
28
|
// flex: 1,
|
|
29
29
|
},
|
|
@@ -3,36 +3,32 @@ 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
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const MyTextqqyy_1 = __importDefault(require("../../quiz/common/MyTextqqyy"));
|
|
12
|
+
const RubyText_1 = __importDefault(require("../../quiz/common/RubyText"));
|
|
13
|
+
const QuizFlatList = ({ navigation }) => {
|
|
14
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
16
15
|
// 01_Redux からデータを取得(useSelector を使用)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var system = quiz.system;
|
|
27
|
-
return { id: id, question: question, color: color, index: i, isCorrected: isCorrected, system: system };
|
|
16
|
+
const quizList = (0, react_redux_1.useSelector)((state) => state.quiz.quizList);
|
|
17
|
+
const listData = quizList.map((quiz, i) => {
|
|
18
|
+
const id = String(i);
|
|
19
|
+
const questionText = quiz.system === "JLPT" ? quiz.question : quiz.question[0];
|
|
20
|
+
const question = `(${i + 1}) ${questionText}`;
|
|
21
|
+
const color = lib_1.tagLevels.filter((item) => item.level === quiz.tag)[0].color;
|
|
22
|
+
const isCorrected = quiz.isCorrected;
|
|
23
|
+
const system = quiz.system;
|
|
24
|
+
return { id, question, color, index: i, isCorrected, system };
|
|
28
25
|
});
|
|
29
26
|
// 02_リストアイテムのレンダリング
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return (<react_native_1.TouchableOpacity style={styles.itemContainer} activeOpacity={0.7} onPress={function () { return handlePress(item.index); }}>
|
|
27
|
+
const renderItem = ({ item }) => {
|
|
28
|
+
const text = item.question.replace(/zz/g, " 空欄");
|
|
29
|
+
const icon = item.isCorrected ? "circle" : "times";
|
|
30
|
+
const iconColor = item.isCorrected ? "red" : "blue";
|
|
31
|
+
return (<react_native_1.TouchableOpacity style={styles.itemContainer} activeOpacity={0.7} onPress={() => handlePress(item.index)}>
|
|
36
32
|
<react_native_1.View>
|
|
37
33
|
<common_1.IconInCircle name="tag" circleColor={item.color} size={11} iconColor="white"/>
|
|
38
34
|
<react_native_1.View style={{ position: "absolute", top: -5, right: -5 }}>
|
|
@@ -49,17 +45,17 @@ var QuizFlatList = function (_a) {
|
|
|
49
45
|
</react_native_1.TouchableOpacity>);
|
|
50
46
|
};
|
|
51
47
|
// 03_タップ時の処理
|
|
52
|
-
|
|
48
|
+
const handlePress = (index) => {
|
|
53
49
|
// タップ時の処理を記述してください
|
|
54
50
|
dispatch({ type: "quiz/jumpToTurn", payload: index });
|
|
55
51
|
dispatch({ type: "quiz/toResult" });
|
|
56
52
|
navigation.navigate("Quiz");
|
|
57
53
|
};
|
|
58
54
|
return (<react_native_1.View style={styles.container}>
|
|
59
|
-
<react_native_1.FlatList data={listData} keyExtractor={
|
|
55
|
+
<react_native_1.FlatList data={listData} keyExtractor={(item) => item.id} renderItem={renderItem} contentContainerStyle={styles.listContent} showsVerticalScrollIndicator={false} ItemSeparatorComponent={() => <react_native_1.View style={styles.border}/>}/>
|
|
60
56
|
</react_native_1.View>);
|
|
61
57
|
};
|
|
62
|
-
|
|
58
|
+
const styles = react_native_1.StyleSheet.create({
|
|
63
59
|
container: {
|
|
64
60
|
flex: 1,
|
|
65
61
|
backgroundColor: lib_1.colors.beige,
|
|
@@ -3,15 +3,14 @@ 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 scoreInfo = _a.scoreInfo;
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
10
|
+
const ScoreCircle = ({ scoreInfo }) => {
|
|
12
11
|
// 正答割合を取得
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const { score, quizCnt, percent } = scoreInfo;
|
|
13
|
+
const color = lib_1.utilFnc.getScoreColor(percent);
|
|
15
14
|
return (<react_native_1.View style={[styles.container, { borderColor: lib_1.colors[color] }]}>
|
|
16
15
|
<react_native_1.View style={styles.iconBox}>
|
|
17
16
|
<common_1.IconInCircle name="paw" circleColor={color} size={15}/>
|
|
@@ -28,7 +27,7 @@ var ScoreCircle = function (_a) {
|
|
|
28
27
|
</common_1.MyText>
|
|
29
28
|
</react_native_1.View>);
|
|
30
29
|
};
|
|
31
|
-
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
32
31
|
container: {
|
|
33
32
|
// 丸い円にする
|
|
34
33
|
marginTop: 25,
|
|
@@ -22,55 +22,43 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
26
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
27
|
-
if (ar || !(i in from)) {
|
|
28
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
29
|
-
ar[i] = from[i];
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
33
|
-
};
|
|
34
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var _b = (0, react_1.useState)([]), localOutOfRanges = _b[0], setLocalOutOfRanges = _b[1]; // 一時的な状態
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const react_native_1 = require("react-native");
|
|
28
|
+
const react_redux_1 = require("react-redux");
|
|
29
|
+
const common_1 = require("@nakamura-123/common");
|
|
30
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
31
|
+
const { updateOutOfYear } = stores_1.cfgAction;
|
|
32
|
+
const SelectYearRange = ({ onClose, isVisible, }) => {
|
|
33
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
34
|
+
const reduxOutOfRanges = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange); // Reduxの状態を取得
|
|
35
|
+
const yearLists = (0, react_redux_1.useSelector)((state) => state.app.yearList);
|
|
36
|
+
const [localOutOfRanges, setLocalOutOfRanges] = (0, react_1.useState)([]); // 一時的な状態
|
|
47
37
|
// モーダルが開いたときにReduxの値を初期化
|
|
48
|
-
(0, react_1.useEffect)(
|
|
49
|
-
setLocalOutOfRanges(
|
|
38
|
+
(0, react_1.useEffect)(() => {
|
|
39
|
+
setLocalOutOfRanges([...reduxOutOfRanges]); // Reduxの状態をコピー
|
|
50
40
|
}, [isVisible]);
|
|
51
41
|
// 選択肢のON/OFFをトグルする関数
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
const selectedItemCnt = yearLists.length - localOutOfRanges.length;
|
|
43
|
+
const toggleSelection = (key) => {
|
|
44
|
+
const MIN_CNT = 8;
|
|
55
45
|
if (selectedItemCnt <= MIN_CNT && !localOutOfRanges.includes(key))
|
|
56
46
|
return;
|
|
57
|
-
setLocalOutOfRanges(
|
|
58
|
-
return prev.includes(key) ? prev.filter(function (item) { return item !== key; }) : __spreadArray(__spreadArray([], prev, true), [key], false);
|
|
59
|
-
});
|
|
47
|
+
setLocalOutOfRanges((prev) => prev.includes(key) ? prev.filter((item) => item !== key) : [...prev, key]);
|
|
60
48
|
};
|
|
61
49
|
// 適用ボタンの処理
|
|
62
|
-
|
|
50
|
+
const handleApply = () => {
|
|
63
51
|
dispatch(updateOutOfYear(localOutOfRanges)); // Reduxを更新
|
|
64
52
|
onClose(); // モーダルを閉じる
|
|
65
53
|
};
|
|
66
54
|
// キャンセルボタンの処理
|
|
67
|
-
|
|
55
|
+
const handleCancel = () => {
|
|
68
56
|
onClose(); // モーダルを閉じる
|
|
69
57
|
};
|
|
70
58
|
return (<common_1.BaseModal isVisible={isVisible} onClose={onClose}>
|
|
71
59
|
<react_native_1.View style={styles.container}>
|
|
72
|
-
{yearLists.map(
|
|
73
|
-
/>)
|
|
60
|
+
{yearLists.map((year, i) => (<common_1.RoundSelectableItem key={i} title={year.title} onPress={() => toggleSelection(year.key)} isSelected={!localOutOfRanges.includes(year.key)} // 選択状態を反映
|
|
61
|
+
/>))}
|
|
74
62
|
<react_native_1.View style={styles.txtBox}>
|
|
75
63
|
<common_1.MyText fsize="sm">
|
|
76
64
|
※最低8個は選択してください({selectedItemCnt}個選択中)。
|
|
@@ -83,7 +71,7 @@ var SelectYearRange = function (_a) {
|
|
|
83
71
|
</react_native_1.View>
|
|
84
72
|
</common_1.BaseModal>);
|
|
85
73
|
};
|
|
86
|
-
|
|
74
|
+
const styles = react_native_1.StyleSheet.create({
|
|
87
75
|
container: {
|
|
88
76
|
flexDirection: "row",
|
|
89
77
|
flexWrap: "wrap",
|
|
@@ -3,16 +3,15 @@ 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
|
-
var storeOption = (0, react_redux_1.useSelector)(function (state) { return state.quizCfg.inQuizOption; });
|
|
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 stores_1 = require("@nakamura-123/stores");
|
|
11
|
+
const QuizOptionItem = ({ type, options }) => {
|
|
12
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
13
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
14
|
+
const storeOption = (0, react_redux_1.useSelector)((state) => state.quizCfg.inQuizOption);
|
|
16
15
|
// オプション定義を取得
|
|
17
16
|
// const optionDef = inQuizOption.dInQuizOption.find((o) => o.type === type);
|
|
18
17
|
// if (!optionDef) {
|
|
@@ -20,19 +19,19 @@ var QuizOptionItem = function (_a) {
|
|
|
20
19
|
// return null; // 無効なタイプの場合、描画しない
|
|
21
20
|
// }
|
|
22
21
|
// const { options } = optionDef;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
dispatch(stores_1.cfgAction.selectInQuizOption({ key: type, value
|
|
22
|
+
const selectedValue = storeOption[type];
|
|
23
|
+
const selectedIndex = options.findIndex((o) => o === selectedValue);
|
|
24
|
+
const handleSelect = (value) => {
|
|
25
|
+
dispatch(stores_1.cfgAction.selectInQuizOption({ key: type, value }));
|
|
27
26
|
};
|
|
28
27
|
return (<react_native_1.View style={styles.container}>
|
|
29
28
|
<common_1.MyText color="text" fsize="md" style={styles.title}>
|
|
30
|
-
{t(
|
|
29
|
+
{t(`quiz.option.${type}.title`)}
|
|
31
30
|
</common_1.MyText>
|
|
32
|
-
<common_1.OptionSelector options={options.map(
|
|
31
|
+
<common_1.OptionSelector options={options.map((o) => t(`quiz.option.${type}.${o}`))} selected={selectedIndex} onSelect={(index) => handleSelect(options[index])}/>
|
|
33
32
|
</react_native_1.View>);
|
|
34
33
|
};
|
|
35
|
-
|
|
34
|
+
const styles = react_native_1.StyleSheet.create({
|
|
36
35
|
container: {
|
|
37
36
|
width: "100%",
|
|
38
37
|
marginBottom: 20,
|
|
@@ -26,18 +26,18 @@ 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
|
-
|
|
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 SelectYearRange_1 = __importDefault(require("../SelectRange/SelectYearRange"));
|
|
33
|
+
const Range = ({}) => {
|
|
34
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
35
|
+
const [isRangeModal, setIsRangeModal] = (0, react_1.useState)(false);
|
|
36
|
+
const onPress = () => {
|
|
37
37
|
setIsRangeModal(true);
|
|
38
38
|
};
|
|
39
39
|
return (<react_native_1.View>
|
|
40
|
-
<SelectYearRange_1.default isVisible={isRangeModal} onClose={
|
|
40
|
+
<SelectYearRange_1.default isVisible={isRangeModal} onClose={() => setIsRangeModal(false)}/>
|
|
41
41
|
<common_1.SettingBtn icon="check-circle" title={t("basic.setting.range")} onPress={onPress}/>
|
|
42
42
|
</react_native_1.View>);
|
|
43
43
|
};
|
|
@@ -23,20 +23,20 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const react_native_1 = require("react-native");
|
|
28
|
+
const common_1 = require("@nakamura-123/common");
|
|
29
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
30
|
+
const react_redux_1 = require("react-redux");
|
|
31
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
32
|
+
const TransBtn = ({}) => {
|
|
33
|
+
const [modalVisible, setModalVisible] = (0, react_1.useState)(false);
|
|
34
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
35
|
+
const { i18n } = (0, common_1.useDrillTranslation)();
|
|
36
|
+
const handlePress = () => {
|
|
37
37
|
setModalVisible(true);
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
const handleLanguageSelect = (language) => {
|
|
40
40
|
i18n === null || i18n === void 0 ? void 0 : i18n.changeLanguage(language); // 言語を切り替える
|
|
41
41
|
dispatch({ type: "setting/setLanguage", payload: language });
|
|
42
42
|
dispatch(stores_1.settingStorage.saveSetting());
|
|
@@ -44,19 +44,19 @@ var TransBtn = function (_a) {
|
|
|
44
44
|
};
|
|
45
45
|
return (<react_native_1.View style={styles.container}>
|
|
46
46
|
<common_1.IconInCircle name="language" cStyle={styles.button} onPress={handlePress} circleColor="dkBeige" iconColor="white"/>
|
|
47
|
-
<react_native_1.Modal transparent={true} visible={modalVisible} animationType="slide" onRequestClose={
|
|
47
|
+
<react_native_1.Modal transparent={true} visible={modalVisible} animationType="slide" onRequestClose={() => setModalVisible(false)}>
|
|
48
48
|
<react_native_1.View style={styles.modalContainer}>
|
|
49
49
|
<react_native_1.View style={styles.modalContent}>
|
|
50
50
|
<react_native_1.Text style={styles.modalTitle}>Select Language</react_native_1.Text>
|
|
51
|
-
<react_native_1.TouchableOpacity style={styles.modalButton} onPress={
|
|
51
|
+
<react_native_1.TouchableOpacity style={styles.modalButton} onPress={() => handleLanguageSelect("en")} // 英語を選択
|
|
52
52
|
>
|
|
53
53
|
<react_native_1.Text style={styles.modalButtonText}>English</react_native_1.Text>
|
|
54
54
|
</react_native_1.TouchableOpacity>
|
|
55
|
-
<react_native_1.TouchableOpacity style={styles.modalButton} onPress={
|
|
55
|
+
<react_native_1.TouchableOpacity style={styles.modalButton} onPress={() => handleLanguageSelect("ja")} // 日本語を選択
|
|
56
56
|
>
|
|
57
57
|
<react_native_1.Text style={styles.modalButtonText}>Japanese</react_native_1.Text>
|
|
58
58
|
</react_native_1.TouchableOpacity>
|
|
59
|
-
<react_native_1.TouchableOpacity style={styles.modalCloseButton} onPress={
|
|
59
|
+
<react_native_1.TouchableOpacity style={styles.modalCloseButton} onPress={() => setModalVisible(false)}>
|
|
60
60
|
<react_native_1.Text style={styles.modalCloseButtonText}>Close</react_native_1.Text>
|
|
61
61
|
</react_native_1.TouchableOpacity>
|
|
62
62
|
</react_native_1.View>
|
|
@@ -64,7 +64,7 @@ var TransBtn = function (_a) {
|
|
|
64
64
|
</react_native_1.Modal>
|
|
65
65
|
</react_native_1.View>);
|
|
66
66
|
};
|
|
67
|
-
|
|
67
|
+
const styles = react_native_1.StyleSheet.create({
|
|
68
68
|
container: { marginRight: 10 },
|
|
69
69
|
button: {
|
|
70
70
|
// borderWidth: 3,
|
|
@@ -23,16 +23,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var children = _a.children, activeIndex = _a.activeIndex;
|
|
26
|
+
const react_1 = __importStar(require("react"));
|
|
27
|
+
const react_native_1 = require("react-native");
|
|
28
|
+
const Animatable = __importStar(require("react-native-animatable"));
|
|
29
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
30
|
+
const TabAnimeView = ({ children, activeIndex, }) => {
|
|
32
31
|
// アニメーション
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(0, react_1.useEffect)(
|
|
32
|
+
const preActiveIndex = (0, react_1.useRef)(activeIndex);
|
|
33
|
+
const [animationDirection, setAnimationDirection] = (0, react_1.useState)("slideInRight");
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
36
35
|
if (activeIndex > preActiveIndex.current)
|
|
37
36
|
setAnimationDirection("fadeSlideInRight");
|
|
38
37
|
else if (activeIndex < preActiveIndex.current)
|
|
@@ -48,7 +47,7 @@ Animatable.initializeRegistryWithDefinitions({
|
|
|
48
47
|
fadeSlideInRight: lib_1.fadeSlideIn.right,
|
|
49
48
|
fadeSlideInLeft: lib_1.fadeSlideIn.left,
|
|
50
49
|
});
|
|
51
|
-
|
|
50
|
+
const styles = react_native_1.StyleSheet.create({
|
|
52
51
|
container: {
|
|
53
52
|
flexGrow: 1,
|
|
54
53
|
justifyContent: "center",
|
package/dist/component/Tag5s.js
CHANGED
|
@@ -3,29 +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
|
-
var tags = _a.tags;
|
|
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 tagFncD_1 = require("../functions/tagFncD");
|
|
10
|
+
const Tag5s = ({ tags }) => {
|
|
12
11
|
// Empty function body
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const cntTxt = tags.length + "問";
|
|
13
|
+
const tagInfos = (0, tagFncD_1.countTagsByLevel)(tags);
|
|
15
14
|
return (<react_native_1.View style={styles.container}>
|
|
16
15
|
<react_native_1.View>
|
|
17
16
|
<common_1.MyText style={styles.cntTxt}>{cntTxt}</common_1.MyText>
|
|
18
17
|
</react_native_1.View>
|
|
19
|
-
{tagInfos.map(
|
|
20
|
-
var cnt = _a.cnt, color = _a.color;
|
|
21
|
-
return (<react_native_1.View key={i} style={styles.tag}>
|
|
18
|
+
{tagInfos.map(({ cnt, color }, i) => (<react_native_1.View key={i} style={styles.tag}>
|
|
22
19
|
<common_1.Icon5 name="tag" size={10} color={color}/>
|
|
23
20
|
<common_1.MyText style={styles.tagTxt}>{cnt}</common_1.MyText>
|
|
24
|
-
</react_native_1.View>)
|
|
25
|
-
})}
|
|
21
|
+
</react_native_1.View>))}
|
|
26
22
|
</react_native_1.View>);
|
|
27
23
|
};
|
|
28
|
-
|
|
24
|
+
const styles = react_native_1.StyleSheet.create({
|
|
29
25
|
container: {
|
|
30
26
|
flexDirection: "row",
|
|
31
27
|
justifyContent: "space-between",
|