From b8d00ef850510248084e7d46f4a3995dd0c53f54 Mon Sep 17 00:00:00 2001 From: jinyaqiu Date: Wed, 16 Jul 2025 16:30:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20navbar=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/icons/svg/chatIn.svg | 4 ++++ assets/icons/svg/personIn.svg | 1 + components/layout/ask.tsx | 11 ++++++++--- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 assets/icons/svg/chatIn.svg create mode 100644 assets/icons/svg/personIn.svg diff --git a/assets/icons/svg/chatIn.svg b/assets/icons/svg/chatIn.svg new file mode 100644 index 0000000..e61d9eb --- /dev/null +++ b/assets/icons/svg/chatIn.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/svg/personIn.svg b/assets/icons/svg/personIn.svg new file mode 100644 index 0000000..5b0516a --- /dev/null +++ b/assets/icons/svg/personIn.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/components/layout/ask.tsx b/components/layout/ask.tsx index 6016e77..601a3b3 100644 --- a/components/layout/ask.tsx +++ b/components/layout/ask.tsx @@ -1,6 +1,8 @@ +import ChatInSvg from "@/assets/icons/svg/chatIn.svg"; import NavbarSvg from "@/assets/icons/svg/navbar.svg"; +import PersonInSvg from "@/assets/icons/svg/personIn.svg"; import { Ionicons } from "@expo/vector-icons"; -import { router } from "expo-router"; +import { router, usePathname } from "expo-router"; import React from 'react'; import { Dimensions, Platform, TouchableOpacity, View } from 'react-native'; import { Circle, Ellipse, G, Mask, Path, Rect, Svg } from 'react-native-svg'; @@ -8,6 +10,9 @@ import { Circle, Ellipse, G, Mask, Path, Rect, Svg } from 'react-native-svg'; const AskNavbar = () => { // 获取设备尺寸 const { width } = Dimensions.get('window'); + // 获取路由 + const pathname = usePathname(); + console.log(pathname); return ( { router.push('/memo-list')} > - + {pathname === "/memo-list" ? : } { router.push('/owner')}> - + {pathname === "/owner" ? : } {/* */}