@nakamura-123/pages 1.0.8 → 1.0.10

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.
@@ -77,12 +77,11 @@ var QuizSetup = function (_a) {
77
77
  <QuizOptionDrill_1.default />
78
78
  {system === "JLPT" && (<common_1.RoundRectangleIcon icon="cog" title="Detail Setting" onPress={handleDetail}/>)}
79
79
  {system === "JLPT" && (<common_1.VibrationText>*{t("setup.turnOffSilent")}</common_1.VibrationText>)}
80
+ <react_native_1.View style={styles.btnBox}>
81
+ <common_1.MiniIconBtn onPress={function () { return handlePreStudy(); }} icon="book" title={t("setup.btn.study")} color="ltBlack"/>
82
+ <common_1.MiniIconBtn onPress={function () { return handleStart(); }} icon="play" title={t("setup.btn.start")} color="red"/>
83
+ </react_native_1.View>
80
84
  </react_native_gesture_handler_1.ScrollView>
81
-
82
- <react_native_1.View style={styles.btnBox}>
83
- <common_1.MiniIconBtn onPress={function () { return handlePreStudy(); }} icon="book" title={t("setup.btn.study")} color="ltBlack"/>
84
- <common_1.MiniIconBtn onPress={function () { return handleStart(); }} icon="play" title={t("setup.btn.start")} color="red"/>
85
- </react_native_1.View>
86
85
  </react_native_1.View>);
87
86
  };
88
87
  var styles = react_native_1.StyleSheet.create({
@@ -96,10 +95,10 @@ var styles = react_native_1.StyleSheet.create({
96
95
  flex: 1,
97
96
  },
98
97
  btnBox: {
98
+ marginTop: 20,
99
99
  flexDirection: "row",
100
100
  justifyContent: "space-around",
101
101
  alignItems: "center",
102
- paddingVertical: 5,
103
102
  },
104
103
  });
105
104
  exports.default = QuizSetup;
@@ -19,6 +19,7 @@ var SettingPage = function (_a) {
19
19
  var dispatch = (0, react_redux_1.useDispatch)();
20
20
  var existInputQuiz = (0, react_redux_1.useSelector)(function (state) { var _a; return (_a = state.app.appSetting.setting) === null || _a === void 0 ? void 0 : _a.existInputQuiz; });
21
21
  var oldInfo = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.oldInfo; });
22
+ var displayOldSystemBtn = Array.isArray(oldInfo.testInfo) && oldInfo.testInfo.length > 0;
22
23
  var isJLPT = (0, react_redux_1.useSelector)(function (state) { return state.app.appSetting.setting.appSystem; }) === "JLPT";
23
24
  var settingInfo = [
24
25
  {
@@ -55,7 +56,7 @@ var SettingPage = function (_a) {
55
56
  icon: "exchange-alt",
56
57
  color: "yellow",
57
58
  handlePress: function () {
58
- if (!oldInfo.testInfo || oldInfo.testInfo.length === 0)
59
+ if (!oldInfo.testInfo || oldInfo.testInfo.length < 1)
59
60
  react_native_1.Alert.alert(t("setting.oldSystem.error"), t("setting.oldSystem.errorMsg"));
60
61
  (0, oldStorageFnc_1.handleOldData)(realm, oldInfo, dispatch, t);
61
62
  },
@@ -64,6 +65,8 @@ var SettingPage = function (_a) {
64
65
  // JLPTの場合、古いデータを移行するボタンを削除
65
66
  if (isJLPT)
66
67
  settingInfo = settingInfo.filter(function (info) { return info.title !== t("setting.oldSystem.title"); });
68
+ if (!displayOldSystemBtn)
69
+ settingInfo = settingInfo.filter(function (info) { return info.title !== t("setting.oldSystem.title"); });
67
70
  if (existInputQuiz)
68
71
  settingInfo.push({
69
72
  title: t("setting.saveInput.title"),
@@ -5,9 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
7
  var react_native_1 = require("react-native");
8
- var common_1 = require("@nakamura-123/common");
9
8
  var quizActionHook_1 = require("../../hooks/quizActionHook");
10
- var lib_1 = require("@nakamura-123/lib");
9
+ var CheckButton_1 = __importDefault(require("./CheckButton"));
11
10
  var BlankBtn = function () {
12
11
  var useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)();
13
12
  var handleCheck = function (isCorrect) {
@@ -16,17 +15,10 @@ var BlankBtn = function () {
16
15
  useHandleCheck(isCorrect);
17
16
  };
18
17
  return (<react_native_1.View style={styles.container}>
19
- <CheckButton text="不正解" iconName="times" backgroundColor={lib_1.colors.blue} onPress={function () { return handleCheck(false); }}/>
20
- <CheckButton text="正解" iconName="check" backgroundColor={lib_1.colors.red} onPress={function () { return handleCheck(true); }}/>
18
+ <CheckButton_1.default text="不正解" iconName="times" backgroundColor="blue" onPress={function () { return handleCheck(false); }}/>
19
+ <CheckButton_1.default text="正解" iconName="check" backgroundColor="red" onPress={function () { return handleCheck(true); }}/>
21
20
  </react_native_1.View>);
22
21
  };
23
- var CheckButton = function (_a) {
24
- var text = _a.text, iconName = _a.iconName, backgroundColor = _a.backgroundColor, onPress = _a.onPress;
25
- return (<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: backgroundColor }]} onPress={onPress} activeOpacity={0.7}>
26
- <common_1.IconInCircle name={iconName} size={17} cStyle={styles.iconCircle}/>
27
- <common_1.MyText style={styles.buttonText}>{text}</common_1.MyText>
28
- </react_native_1.TouchableOpacity>);
29
- };
30
22
  var styles = react_native_1.StyleSheet.create({
31
23
  container: {
32
24
  width: "100%",
@@ -34,22 +26,5 @@ var styles = react_native_1.StyleSheet.create({
34
26
  flexDirection: "row",
35
27
  justifyContent: "space-between",
36
28
  },
37
- button: {
38
- width: "49%",
39
- borderRadius: 8,
40
- paddingVertical: 7,
41
- paddingHorizontal: 10,
42
- flexDirection: "row",
43
- justifyContent: "center",
44
- alignItems: "center",
45
- },
46
- iconCircle: {
47
- width: 27,
48
- height: 27,
49
- },
50
- buttonText: {
51
- color: lib_1.colors.ltBeige,
52
- marginLeft: 5,
53
- },
54
29
  });
55
30
  exports.default = BlankBtn;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { ColorKeys } from "@nakamura-123/lib";
3
+ interface Props {
4
+ text: string;
5
+ iconName: string;
6
+ backgroundColor: ColorKeys;
7
+ onPress: () => void;
8
+ }
9
+ declare const CheckButton: React.FC<Props>;
10
+ export default CheckButton;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = __importDefault(require("react"));
7
+ var react_native_1 = require("react-native");
8
+ var common_1 = require("@nakamura-123/common");
9
+ var lib_1 = require("@nakamura-123/lib");
10
+ var CheckButton = function (_a) {
11
+ var text = _a.text, iconName = _a.iconName, backgroundColor = _a.backgroundColor, onPress = _a.onPress;
12
+ return (<react_native_1.TouchableOpacity style={[styles.button, { backgroundColor: lib_1.colors[backgroundColor] }]} onPress={onPress} activeOpacity={0.7}>
13
+ <common_1.IconInCircle name={iconName} size={17} cStyle={styles.iconCircle}/>
14
+ <common_1.MyText style={styles.buttonText}>{text}</common_1.MyText>
15
+ </react_native_1.TouchableOpacity>);
16
+ };
17
+ var styles = react_native_1.StyleSheet.create({
18
+ button: {
19
+ width: "49%",
20
+ borderRadius: 8,
21
+ paddingVertical: 7,
22
+ paddingHorizontal: 10,
23
+ flexDirection: "row",
24
+ justifyContent: "center",
25
+ alignItems: "center",
26
+ },
27
+ iconCircle: {
28
+ width: 27,
29
+ height: 27,
30
+ },
31
+ buttonText: {
32
+ color: lib_1.colors.ltBeige,
33
+ marginLeft: 5,
34
+ },
35
+ });
36
+ exports.default = CheckButton;
@@ -1,24 +1,12 @@
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
6
  var react_1 = __importDefault(require("react"));
18
7
  var react_native_1 = require("react-native");
19
- var common_1 = require("@nakamura-123/common");
20
- var lib_1 = require("@nakamura-123/lib");
21
8
  var quizActionHook_1 = require("../../../hooks/quizActionHook");
9
+ var CheckButton_1 = __importDefault(require("../CheckButton"));
22
10
  var InputAnswerBtn = function () {
23
11
  var useHandleCheck = (0, quizActionHook_1.useChangeModeToCheck)();
24
12
  var buttons = [
@@ -26,29 +14,14 @@ var InputAnswerBtn = function () {
26
14
  { text: "正 解", color: "red", icon: "check", isCheck: true },
27
15
  ];
28
16
  return (<react_native_1.View style={styles.container}>
29
- {buttons.map(function (btn, index) { return (<react_native_1.TouchableOpacity key={index} style={__assign(__assign({}, styles.btn), { backgroundColor: lib_1.colors[btn.color] })} onPress={function () { return useHandleCheck && useHandleCheck(btn.isCheck); }} activeOpacity={0.7}>
30
- <common_1.IconInCircle name={btn.icon} circleColor="white" iconColor={btn.color} size={13} cStyle={styles.icon}/>
31
- <common_1.MyText weight={700} color="white">
32
- {btn.text}
33
- </common_1.MyText>
34
- </react_native_1.TouchableOpacity>); })}
17
+ {buttons.map(function (btn, index) { return (<CheckButton_1.default key={index} text={btn.text} iconName={btn.icon} backgroundColor={btn.color} onPress={function () { return useHandleCheck && useHandleCheck(btn.isCheck); }}/>); })}
35
18
  </react_native_1.View>);
36
19
  };
37
20
  var styles = react_native_1.StyleSheet.create({
38
21
  container: {
39
22
  flexDirection: "row",
40
- },
41
- icon: {
42
- width: 20,
43
- height: 20,
44
- marginRight: 10,
45
- },
46
- btn: {
47
- flex: 1,
48
- padding: 5,
49
- flexDirection: "row",
50
- justifyContent: "center",
51
- alignItems: "center",
23
+ width: "100%",
24
+ justifyContent: "space-between",
52
25
  },
53
26
  });
54
27
  exports.default = InputAnswerBtn;