wudebin 9 місяців тому
батько
коміт
830a2c393e
1 змінених файлів з 39 додано та 21 видалено
  1. 39 21
      Strides-APP/app/pages/home/maps/PinMessage.js

+ 39 - 21
Strides-APP/app/pages/home/maps/PinMessage.js

@@ -18,26 +18,29 @@ const PinMessage = ({
   }, [messageList])
   if (visible)
     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>
+      <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>
+        </View>
+      </View>
     );
   else
     return <></>
@@ -134,9 +137,24 @@ const styles = StyleSheet.create({
     paddingBottom: 16,
     fontSize: 14
   },
+  noticeLayer: {
+    top: 0,
+    left: 0,
+    right: 0,
+    bottom: 0,
+    zIndex: 10,
+    position: "absolute",
+    alignItems: 'center',
+    justifyContent: 'center',
+    backgroundColor: 'rgba(0,0,0,.5)'
+  },
   noticeDialog: {
+    height: $vh(50)
+  },
+  noticeDialogChild: {
     width: Dialog.dialogWidth,
-    height: $vw(100) + 48
+    marginLeft: "auto",
+    marginRight: "auto"
   },
   closeIcon: {
     top: 8,