From 2ff82495acaca861c70c91fc52b3b540765fa27d Mon Sep 17 00:00:00 2001 From: Junhui Chen Date: Sat, 9 Aug 2025 10:43:18 +0800 Subject: [PATCH] fix: Image --- components/ask/hello.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/ask/hello.tsx b/components/ask/hello.tsx index a291afd..9521295 100644 --- a/components/ask/hello.tsx +++ b/components/ask/hello.tsx @@ -3,7 +3,7 @@ import { webSocketManager } from "@/lib/websocket-util"; import { Message } from "@/types/ask"; import { Dispatch, SetStateAction, useCallback, useRef } from "react"; import { useTranslation } from "react-i18next"; -import { Dimensions, Image, StyleSheet, TouchableOpacity, View } from 'react-native'; +import { StyleSheet, TouchableOpacity, useWindowDimensions, View } from 'react-native'; import { createNewConversation } from "./utils"; interface AskHelloProps { @@ -13,8 +13,7 @@ interface AskHelloProps { } export default function AskHello({ setUserMessages, setConversationId, setIsHello }: AskHelloProps) { const { t } = useTranslation(); - const width = Dimensions.get('window').width; - const height = Dimensions.get('window').height; + const { width, height } = useWindowDimensions(); // const inFlightRef = useRef(false); @@ -90,9 +89,9 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell {"\n"} {t('ask.iAmMemo', { ns: 'ask' })} - + {/* - + */} {t('ask.ready', { ns: 'ask' })} {"\n"}