@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
|
@@ -26,36 +26,35 @@ 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
|
-
var targetDayStr = getTargetDayStr(targetDay, t);
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const react_redux_1 = require("react-redux");
|
|
32
|
+
const common_1 = require("@nakamura-123/common");
|
|
33
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
34
|
+
const DatePickerModal_1 = __importDefault(require("./DatePickerModal")); // モーダル部分を別コンポーネント化
|
|
35
|
+
const TargetDate = ({ color }) => {
|
|
36
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
37
|
+
const [isModalVisible, setModalVisible] = (0, react_1.useState)(false);
|
|
38
|
+
const targetDay = (0, react_redux_1.useSelector)((state) => state.setting.grade.targetDay);
|
|
39
|
+
const targetDayStr = getTargetDayStr(targetDay, t);
|
|
41
40
|
return (<react_native_1.View style={styles.container}>
|
|
42
|
-
<common_1.RoundRectangle title={targetDayStr} onPress={
|
|
43
|
-
<DatePickerModal_1.default isVisible={isModalVisible} onClose={
|
|
41
|
+
<common_1.RoundRectangle title={targetDayStr} onPress={() => setModalVisible(true)} color={color}/>
|
|
42
|
+
<DatePickerModal_1.default isVisible={isModalVisible} onClose={() => setModalVisible(false)} targetDay={targetDay}/>
|
|
44
43
|
</react_native_1.View>);
|
|
45
44
|
};
|
|
46
|
-
|
|
45
|
+
const getTargetDayStr = (targetDay, t) => {
|
|
47
46
|
if (!targetDay)
|
|
48
47
|
return t("grade.gradeCard.pleaseSetTxt");
|
|
49
|
-
|
|
48
|
+
const comparisonResult = lib_1.timeFnc.compareToday(targetDay);
|
|
50
49
|
if (comparisonResult === "today")
|
|
51
50
|
return t("grade.gradeCard.examDateTxt");
|
|
52
|
-
|
|
51
|
+
const limitDays = lib_1.timeFnc.getCountdownDays(targetDay);
|
|
53
52
|
if (limitDays < 0)
|
|
54
53
|
return t("grade.gradeCard.pleaseSetTxt");
|
|
55
|
-
|
|
56
|
-
return
|
|
54
|
+
const formattedDate = lib_1.timeFnc.formatDateYW(targetDay);
|
|
55
|
+
return `${formattedDate}まで ${limitDays}日`;
|
|
57
56
|
};
|
|
58
|
-
|
|
57
|
+
const styles = react_native_1.StyleSheet.create({
|
|
59
58
|
container: {
|
|
60
59
|
width: "100%",
|
|
61
60
|
},
|
|
@@ -3,13 +3,12 @@ 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
|
-
var rate = Math.floor((weeklyQuizCntTotal / weeklyTargetCnt) * 100);
|
|
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 WeeklyAchievedRate = ({ weeklyQuizCntTotal, weeklyTargetCnt, color, }) => {
|
|
10
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
11
|
+
const rate = Math.floor((weeklyQuizCntTotal / weeklyTargetCnt) * 100);
|
|
13
12
|
return (<react_native_1.View style={styles.container}>
|
|
14
13
|
<common_1.MyText fsize="sm" color="ltBlack" style={styles.txt}>
|
|
15
14
|
{t("grade.gradeCard.weeklyAchievedRate")}
|
|
@@ -17,7 +16,7 @@ var WeeklyAchievedRate = function (_a) {
|
|
|
17
16
|
<common_1.ProgressBar progress={rate} barColor={color} height={20}/>
|
|
18
17
|
</react_native_1.View>);
|
|
19
18
|
};
|
|
20
|
-
|
|
19
|
+
const styles = react_native_1.StyleSheet.create({
|
|
21
20
|
container: {
|
|
22
21
|
flex: 2,
|
|
23
22
|
},
|
|
@@ -3,56 +3,46 @@ 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
|
-
var weeklyLogs = _a.weeklyLogs, weeklyTargetCnt = _a.weeklyTargetCnt, color = _a.color;
|
|
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 gradeFnc_1 = require("../../../functions/gradeFnc");
|
|
11
|
+
const WeeklyProgress = ({ weeklyLogs, weeklyTargetCnt, color, }) => {
|
|
13
12
|
// 今週のログをデータベースから取得
|
|
14
13
|
// 今週の日付を所得
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const today = lib_1.timeFnc.getToday();
|
|
15
|
+
const weeklyDays = lib_1.timeFnc.getThisWeek(today);
|
|
17
16
|
// 今週のクイズ数を合計
|
|
18
|
-
|
|
17
|
+
const weeklyQuizCnts = (0, gradeFnc_1.getWeeklyCnts)(weeklyLogs, weeklyDays);
|
|
19
18
|
// データを配列化して挿入
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
const weeklyInfo = weeklyDays.map((day, i) => {
|
|
20
|
+
const percent = (weeklyQuizCnts[i] / (weeklyTargetCnt / 7)) * 100;
|
|
21
|
+
const borderColor = day.toDate().getTime() === today.getTime()
|
|
23
22
|
? lib_1.colors.darkGray
|
|
24
23
|
: "transparent";
|
|
25
24
|
return {
|
|
26
25
|
day: day.format("ddd"),
|
|
27
26
|
date: day.format("D"),
|
|
28
|
-
percent
|
|
29
|
-
borderColor
|
|
27
|
+
percent,
|
|
28
|
+
borderColor,
|
|
30
29
|
};
|
|
31
30
|
});
|
|
32
31
|
return (<react_native_1.View style={styles.container}>
|
|
33
|
-
{weeklyInfo.map(
|
|
34
|
-
var day = _a.day, date = _a.date, percent = _a.percent, borderColor = _a.borderColor;
|
|
35
|
-
return (<react_native_1.View key={day} style={[styles.dayContainer, { borderColor: borderColor }]}>
|
|
32
|
+
{weeklyInfo.map(({ day, date, percent, borderColor }) => (<react_native_1.View key={day} style={[styles.dayContainer, { borderColor }]}>
|
|
36
33
|
<common_1.MyText style={styles.dayText}>{day}</common_1.MyText>
|
|
37
34
|
<react_native_1.View style={styles.dateBox}>
|
|
38
35
|
<common_1.MyText style={styles.dateText}>{date}</common_1.MyText>
|
|
39
36
|
</react_native_1.View>
|
|
40
37
|
{percent >= 100 ? (<CompoletedIcon color={color}/>) : (<Circle percent={percent} color={color}/>)}
|
|
41
|
-
</react_native_1.View>)
|
|
42
|
-
})}
|
|
38
|
+
</react_native_1.View>))}
|
|
43
39
|
</react_native_1.View>);
|
|
44
40
|
};
|
|
45
|
-
|
|
46
|
-
var color = _a.color;
|
|
47
|
-
return (<react_native_1.View style={{ marginTop: 5 }}>
|
|
41
|
+
const CompoletedIcon = ({ color }) => (<react_native_1.View style={{ marginTop: 5 }}>
|
|
48
42
|
<common_1.Icon5 name="check-circle" size={25} color="green"/>
|
|
49
43
|
</react_native_1.View>);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
var percent = _a.percent, color = _a.color;
|
|
53
|
-
return (<common_1.CircleProgress percentage={percent} radius={10} showNumber={false} strokeWidth={7} color={lib_1.colors[color]}/>);
|
|
54
|
-
};
|
|
55
|
-
var styles = react_native_1.StyleSheet.create({
|
|
44
|
+
const Circle = ({ percent, color, }) => (<common_1.CircleProgress percentage={percent} radius={10} showNumber={false} strokeWidth={7} color={lib_1.colors[color]}/>);
|
|
45
|
+
const styles = react_native_1.StyleSheet.create({
|
|
56
46
|
container: {
|
|
57
47
|
width: "100%",
|
|
58
48
|
flexDirection: "row",
|
|
@@ -3,31 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_2 = require("@realm/react");
|
|
9
|
+
const db_1 = require("@nakamura-123/db");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const tagFncD_1 = require("../../functions/tagFncD");
|
|
12
|
+
const tagFncJ_1 = require("../../functions/tagFncJ");
|
|
13
|
+
const JAllTags = ({}) => {
|
|
14
|
+
const JQuestionDB = (0, react_2.useQuery)(db_1.JQuestionSchema);
|
|
15
|
+
const tagLevelsBasic = (0, tagFncJ_1.getTagNameFilterJ)(JQuestionDB, "basicTag");
|
|
16
|
+
const tagLevelsListen = (0, tagFncJ_1.getTagNameFilterJ)(JQuestionDB, "listenTag");
|
|
17
|
+
const tag5InfosBasic = (0, tagFncD_1.countTagsByLevel)(tagLevelsBasic);
|
|
18
|
+
const tag5InfosListen = (0, tagFncD_1.countTagsByLevel)(tagLevelsListen);
|
|
19
19
|
return (<react_native_1.View style={styles.container}>
|
|
20
20
|
<common_1.MyText>きほん</common_1.MyText>
|
|
21
21
|
<react_native_1.View style={styles.tagBox}>
|
|
22
|
-
{tag5InfosBasic.map(
|
|
22
|
+
{tag5InfosBasic.map((tag, i) => (<common_1.Badge key={i} name={String(tag.cnt)} icon={"tag"} circleColor={tag.color} style={styles.badge}/>))}
|
|
23
23
|
</react_native_1.View>
|
|
24
24
|
<common_1.MyText>ちょうかい</common_1.MyText>
|
|
25
25
|
<react_native_1.View style={styles.tagBox}>
|
|
26
|
-
{tag5InfosListen.map(
|
|
26
|
+
{tag5InfosListen.map((tag, i) => (<common_1.Badge key={i} name={String(tag.cnt)} icon={"tag"} circleColor={tag.color} style={styles.badge}/>))}
|
|
27
27
|
</react_native_1.View>
|
|
28
28
|
</react_native_1.View>);
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
31
31
|
container: {
|
|
32
32
|
marginVertical: 10,
|
|
33
33
|
},
|
|
@@ -22,69 +22,55 @@ 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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
27
|
};
|
|
37
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
var _e = (0, react_1.useState)(0), agoWeekCnt = _e[0], setAgoWeekCnt = _e[1];
|
|
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 lib_1 = require("@nakamura-123/lib");
|
|
33
|
+
const gradeFnc_1 = require("../../functions/gradeFnc");
|
|
34
|
+
const ChartControl_1 = __importDefault(require("../TestPage/ChartControl"));
|
|
35
|
+
const QuizCntGraph = ({ DailyLogDB }) => {
|
|
36
|
+
const [isDaily, setIsDaily] = (0, react_1.useState)(true);
|
|
37
|
+
const [graphData, setGraphData] = (0, react_1.useState)([]);
|
|
38
|
+
const [agoDateCnt, setAgoDateCnt] = (0, react_1.useState)(0);
|
|
39
|
+
const [agoWeekCnt, setAgoWeekCnt] = (0, react_1.useState)(0);
|
|
50
40
|
// 日別のデータを取得
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
const baseDate = lib_1.timeFnc.getDateWeeksAgo(agoDateCnt).toDate();
|
|
42
|
+
const selectedOneWeek = lib_1.timeFnc.getThisWeek(baseDate);
|
|
43
|
+
const weeklyQuizCnts = (0, gradeFnc_1.getWeeklyCnts)(DailyLogDB, selectedOneWeek);
|
|
44
|
+
const dailyMaxValue = Math.max(100, ...weeklyQuizCnts);
|
|
45
|
+
const sumWeeklyQuizCnts = weeklyQuizCnts.reduce((acc, cur) => acc + cur, 0);
|
|
56
46
|
// 日別データの作成
|
|
57
|
-
|
|
47
|
+
const dailyData = getDaileyData(selectedOneWeek, weeklyQuizCnts, dailyMaxValue);
|
|
58
48
|
// 週別データの取得
|
|
59
49
|
// 日別・週別データどちらを表示するか選択
|
|
60
|
-
(0, react_1.useEffect)(
|
|
61
|
-
|
|
50
|
+
(0, react_1.useEffect)(() => {
|
|
51
|
+
const data = isDaily ? dailyData : [];
|
|
62
52
|
setGraphData(data);
|
|
63
53
|
}, [agoWeekCnt, agoDateCnt]);
|
|
64
54
|
// コントロールボックスの関数
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
71
|
-
var showLeft = isDaily ? agoDateCnt < 30 : agoWeekCnt < 5;
|
|
72
|
-
var showRight = agoDateCnt > 0 || agoWeekCnt > 0;
|
|
73
|
-
var title = "\u5408\u8A08 ".concat(sumWeeklyQuizCnts, "\u554F");
|
|
55
|
+
const handleLeft = () => isDaily ? setAgoDateCnt(agoDateCnt + 1) : setAgoWeekCnt(agoWeekCnt + 1);
|
|
56
|
+
const handleRight = () => isDaily ? setAgoDateCnt(agoDateCnt - 1) : setAgoWeekCnt(agoWeekCnt - 1);
|
|
57
|
+
const showLeft = isDaily ? agoDateCnt < 30 : agoWeekCnt < 5;
|
|
58
|
+
const showRight = agoDateCnt > 0 || agoWeekCnt > 0;
|
|
59
|
+
const title = `合計 ${sumWeeklyQuizCnts}問`;
|
|
74
60
|
return (<react_native_1.View style={styles.container}>
|
|
75
61
|
<ChartControl_1.default title={title} onPressLeft={handleLeft} onPressRight={handleRight} showLeft={showLeft} showRight={showRight}/>
|
|
76
62
|
<common_1.BarChart data={graphData} width={25} maxValue={100} isPercent={false}/>
|
|
77
63
|
</react_native_1.View>);
|
|
78
64
|
};
|
|
79
|
-
|
|
80
|
-
return weeklyDates.map(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return { label
|
|
65
|
+
const getDaileyData = (weeklyDates, weeklyQuizCnts, dailyMaxValue) => {
|
|
66
|
+
return weeklyDates.map((day, i) => {
|
|
67
|
+
const cnt = weeklyQuizCnts[i];
|
|
68
|
+
const value = Math.floor((cnt / dailyMaxValue) * 100);
|
|
69
|
+
const label = day.format("M/D\nddd");
|
|
70
|
+
return { label, value, color: "blue", cnt };
|
|
85
71
|
});
|
|
86
72
|
};
|
|
87
|
-
|
|
73
|
+
const styles = react_native_1.StyleSheet.create({
|
|
88
74
|
container: {
|
|
89
75
|
flex: 1,
|
|
90
76
|
paddingBottom: 20,
|
|
@@ -8,79 +8,41 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
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;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
13
|
};
|
|
41
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (result.activityType) {
|
|
62
|
-
// iOSの場合、具体的なシェア方法がここに返されます
|
|
63
|
-
console.log("Shared with activity type:", result.activityType);
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
console.log("Shared successfully");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
else if (result.action === react_native_1.Share.dismissedAction) {
|
|
70
|
-
// シェアがキャンセルされた場合
|
|
71
|
-
console.log("Share dismissed");
|
|
72
|
-
}
|
|
73
|
-
return [3 /*break*/, 3];
|
|
74
|
-
case 2:
|
|
75
|
-
error_1 = _a.sent();
|
|
76
|
-
console.error("Error sharing:", error_1);
|
|
77
|
-
react_native_1.Alert.alert("シェアに失敗しました", error_1.message);
|
|
78
|
-
return [3 /*break*/, 3];
|
|
79
|
-
case 3: return [2 /*return*/];
|
|
15
|
+
const react_1 = __importDefault(require("react"));
|
|
16
|
+
const react_native_1 = require("react-native");
|
|
17
|
+
const common_1 = require("@nakamura-123/common");
|
|
18
|
+
const ShareBtn = ({ style }) => {
|
|
19
|
+
const handleShare = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
+
try {
|
|
21
|
+
const result = yield react_native_1.Share.share({
|
|
22
|
+
message: "このメッセージをシェアしよう!",
|
|
23
|
+
url: "https://example.com", // シェアするURL(オプション)
|
|
24
|
+
title: "シェアのタイトル", // iOS用(オプション)
|
|
25
|
+
});
|
|
26
|
+
if (result.action === react_native_1.Share.sharedAction) {
|
|
27
|
+
if (result.activityType) {
|
|
28
|
+
// iOSの場合、具体的なシェア方法がここに返されます
|
|
29
|
+
console.log("Shared with activity type:", result.activityType);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.log("Shared successfully");
|
|
33
|
+
}
|
|
80
34
|
}
|
|
81
|
-
|
|
82
|
-
|
|
35
|
+
else if (result.action === react_native_1.Share.dismissedAction) {
|
|
36
|
+
// シェアがキャンセルされた場合
|
|
37
|
+
console.log("Share dismissed");
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
console.error("Error sharing:", error);
|
|
42
|
+
react_native_1.Alert.alert("シェアに失敗しました", error.message);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
83
45
|
return (<common_1.MiniIconBtn onPress={handleShare} icon="share" title="シェア" color="green" outerStyle={style}/>);
|
|
84
46
|
};
|
|
85
|
-
|
|
47
|
+
const styles = react_native_1.StyleSheet.create({});
|
|
86
48
|
exports.default = ShareBtn;
|
|
@@ -3,23 +3,22 @@ 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
|
-
var t = (0, common_1.useDrillTranslation)().t;
|
|
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 gradeFnc_1 = require("../../functions/gradeFnc");
|
|
10
|
+
const Square4s = ({ DailyLogDB }) => {
|
|
11
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
13
12
|
// 1.最大の問題数を取得
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const maxQuizCntLog = (0, gradeFnc_1.findMaxQuizCntLog)(DailyLogDB);
|
|
14
|
+
const maxQuizCnt = maxQuizCntLog ? maxQuizCntLog.quizCnt : 0;
|
|
16
15
|
// 2.通算問題数を取得
|
|
17
|
-
|
|
16
|
+
const totalCnt = (0, gradeFnc_1.getTotalQuizCnt)(DailyLogDB);
|
|
18
17
|
// 3.最高連続学習日数を取得
|
|
19
|
-
|
|
18
|
+
const longestConsecutiveDays = (0, gradeFnc_1.getLongestConsecutiveStudyDays)(DailyLogDB);
|
|
20
19
|
// 4.通算学習日数を取得
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const studyDayCnt = DailyLogDB.length;
|
|
21
|
+
const squareInfo = [
|
|
23
22
|
{
|
|
24
23
|
cnt: maxQuizCnt,
|
|
25
24
|
cntText: "問",
|
|
@@ -46,10 +45,10 @@ var Square4s = function (_a) {
|
|
|
46
45
|
},
|
|
47
46
|
];
|
|
48
47
|
return (<react_native_1.View style={styles.container}>
|
|
49
|
-
{squareInfo.map(
|
|
48
|
+
{squareInfo.map((item, index) => (<common_1.SquareIcon key={index} cnt={item.cnt} cntText={item.cntText} label={item.label} icon={item.icon} style={styles.square} iconColor="ltBlack"/>))}
|
|
50
49
|
</react_native_1.View>);
|
|
51
50
|
};
|
|
52
|
-
|
|
51
|
+
const styles = react_native_1.StyleSheet.create({
|
|
53
52
|
container: {
|
|
54
53
|
flex: 1,
|
|
55
54
|
flexWrap: "wrap",
|
|
@@ -3,37 +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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var key = _a.key, title = _a.title;
|
|
20
|
-
var tags = QuestionDBInfo.system === "JLPT"
|
|
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 tagFncJ_1 = require("../../functions/tagFncJ");
|
|
10
|
+
const tagFncD_1 = require("../../functions/tagFncD");
|
|
11
|
+
const SubCategoryLeft_1 = __importDefault(require("../Basic/SubCategoryLeft"));
|
|
12
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
13
|
+
const common_1 = require("@nakamura-123/common");
|
|
14
|
+
const UnitCircles = ({ QuestionDBInfo }) => {
|
|
15
|
+
const unitList = (0, react_redux_1.useSelector)((state) => state.app.unitList);
|
|
16
|
+
const outOfYearRange = (0, react_redux_1.useSelector)((state) => state.quizCfg.startCfg.outOfYearRange);
|
|
17
|
+
const circleInfos = unitList.map(({ key, title }) => {
|
|
18
|
+
const tags = QuestionDBInfo.system === "JLPT"
|
|
21
19
|
? (0, tagFncJ_1.getCategoryTagLevelCntsJ)(QuestionDBInfo.query, key, "basicTag")
|
|
22
20
|
: (0, tagFncD_1.getCategoryTagLevelCntsD)(QuestionDBInfo.query, key, "unit", outOfYearRange);
|
|
23
|
-
|
|
24
|
-
return { title
|
|
21
|
+
const rate = Math.round((0, tagFncD_1.getCategoryRate)(tags));
|
|
22
|
+
return { title, rate };
|
|
25
23
|
});
|
|
26
24
|
return (<react_native_1.View style={styles.container}>
|
|
27
|
-
{circleInfos.map(
|
|
28
|
-
var title = _a.title, rate = _a.rate;
|
|
29
|
-
return (<react_native_1.View key={title} style={styles.itemBox}>
|
|
25
|
+
{circleInfos.map(({ title, rate }) => (<react_native_1.View key={title} style={styles.itemBox}>
|
|
30
26
|
<SubCategoryLeft_1.default rate={rate} isLocked={false}/>
|
|
31
27
|
<common_1.MyText style={{ fontSize: 11 }}>{title}</common_1.MyText>
|
|
32
|
-
</react_native_1.View>)
|
|
33
|
-
})}
|
|
28
|
+
</react_native_1.View>))}
|
|
34
29
|
</react_native_1.View>);
|
|
35
30
|
};
|
|
36
|
-
|
|
31
|
+
const styles = react_native_1.StyleSheet.create({
|
|
37
32
|
container: {
|
|
38
33
|
flex: 1,
|
|
39
34
|
flexDirection: "row",
|
|
@@ -3,36 +3,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var key = _a.key, title = _a.title;
|
|
19
|
-
var tags = QuestionDBInfo.system === "JLPT"
|
|
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 tagFncJ_1 = require("../../functions/tagFncJ");
|
|
10
|
+
const tagFncD_1 = require("../../functions/tagFncD");
|
|
11
|
+
const SubCategoryLeft_1 = __importDefault(require("../Basic/SubCategoryLeft"));
|
|
12
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
13
|
+
const common_1 = require("@nakamura-123/common");
|
|
14
|
+
const YearCircles = ({ QuestionDBInfo }) => {
|
|
15
|
+
const yearList = (0, react_redux_1.useSelector)((state) => state.app.yearList);
|
|
16
|
+
const circleInfos = yearList.map(({ key, title }) => {
|
|
17
|
+
const tags = QuestionDBInfo.system === "JLPT"
|
|
20
18
|
? (0, tagFncJ_1.getCategoryTagLevelCntsJ)(QuestionDBInfo.query, key, "listenTag")
|
|
21
19
|
: (0, tagFncD_1.getCategoryTagLevelCntsD)(QuestionDBInfo.query, key, "year");
|
|
22
|
-
|
|
23
|
-
return { title
|
|
20
|
+
const rate = Math.round((0, tagFncD_1.getCategoryRate)(tags));
|
|
21
|
+
return { title, rate };
|
|
24
22
|
});
|
|
25
23
|
return (<react_native_1.View style={styles.container}>
|
|
26
|
-
{circleInfos.map(
|
|
27
|
-
var title = _a.title, rate = _a.rate;
|
|
28
|
-
return (<react_native_1.View key={title} style={styles.itemBox}>
|
|
24
|
+
{circleInfos.map(({ title, rate }) => (<react_native_1.View key={title} style={styles.itemBox}>
|
|
29
25
|
<SubCategoryLeft_1.default rate={rate} isLocked={false}/>
|
|
30
26
|
<common_1.MyText style={{ fontSize: 11 }}>{title}</common_1.MyText>
|
|
31
|
-
</react_native_1.View>)
|
|
32
|
-
})}
|
|
27
|
+
</react_native_1.View>))}
|
|
33
28
|
</react_native_1.View>);
|
|
34
29
|
};
|
|
35
|
-
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
36
31
|
container: {
|
|
37
32
|
flex: 1,
|
|
38
33
|
flexDirection: "row",
|
package/dist/component/Guide.js
CHANGED
|
@@ -3,13 +3,12 @@ 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
|
-
|
|
6
|
+
const common_1 = require("@nakamura-123/common");
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
8
|
// ガイド情報を取得
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var getGuideInfo = function (guideName) {
|
|
9
|
+
const Guide = ({ children, name, isVisible }) => {
|
|
10
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
11
|
+
const getGuideInfo = (guideName) => {
|
|
13
12
|
switch (guideName) {
|
|
14
13
|
case "basicPageNav":
|
|
15
14
|
return {
|
|
@@ -55,7 +54,7 @@ var Guide = function (_a) {
|
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
|
-
|
|
57
|
+
const guideInfo = getGuideInfo(name);
|
|
59
58
|
return (<common_1.Tooltip content={guideInfo.msg} isVisible={isVisible} placement={guideInfo.position} guideName={guideInfo.name}>
|
|
60
59
|
{children}
|
|
61
60
|
</common_1.Tooltip>);
|