@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
|
@@ -3,38 +3,38 @@ 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 isAndroid = react_native_1.Platform.OS === "android";
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const CatchCopy_1 = __importDefault(require("./CatchCopy"));
|
|
11
|
+
const Recommend_1 = __importDefault(require("./Recommend"));
|
|
12
|
+
const AppReviews_1 = __importDefault(require("./AppReviews"));
|
|
13
|
+
const WaitingPayBanner_1 = __importDefault(require("./WaitingPayBanner"));
|
|
14
|
+
const CoinPageComponent = ({ navigation, comments, products, onPurchase, onRestore, loading, isAllfreePaid, warningContent, }) => {
|
|
15
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
16
|
+
const isAndroid = react_native_1.Platform.OS === "android";
|
|
18
17
|
return (<>
|
|
19
18
|
<common_1.Spinner loading={loading}/>
|
|
20
19
|
<react_native_1.ScrollView style={styles.container}>
|
|
21
20
|
<CatchCopy_1.default />
|
|
21
|
+
{warningContent}
|
|
22
22
|
<Recommend_1.default />
|
|
23
|
-
<common_1.RoundRectangleIcon title={t("coin.title.faq")} icon="book" onPress={
|
|
23
|
+
<common_1.RoundRectangleIcon title={t("coin.title.faq")} icon="book" onPress={() => navigation.navigate("FAQ")}/>
|
|
24
24
|
<WaitingPayBanner_1.default currentPage="coin"/>
|
|
25
25
|
|
|
26
|
-
{products.map(
|
|
27
|
-
console.log(
|
|
26
|
+
{products.map((product, index) => {
|
|
27
|
+
console.log(`UIで表示する商品[${index}]:`, {
|
|
28
28
|
id: product.id,
|
|
29
29
|
productId: product.productId,
|
|
30
30
|
title: product.title,
|
|
31
31
|
});
|
|
32
|
-
|
|
32
|
+
const name = isAndroid
|
|
33
33
|
? product.nameAndroid || product.title
|
|
34
34
|
: product.title;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return (<common_1.RectangleCard key={index} title={title} note={product.description} left={<common_1.IconInCircle name="gift"/>} color={isAllfreePaid ? "ltBlack" : "blue"} onPress={
|
|
35
|
+
const price = product.displayPrice;
|
|
36
|
+
const title = `${name} ${price}`;
|
|
37
|
+
return (<common_1.RectangleCard key={index} title={title} note={product.description} left={<common_1.IconInCircle name="gift"/>} color={isAllfreePaid ? "ltBlack" : "blue"} onPress={() => {
|
|
38
38
|
console.log("購入前: ", product.id);
|
|
39
39
|
isAllfreePaid ? null : onPurchase(product.id);
|
|
40
40
|
}}/>);
|
|
@@ -47,9 +47,9 @@ var CoinPageComponent = function (_a) {
|
|
|
47
47
|
{t("coin.comment.android")}
|
|
48
48
|
</common_1.MyText>)}
|
|
49
49
|
</react_native_1.View>
|
|
50
|
-
<common_1.RoundRectangleIcon title={t("coin.title.restore")} icon="coins" onPress={
|
|
50
|
+
<common_1.RoundRectangleIcon title={t("coin.title.restore")} icon="coins" onPress={() => onRestore()}/>
|
|
51
51
|
<react_native_1.View style={styles.serviceBox}>
|
|
52
|
-
<common_1.MyText fsize="md" color="blue" onPress={
|
|
52
|
+
<common_1.MyText fsize="md" color="blue" onPress={() => react_native_1.Linking.openURL("https://drill-notes.com/kiyaku")}>
|
|
53
53
|
{t("coin.title.terms")}
|
|
54
54
|
</common_1.MyText>
|
|
55
55
|
</react_native_1.View>
|
|
@@ -59,7 +59,7 @@ var CoinPageComponent = function (_a) {
|
|
|
59
59
|
</react_native_1.ScrollView>
|
|
60
60
|
</>);
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
const styles = react_native_1.StyleSheet.create({
|
|
63
63
|
container: {
|
|
64
64
|
flex: 1,
|
|
65
65
|
backgroundColor: lib_1.colors.beige,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validatePurchaseClientSide = exports.unifyReceipt = void 0;
|
|
4
4
|
// 01. レシートの形式を統一
|
|
5
|
-
|
|
5
|
+
const unifyReceipt = (receipt) => {
|
|
6
6
|
try {
|
|
7
7
|
// 必須フィールドの検証
|
|
8
8
|
if (!receipt || !receipt.productId) {
|
|
@@ -11,7 +11,7 @@ var unifyReceipt = function (receipt) {
|
|
|
11
11
|
}
|
|
12
12
|
// expo-iap 2.9.7では transactionId の代わりに id を使用
|
|
13
13
|
// Androidで支払い待ち状態の場合、transactionIdがnullになることがあるため、purchaseTokenをフォールバックとして使用
|
|
14
|
-
|
|
14
|
+
let transactionId = receipt.transactionId || receipt.id;
|
|
15
15
|
if (receipt.platform === "android") {
|
|
16
16
|
if (!receipt.purchaseToken) {
|
|
17
17
|
console.warn("無効なAndroidレシート: purchaseTokenが不足しています");
|
|
@@ -60,7 +60,7 @@ var unifyReceipt = function (receipt) {
|
|
|
60
60
|
};
|
|
61
61
|
exports.unifyReceipt = unifyReceipt;
|
|
62
62
|
// 02. レシートの検証
|
|
63
|
-
|
|
63
|
+
const validatePurchaseClientSide = (receipt, platform) => {
|
|
64
64
|
try {
|
|
65
65
|
// 1. レシートが存在するか確認
|
|
66
66
|
if (!receipt || receipt.length < 10) {
|
|
@@ -3,13 +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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
const common_1 = require("@nakamura-123/common");
|
|
7
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
const Recommend = () => {
|
|
11
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
12
|
+
const items = [
|
|
13
13
|
{
|
|
14
14
|
title: t("coin.recommend.title1"),
|
|
15
15
|
sub: t("coin.recommend.msg1"),
|
|
@@ -35,7 +35,7 @@ var Recommend = function () {
|
|
|
35
35
|
<react_native_1.View style={styles.topRound}>
|
|
36
36
|
<common_1.RoundRectangle title={t("coin.title.recommend")} color="blue" width={200}/>
|
|
37
37
|
</react_native_1.View>
|
|
38
|
-
{items.map(
|
|
38
|
+
{items.map((item, index) => (<react_native_1.View key={index} style={styles.contentBox}>
|
|
39
39
|
<react_native_1.View style={styles.iconBox}>
|
|
40
40
|
<common_1.IconInCircle name={item.icon} circleColor="ltBlue" iconColor="gray" size={25}/>
|
|
41
41
|
</react_native_1.View>
|
|
@@ -47,10 +47,10 @@ var Recommend = function () {
|
|
|
47
47
|
{item.sub}
|
|
48
48
|
</common_1.MyText>
|
|
49
49
|
</react_native_1.View>
|
|
50
|
-
</react_native_1.View>)
|
|
50
|
+
</react_native_1.View>))}
|
|
51
51
|
</react_native_1.View>);
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
const styles = react_native_1.StyleSheet.create({
|
|
54
54
|
container: {
|
|
55
55
|
flex: 1,
|
|
56
56
|
justifyContent: "center",
|
|
@@ -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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var allFreeState = (0, react_redux_1.useSelector)(function (state) { return state.setting.payment.allFreeState; });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_redux_1 = require("react-redux");
|
|
8
|
+
const common_1 = require("@nakamura-123/common");
|
|
9
|
+
const homeMsg = "支払い後にアンロックページで「以前購入した方はこちらから復元」をタップしてください";
|
|
10
|
+
const coinMsg = "支払い後に「以前購入した方はこちらから復元」をタップしてください";
|
|
11
|
+
const WaitingPayBanner = ({ currentPage }) => {
|
|
12
|
+
const msg = currentPage === "home" ? homeMsg : coinMsg;
|
|
13
|
+
const allFreeState = (0, react_redux_1.useSelector)((state) => state.setting.payment.allFreeState);
|
|
15
14
|
if (allFreeState !== "wait")
|
|
16
15
|
return null;
|
|
17
16
|
return <common_1.ModalBanner bannerMsg={msg}/>;
|
|
@@ -3,19 +3,18 @@ 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 MSG = _a.MSG;
|
|
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 Description = ({ MSG }) => {
|
|
12
11
|
return (<react_native_1.View style={styles.discriptionBox}>
|
|
13
12
|
<common_1.MyText fsize="sm" color="gray">
|
|
14
13
|
{MSG}
|
|
15
14
|
</common_1.MyText>
|
|
16
15
|
</react_native_1.View>);
|
|
17
16
|
};
|
|
18
|
-
|
|
17
|
+
const styles = react_native_1.StyleSheet.create({
|
|
19
18
|
discriptionBox: {
|
|
20
19
|
padding: 10,
|
|
21
20
|
backgroundColor: lib_1.colors.bkBeige,
|
|
@@ -3,21 +3,21 @@ 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
|
-
|
|
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 TagBadge5s = ({}) => {
|
|
13
|
+
const TagDB = (0, react_2.useQuery)(db_1.TagSchema);
|
|
14
|
+
const tagLegels = TagDB.map((tag) => tag.level);
|
|
15
|
+
const tag5Infos = (0, tagFncD_1.countTagsByLevel)(tagLegels);
|
|
16
16
|
return (<react_native_1.View style={styles.container}>
|
|
17
|
-
{tag5Infos.map(
|
|
17
|
+
{tag5Infos.map((tag, i) => (<common_1.Badge key={i} name={String(tag.cnt)} icon={"tag"} circleColor={tag.color} style={styles.badge}/>))}
|
|
18
18
|
</react_native_1.View>);
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
const styles = react_native_1.StyleSheet.create({
|
|
21
21
|
container: {
|
|
22
22
|
flexDirection: "row",
|
|
23
23
|
justifyContent: "space-between",
|
|
@@ -1,54 +1,42 @@
|
|
|
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
|
-
var maxBadgeCnt = list.length;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_2 = require("@realm/react");
|
|
9
|
+
const react_redux_1 = require("react-redux");
|
|
10
|
+
const common_1 = require("@nakamura-123/common");
|
|
11
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
12
|
+
const db_1 = require("@nakamura-123/db");
|
|
13
|
+
const BasicBadge = ({ info }) => {
|
|
14
|
+
const BadgesDB = (0, react_2.useQuery)(db_1.BadgeSchema);
|
|
15
|
+
const basicBadgeSet = lib_1.badgeSet.badge5Sets.basic;
|
|
16
|
+
const list = (0, react_redux_1.useSelector)((state) => state.app[info.list]);
|
|
17
|
+
const maxBadgeCnt = list.length;
|
|
30
18
|
// バッジ情報をまとめる
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return
|
|
19
|
+
const badge5sInfos = basicBadgeSet.map((badge) => {
|
|
20
|
+
const matchingBadges = BadgesDB.filtered("subject == $0 AND badgeId == $1", info.subject, badge.id);
|
|
21
|
+
const matchCnt = matchingBadges.length;
|
|
22
|
+
return Object.assign(Object.assign({}, badge), { isExist: matchCnt > 0, matchCnt });
|
|
35
23
|
});
|
|
36
24
|
// バッジを集計
|
|
37
25
|
return (<react_native_1.View style={styles.container}>
|
|
38
26
|
<common_1.IconTitle title={info.name} icon={info.icon} withBackground/>
|
|
39
27
|
<react_native_1.View style={styles.badgeBox}>
|
|
40
|
-
{badge5sInfos.map(
|
|
28
|
+
{badge5sInfos.map((badge) => (<react_native_1.View style={styles.badge} key={badge.id}>
|
|
41
29
|
<common_1.Badge name={badge.name} icon={badge.icon} badgeColor={badge.color} isEmpty={!badge.isExist}/>
|
|
42
30
|
<react_native_1.View style={styles.txtBox}>
|
|
43
31
|
<common_1.MyText fsize="sm" style={styles.txt}>
|
|
44
|
-
{
|
|
32
|
+
{`${badge.matchCnt}/${maxBadgeCnt}`}
|
|
45
33
|
</common_1.MyText>
|
|
46
34
|
</react_native_1.View>
|
|
47
|
-
</react_native_1.View>)
|
|
35
|
+
</react_native_1.View>))}
|
|
48
36
|
</react_native_1.View>
|
|
49
37
|
</react_native_1.View>);
|
|
50
38
|
};
|
|
51
|
-
|
|
39
|
+
const styles = react_native_1.StyleSheet.create({
|
|
52
40
|
container: {
|
|
53
41
|
// marginBottom: 10,
|
|
54
42
|
},
|
|
@@ -3,17 +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
|
-
var visible = _a.visible, optionInfo = _a.optionInfo, handleChange = _a.handleChange, selectedValue = _a.selectedValue, onClose = _a.onClose;
|
|
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 ChangeWeeklyModal = ({ visible, optionInfo, handleChange, selectedValue, onClose, }) => {
|
|
11
10
|
return (<common_1.BaseModal isVisible={visible} onClose={onClose}>
|
|
12
11
|
<common_1.MyText fsize="lg">目標を選んでください</common_1.MyText>
|
|
13
|
-
<react_native_1.FlatList data={optionInfo} keyExtractor={
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return (<react_native_1.TouchableOpacity onPress={function () { return handleChange(item.value); }} style={styles.option}>
|
|
12
|
+
<react_native_1.FlatList data={optionInfo} keyExtractor={(item) => item.value.toString()} style={styles.listContainer} showsVerticalScrollIndicator={false} renderItem={({ item }) => {
|
|
13
|
+
const color = item.value === selectedValue ? "red" : "black";
|
|
14
|
+
return (<react_native_1.TouchableOpacity onPress={() => handleChange(item.value)} style={styles.option}>
|
|
17
15
|
<common_1.MyText fsize="md" color={color} style={{ textAlign: "center" }}>
|
|
18
16
|
{item.text}
|
|
19
17
|
</common_1.MyText>
|
|
@@ -24,7 +22,7 @@ var ChangeWeeklyModal = function (_a) {
|
|
|
24
22
|
</react_native_1.View>
|
|
25
23
|
</common_1.BaseModal>);
|
|
26
24
|
};
|
|
27
|
-
|
|
25
|
+
const styles = react_native_1.StyleSheet.create({
|
|
28
26
|
container: { flex: 1, justifyContent: "center", alignItems: "center" },
|
|
29
27
|
button: { backgroundColor: "blue", padding: 10, borderRadius: 5 },
|
|
30
28
|
buttonText: { color: "white", fontSize: 16 },
|
|
@@ -26,35 +26,34 @@ 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
|
-
|
|
47
|
-
var handleChange = function (value) {
|
|
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 react_2 = require("@realm/react");
|
|
33
|
+
const react_redux_2 = require("react-redux");
|
|
34
|
+
const common_1 = require("@nakamura-123/common");
|
|
35
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
36
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
37
|
+
const db_1 = require("@nakamura-123/db");
|
|
38
|
+
const ChangeWeeklyModal_1 = __importDefault(require("./ChangeWeeklyModal"));
|
|
39
|
+
const optionInfo = lib_1.gradeSet.weeklyTargetInfo;
|
|
40
|
+
const ChangeWeeklyTargetBtn = ({ color, }) => {
|
|
41
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
42
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
43
|
+
const realm = (0, react_2.useRealm)();
|
|
44
|
+
const selectedValue = (0, react_redux_2.useSelector)((state) => state.setting.grade.weeklyTargetCnt);
|
|
45
|
+
const [isVisible, setIsVisible] = (0, react_1.useState)(false);
|
|
46
|
+
const handleChange = (value) => {
|
|
48
47
|
dispatch({ type: "setting/updateTargetCnt", payload: value });
|
|
49
48
|
db_1.DailyLogModel.updateWeeklyTargetCnt(realm, Math.floor(value / 7));
|
|
50
49
|
dispatch(stores_1.settingStorage.saveSetting());
|
|
51
50
|
};
|
|
52
51
|
return (<react_native_1.View style={styles.container}>
|
|
53
|
-
<common_1.RoundRectangle title={t("grade.gradeCard.changeTarget")} onPress={
|
|
54
|
-
<ChangeWeeklyModal_1.default visible={isVisible} optionInfo={optionInfo} onClose={
|
|
52
|
+
<common_1.RoundRectangle title={t("grade.gradeCard.changeTarget")} onPress={() => setIsVisible(true)} color={color}/>
|
|
53
|
+
<ChangeWeeklyModal_1.default visible={isVisible} optionInfo={optionInfo} onClose={() => setIsVisible(false)} handleChange={handleChange} selectedValue={selectedValue}/>
|
|
55
54
|
</react_native_1.View>);
|
|
56
55
|
};
|
|
57
|
-
|
|
56
|
+
const styles = react_native_1.StyleSheet.create({
|
|
58
57
|
container: { flex: 1, padding: 10 },
|
|
59
58
|
pickerContainer: { flex: 1, justifyContent: "center", alignItems: "center" },
|
|
60
59
|
});
|
|
@@ -3,26 +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
|
-
var dispatch = (0, react_redux_1.useDispatch)();
|
|
17
|
-
var handleDateSelect = function (day) {
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const react_native_calendars_1 = require("react-native-calendars");
|
|
9
|
+
const common_1 = require("@nakamura-123/common");
|
|
10
|
+
const react_redux_1 = require("react-redux");
|
|
11
|
+
const stores_1 = require("@nakamura-123/stores");
|
|
12
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
13
|
+
const DatePickerModal = ({ targetDay, isVisible, onClose, }) => {
|
|
14
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
15
|
+
const handleDateSelect = (day) => {
|
|
18
16
|
if (lib_1.timeFnc.compareToday(day.dateString) !== "future")
|
|
19
17
|
return;
|
|
20
18
|
dispatch({ type: "setting/updateTargetDay", payload: day.dateString });
|
|
21
19
|
dispatch(stores_1.settingStorage.saveSetting());
|
|
22
20
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const renderCustomHeader = (date) => {
|
|
22
|
+
const month = date.getMonth() + 1; // 月を取得(0ベースのため +1)
|
|
23
|
+
const year = date.getFullYear(); // 年を取得
|
|
26
24
|
return (<common_1.MyText style={styles.headerText}>
|
|
27
25
|
{year}年 {month}月
|
|
28
26
|
</common_1.MyText>);
|
|
@@ -30,13 +28,13 @@ var DatePickerModal = function (_a) {
|
|
|
30
28
|
return (<common_1.CloseBtnModal isVisible={isVisible} onClose={onClose}>
|
|
31
29
|
<react_native_1.View style={styles.container}>
|
|
32
30
|
<react_native_calendars_1.Calendar onDayPress={handleDateSelect} // 日付選択イベント
|
|
33
|
-
markedDates={
|
|
34
|
-
|
|
31
|
+
markedDates={{
|
|
32
|
+
[targetDay || ""]: {
|
|
35
33
|
selected: true,
|
|
36
34
|
marked: true,
|
|
37
35
|
selectedColor: lib_1.colors.red,
|
|
38
36
|
},
|
|
39
|
-
|
|
37
|
+
}} renderHeader={renderCustomHeader} // ヘッダーをカスタマイズ
|
|
40
38
|
theme={{
|
|
41
39
|
calendarBackground: "white",
|
|
42
40
|
selectedDayBackgroundColor: lib_1.colors.red,
|
|
@@ -49,7 +47,7 @@ var DatePickerModal = function (_a) {
|
|
|
49
47
|
</react_native_1.View>
|
|
50
48
|
</common_1.CloseBtnModal>);
|
|
51
49
|
};
|
|
52
|
-
|
|
50
|
+
const styles = react_native_1.StyleSheet.create({
|
|
53
51
|
container: {
|
|
54
52
|
padding: 20,
|
|
55
53
|
backgroundColor: "white",
|
|
@@ -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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var BASE_COLOR = "dkBeige";
|
|
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 db_1 = require("@nakamura-123/db");
|
|
10
|
+
const TargetDate_1 = __importDefault(require("./TargetDate"));
|
|
11
|
+
const Square3sGrade_1 = __importDefault(require("./Square3sGrade"));
|
|
12
|
+
const lib_1 = require("@nakamura-123/lib");
|
|
13
|
+
const WeeklyAchivedRate_1 = __importDefault(require("./WeeklyAchivedRate"));
|
|
14
|
+
const ChangeWeeklyTargetBtn_1 = __importDefault(require("./ChangeWeeklyTargetBtn"));
|
|
15
|
+
const WeeklyProgress_1 = __importDefault(require("./WeeklyProgress"));
|
|
16
|
+
const react_2 = require("@realm/react");
|
|
17
|
+
const GradeCard = ({ DailyLogDB }) => {
|
|
18
|
+
const realm = (0, react_2.useRealm)();
|
|
19
|
+
const BASE_COLOR = "dkBeige";
|
|
21
20
|
// データベースの読み込み
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
const dailyLog = db_1.DailyLogModel.readTodayDailyLog(realm);
|
|
22
|
+
const weeklyLogs = db_1.DailyLogModel.readWeeklyLogs(DailyLogDB);
|
|
23
|
+
const weeklyQuizCntTotal = weeklyLogs.reduce((a, c) => a + c.quizCnt, 0);
|
|
24
|
+
const weeklyTargetCnt = (0, react_redux_1.useSelector)((state) => state.setting.grade.weeklyTargetCnt);
|
|
26
25
|
return (<react_native_1.View style={styles.container}>
|
|
27
26
|
<TargetDate_1.default color={BASE_COLOR}/>
|
|
28
27
|
<Square3sGrade_1.default dailyLog={dailyLog} weeklyQuizCntTotal={weeklyQuizCntTotal} weeklyTargetCnt={weeklyTargetCnt} color={BASE_COLOR}/>
|
|
@@ -33,7 +32,7 @@ var GradeCard = function (_a) {
|
|
|
33
32
|
<WeeklyProgress_1.default weeklyLogs={weeklyLogs} weeklyTargetCnt={weeklyTargetCnt} color={BASE_COLOR}/>
|
|
34
33
|
</react_native_1.View>);
|
|
35
34
|
};
|
|
36
|
-
|
|
35
|
+
const styles = react_native_1.StyleSheet.create({
|
|
37
36
|
container: {
|
|
38
37
|
flex: 1,
|
|
39
38
|
alignItems: "center",
|
|
@@ -3,32 +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
|
-
var t = (0, common_1.useDrillTranslation)().t;
|
|
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 db_1 = require("@nakamura-123/db");
|
|
11
|
+
const gradeFnc_1 = require("../../../functions/gradeFnc");
|
|
12
|
+
const Square3sGrade = ({ dailyLog, weeklyQuizCntTotal, weeklyTargetCnt, color, }) => {
|
|
13
|
+
const DailyDB = (0, react_2.useQuery)(db_1.DailyLogSchema);
|
|
14
|
+
const { t } = (0, common_1.useDrillTranslation)();
|
|
16
15
|
// 01_今日の学習回数を算出
|
|
17
|
-
|
|
16
|
+
const { quizCnt, targetCnt } = (0, gradeFnc_1.formatTodayLog)(dailyLog);
|
|
18
17
|
// 03_連続学習日数を算出
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const consecutiveDays = (0, gradeFnc_1.getConsecutiveStudyDays)(DailyDB);
|
|
19
|
+
const info = [
|
|
21
20
|
{
|
|
22
21
|
// 今日の学習回数
|
|
23
22
|
cnt: quizCnt,
|
|
24
|
-
cntText:
|
|
23
|
+
cntText: `/ ${targetCnt}`,
|
|
25
24
|
label: t("grade.gradeCard.today"),
|
|
26
25
|
icon: "clock",
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
// 今週の学習回数
|
|
30
29
|
cnt: weeklyQuizCntTotal,
|
|
31
|
-
cntText:
|
|
30
|
+
cntText: `/ ${weeklyTargetCnt}`,
|
|
32
31
|
label: t("grade.gradeCard.weekly"),
|
|
33
32
|
icon: "chart-bar",
|
|
34
33
|
},
|
|
@@ -40,14 +39,14 @@ var Square3sGrade = function (_a) {
|
|
|
40
39
|
},
|
|
41
40
|
];
|
|
42
41
|
return (<react_native_1.View style={styles.container}>
|
|
43
|
-
{info.map(
|
|
42
|
+
{info.map((item, index) => {
|
|
44
43
|
return (<common_1.MiniSquare key={index} cnt={item.cnt} cntText={item.cntText} label={item.label} borderColor="ltBlack">
|
|
45
44
|
<common_1.Icon5 name={item.icon} size={20} color={color}/>
|
|
46
45
|
</common_1.MiniSquare>);
|
|
47
46
|
})}
|
|
48
47
|
</react_native_1.View>);
|
|
49
48
|
};
|
|
50
|
-
|
|
49
|
+
const styles = react_native_1.StyleSheet.create({
|
|
51
50
|
container: {
|
|
52
51
|
width: "100%",
|
|
53
52
|
flexDirection: "row",
|