Przeglądaj źródła

update app/pages/home/maps/PinMessage.js

wudebin 9 miesięcy temu
rodzic
commit
ce9f1649b3
1 zmienionych plików z 56 dodań i 27 usunięć
  1. 56 27
      Strides-APP/app/pages/home/maps/PinMessage.js

+ 56 - 27
Strides-APP/app/pages/home/maps/PinMessage.js

@@ -16,34 +16,59 @@ const PinMessage = ({
       showDialog(true)
     }
   }, [messageList])
-  if (visible)
-    return (
-      <View
-        style={styles.noticeLayer}>
-        <View style={styles.noticeDialog}>
-          <Swiper
-            //style={{height: $vh(50)}}
-            loop={true}
-            autoplay={false}
-            //dotColor={"#ccc"}
-            activeDotColor={colorAccent}
-            removeClippedSubviews={false}
-            decelerationRate={"fast"}
-            automaticallyAdjustContentInsets={true}>
-            { messageList.map((item, index) =>
-              <View key={index} style={styles.noticeDialogChild}>
-                <NoticeView
-                  key={index}
-                  item={item}
-                  onClose={() => showDialog(false)}/>
-              </View>
-            )}
-          </Swiper>
+  if (isIOS) {
+    if (visible)
+      return (
+        <View
+          style={styles.noticeLayer}>
+          <View style={styles.noticeDialog2}>
+            <Swiper
+              //style={{height: $vh(50)}}
+              loop={true}
+              autoplay={false}
+              //dotColor={"#ccc"}
+              activeDotColor={colorAccent}
+              removeClippedSubviews={false}
+              decelerationRate={"fast"}
+              automaticallyAdjustContentInsets={true}>
+              { messageList.map((item, index) =>
+                <View key={index} style={styles.noticeDialogChild}>
+                  <NoticeView
+                    key={index}
+                    item={item}
+                    onClose={() => showDialog(false)}/>
+                </View>
+              )}
+            </Swiper>
+          </View>
         </View>
-      </View>
+      );
+    else
+      return <></>
+  } else {
+    return (
+      <MyModal
+        style={styles.noticeDialog}
+        visible={visible}>
+        <Swiper
+          style={{height: $vh(50)}}
+          loop={false}
+          autoplay={false}
+          //dotColor={"#ccc"}
+          activeDotColor={colorAccent}
+          removeClippedSubviews={false}
+          decelerationRate={"fast"}
+          automaticallyAdjustContentInsets={true}>
+          { messageList.map((item, index) =>
+            <NoticeView
+              key={index}
+              item={item}
+              onClose={() => showDialog(false)}/>
+          )}
+        </Swiper>
+      </MyModal>
     );
-  else
-    return <></>
+  }
 }
 
 const Message = ({item}) => {
@@ -142,13 +167,17 @@ const styles = StyleSheet.create({
     left: 0,
     right: 0,
     bottom: 0,
-    zIndex: 10,
+    zIndex: 20,
     position: "absolute",
     alignItems: 'center',
     justifyContent: 'center',
     backgroundColor: 'rgba(0,0,0,.5)'
   },
   noticeDialog: {
+    width: Dialog.dialogWidth,
+    height: $vw(100) + 48
+  },
+  noticeDialog2: {
     height: $vh(50)
   },
   noticeDialogChild: {