diff --git a/components/CreatePostModal/index.jsx b/components/CreatePostModal/index.jsx index 2f73002..7d66234 100644 --- a/components/CreatePostModal/index.jsx +++ b/components/CreatePostModal/index.jsx @@ -8,7 +8,7 @@ import { import React, { useState, useEffect } from "react"; import { useTailwind } from "tailwind-rn"; import { useSafeAreaInsets } from "react-native-safe-area-context"; -import { useNavigation } from "@react-navigation/native"; +import { useNavigation, useRoute } from "@react-navigation/native"; import Toast from "react-native-toast-message"; import baseRequest from "../../utils/baseRequest"; import { generateSignature } from "../../utils/crypto"; @@ -17,6 +17,7 @@ export default function CreatePostModal({ visible, setVisible }) { const tailwind = useTailwind(); const insets = useSafeAreaInsets(); const navigation = useNavigation(); + const route = useRoute(); //查看主播是否已经创建空间 const [isSpaceExist, setIsSpaceExist] = useState(true); @@ -78,7 +79,7 @@ export default function CreatePostModal({ visible, setVisible }) { > - { - navigation.navigate("CreatePost"); - setVisible(false); - }} - style={tailwind("flex flex-col items-center")} - > - - - 广场动态 - - + {route.name !== "StreamerSpace" && ( + { + navigation.navigate("CreatePost"); + setVisible(false); + }} + style={tailwind("flex flex-col items-center")} + > + + + 广场动态 + + + )} setVisible(false)}