@nakamura-123/pages 1.3.2 → 1.3.4

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.
@@ -1,3 +1,3 @@
1
1
  export declare const checkPassword: (password: string) => boolean;
2
2
  export declare const checkId: (id: string) => boolean;
3
- export declare const correctAlart: () => void;
3
+ export declare const correctAlart: (onOk: () => void) => void;
@@ -28,7 +28,10 @@ const checkId = (id) => {
28
28
  return true;
29
29
  };
30
30
  exports.checkId = checkId;
31
- const correctAlart = () => {
32
- react_native_1.Alert.alert("保存完了", "オンラインバックアップが完了しました。");
31
+ // iOSではAlert表示中にModalを閉じると透明なModalが残りタッチを奪うため、OK押下後に閉じる
32
+ const correctAlart = (onOk) => {
33
+ react_native_1.Alert.alert("保存完了", "オンラインバックアップが完了しました。", [
34
+ { text: "OK", onPress: onOk },
35
+ ]);
33
36
  };
34
37
  exports.correctAlart = correctAlart;
@@ -78,22 +78,22 @@ const PasswordModal = ({ isVisible, onClose }) => {
78
78
  type: "setting/deleteOnlineSave",
79
79
  payload: res.deleteIds || [],
80
80
  });
81
- (0, OnlineInputFnc_1.correctAlart)();
82
81
  dispatch(stores_1.settingStorage.saveSetting());
82
+ setLoading(false);
83
+ (0, OnlineInputFnc_1.correctAlart)(() => {
84
+ onClose();
85
+ setPassword("");
86
+ });
83
87
  }
84
88
  catch (error) {
85
89
  // エラーの種類に応じた処理
86
90
  console.error("エラーが発生しました:", error);
87
- }
88
- finally {
89
- // ローディング状態の解除とモーダルのクローズ
90
91
  setLoading(false);
91
92
  onClose();
92
93
  setPassword("");
93
94
  }
94
95
  });
95
96
  return (<common_1.BaseModal isVisible={isVisible} onClose={onClose}>
96
- <common_1.Spinner loading={loading}/>
97
97
  <react_native_1.View style={styles.msgBox}>
98
98
  <common_1.MyText fsize="lg" style={{ alignSelf: "center", marginBottom: 10 }}>
99
99
  パスワードを入力してください
@@ -105,10 +105,10 @@ const PasswordModal = ({ isVisible, onClose }) => {
105
105
  <react_native_1.View style={styles.inputBox}>
106
106
  <react_native_1.TextInput style={styles.input} placeholder="pass123" value={password} onChangeText={(text) => setPassword(text)}/>
107
107
  </react_native_1.View>
108
- <react_native_1.View style={styles.btnBox}>
109
- <common_1.MiniIconBtn onPress={onClose} icon="times" title="キャンセル" color="ltBlack"/>
110
- <common_1.MiniIconBtn onPress={() => handleSave()} icon="cloud-upload-alt" title="保存する" color="green"/>
111
- </react_native_1.View>
108
+ {loading ? (<react_native_1.ActivityIndicator size="large" style={styles.indicator}/>) : (<react_native_1.View style={styles.btnBox}>
109
+ <common_1.MiniIconBtn onPress={onClose} icon="times" title="キャンセル" color="ltBlack"/>
110
+ <common_1.MiniIconBtn onPress={() => handleSave()} icon="cloud-upload-alt" title="保存する" color="green"/>
111
+ </react_native_1.View>)}
112
112
  </common_1.BaseModal>);
113
113
  };
114
114
  function getOldIds(dataList) {
@@ -137,5 +137,8 @@ const styles = react_native_1.StyleSheet.create({
137
137
  alignItems: "center",
138
138
  paddingVertical: 5,
139
139
  },
140
+ indicator: {
141
+ paddingVertical: 5,
142
+ },
140
143
  });
141
144
  exports.default = PasswordModal;
@@ -57,12 +57,15 @@ const PasswordIdModal = ({ isVisible, onClose, id, setId }) => {
57
57
  const res = yield stores_1.inputApi.inputLoadApi({ id, password, appKey }, loadUrl);
58
58
  // 成功レスポンスの処理
59
59
  db_1.InputModel.updateSaveText(realm, res.data);
60
- (0, OnlineInputFnc_1.correctAlart)();
60
+ setLoading(false);
61
+ (0, OnlineInputFnc_1.correctAlart)(() => {
62
+ onClose();
63
+ setId("");
64
+ setPassword("");
65
+ });
61
66
  }
62
67
  catch (error) {
63
68
  console.error("エラーが発生しました:", error);
64
- }
65
- finally {
66
69
  setLoading(false);
67
70
  onClose();
68
71
  setId("");
@@ -70,7 +73,6 @@ const PasswordIdModal = ({ isVisible, onClose, id, setId }) => {
70
73
  }
71
74
  });
72
75
  return (<common_1.BaseModal isVisible={isVisible} onClose={onClose}>
73
- <common_1.Spinner loading={loading}/>
74
76
  <react_native_1.View style={styles.msgBox}>
75
77
  <common_1.MyText>IDとパスワードを入力してください</common_1.MyText>
76
78
  </react_native_1.View>
@@ -78,10 +80,10 @@ const PasswordIdModal = ({ isVisible, onClose, id, setId }) => {
78
80
  <react_native_1.TextInput style={styles.input} placeholder="ID(セーブ時に発行された8文字)" value={id} onChangeText={(text) => setId(text)}/>
79
81
  <react_native_1.TextInput style={styles.input} placeholder="Password(4文字以上)" value={password} onChangeText={(text) => setPassword(text)}/>
80
82
  </react_native_1.View>
81
- <react_native_1.View style={styles.btnBox}>
82
- <common_1.MiniIconBtn onPress={onClose} icon="times" title="キャンセル" color="ltBlack"/>
83
- <common_1.MiniIconBtn onPress={() => handleSave()} icon="cloud-download-alt" title="読み込む" color="blue"/>
84
- </react_native_1.View>
83
+ {loading ? (<react_native_1.ActivityIndicator size="large" style={styles.indicator}/>) : (<react_native_1.View style={styles.btnBox}>
84
+ <common_1.MiniIconBtn onPress={onClose} icon="times" title="キャンセル" color="ltBlack"/>
85
+ <common_1.MiniIconBtn onPress={() => handleSave()} icon="cloud-download-alt" title="読み込む" color="blue"/>
86
+ </react_native_1.View>)}
85
87
  </common_1.BaseModal>);
86
88
  };
87
89
  const styles = react_native_1.StyleSheet.create({
@@ -105,5 +107,8 @@ const styles = react_native_1.StyleSheet.create({
105
107
  alignItems: "center",
106
108
  paddingVertical: 5,
107
109
  },
110
+ indicator: {
111
+ paddingVertical: 5,
112
+ },
108
113
  });
109
114
  exports.default = PasswordIdModal;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const lib_1 = require("@nakamura-123/lib");
7
+ const expo_image_1 = require("expo-image");
7
8
  const react_1 = __importDefault(require("react"));
8
9
  const react_native_1 = require("react-native");
9
10
  const react_native_image_zoom_viewer_1 = __importDefault(require("react-native-image-zoom-viewer")); // 拡大ライブラリ
@@ -12,9 +13,11 @@ const ImageZoomScreen = ({ route }) => {
12
13
  // 画像データをライブラリの形式に変換
13
14
  const images = [{ url: "", props: { source: path } }];
14
15
  return (<react_native_1.View style={styles.container}>
15
- <react_native_image_zoom_viewer_1.default imageUrls={images} backgroundColor={lib_1.colors.beige}/>
16
+ <react_native_image_zoom_viewer_1.default imageUrls={images} backgroundColor={lib_1.colors.beige} renderImage={renderImage}/>
16
17
  </react_native_1.View>);
17
18
  };
19
+ // Android標準のImage(Fresco)は長辺2048px超を縮小デコードし、拡大時に文字が潰れるため
20
+ const renderImage = ({ source, style }) => (<expo_image_1.Image source={source} style={style} contentFit="contain" allowDownscaling={false}/>);
18
21
  const styles = react_native_1.StyleSheet.create({
19
22
  container: {
20
23
  flex: 1,