feat: youhua
This commit is contained in:
parent
b349e6d901
commit
a0821fc996
@ -5,7 +5,7 @@ import MoreSvg from "@/assets/icons/svg/more.svg";
|
||||
import { Message, Video } from "@/types/ask";
|
||||
import { MaterialItem } from "@/types/personal-info";
|
||||
import { TFunction } from "i18next";
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
Image,
|
||||
Pressable,
|
||||
@ -32,11 +32,12 @@ interface RenderMessageProps {
|
||||
setSelectedImages: React.Dispatch<React.SetStateAction<string[]>>;
|
||||
selectedImages: string[];
|
||||
t: TFunction;
|
||||
setCancel: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
cancel: boolean;
|
||||
}
|
||||
|
||||
const MessageItem = ({ t, insets, item, sessionId, setModalVisible, modalVisible, setModalDetailsVisible, modalDetailsVisible, setSelectedImages, selectedImages }: RenderMessageProps) => {
|
||||
const MessageItem = ({ setCancel, cancel = true, t, insets, item, sessionId, setModalVisible, modalVisible, setModalDetailsVisible, modalDetailsVisible, setSelectedImages, selectedImages }: RenderMessageProps) => {
|
||||
const isUser = item.role === 'User';
|
||||
const [cancel, setCancel] = useState(false);
|
||||
|
||||
return (
|
||||
<View className={`flex-row items-start gap-2 w-full ${isUser ? 'justify-end' : 'justify-start'}`}>
|
||||
@ -160,6 +161,8 @@ const MessageItem = ({ t, insets, item, sessionId, setModalVisible, modalVisible
|
||||
setSelectedImages={setSelectedImages}
|
||||
selectedImages={selectedImages}
|
||||
t={t}
|
||||
setCancel={setCancel}
|
||||
cancel={cancel}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
@ -27,7 +27,8 @@ function ChatComponent(
|
||||
const [modalVisible, setModalVisible] = React.useState({ visible: false, data: {} as Video | MaterialItem });
|
||||
const { t } = useTranslation();
|
||||
const keyExtractor = useCallback((item: Message) => `${item.role}-${item.timestamp}`, []);
|
||||
|
||||
// 取消展示右键菜单
|
||||
const [cancel, setCancel] = useState(true);
|
||||
const contentContainerStyle = useMemo(() => ({
|
||||
padding: 16,
|
||||
flexGrow: 1,
|
||||
@ -46,7 +47,7 @@ function ChatComponent(
|
||||
const itemStyle = index === 0 ? { marginTop: 16, marginHorizontal: 16 } : { marginHorizontal: 16 };
|
||||
return (
|
||||
<View style={itemStyle}>
|
||||
{MessageItem({ t, setSelectedImages, selectedImages, insets, item, sessionId, modalVisible, setModalVisible, setModalDetailsVisible, modalDetailsVisible })}
|
||||
{MessageItem({ setCancel, cancel, t, setSelectedImages, selectedImages, insets, item, sessionId, modalVisible, setModalVisible, setModalDetailsVisible, modalDetailsVisible })}
|
||||
</View>
|
||||
);
|
||||
}}
|
||||
|
||||
@ -4,7 +4,7 @@ import FolderSvg from "@/assets/icons/svg/folder.svg";
|
||||
import ReturnArrow from "@/assets/icons/svg/returnArrow.svg";
|
||||
import YesSvg from "@/assets/icons/svg/yes.svg";
|
||||
import { TFunction } from "i18next";
|
||||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import { FlatList, Image, Modal, StyleSheet, TouchableOpacity, View } from "react-native";
|
||||
import ContextMenu from "../gusture/contextMenu";
|
||||
import { ThemedText } from "../ThemedText";
|
||||
@ -17,9 +17,10 @@ interface SelectModelProps {
|
||||
setSelectedImages: React.Dispatch<React.SetStateAction<string[]>>;
|
||||
selectedImages: string[];
|
||||
t: TFunction;
|
||||
cancel: boolean;
|
||||
setCancel: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
}
|
||||
const SelectModel = ({ modalDetailsVisible, setModalDetailsVisible, insets, setSelectedImages, selectedImages, t }: SelectModelProps) => {
|
||||
const [cancel, setCancel] = useState(false)
|
||||
const SelectModel = ({ modalDetailsVisible, setModalDetailsVisible, insets, setSelectedImages, selectedImages, t, cancel, setCancel }: SelectModelProps) => {
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
||||
@ -42,7 +42,7 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
|
||||
menuItemStyle,
|
||||
menuTextStyle,
|
||||
dividerStyle,
|
||||
calcel,
|
||||
cancel,
|
||||
onOpen,
|
||||
onClose,
|
||||
longPressDuration = 500,
|
||||
@ -78,8 +78,8 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
setMenuVisible(!calcel);
|
||||
}, [calcel])
|
||||
setMenuVisible(!cancel);
|
||||
}, [cancel])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@ -23,6 +23,13 @@
|
||||
"imgSave": "image saved to album",
|
||||
"videoSave": "video saved to album",
|
||||
"saveError": "save failed",
|
||||
"saveErrorDesc": "save media files error, please try again"
|
||||
"saveErrorDesc": "save media files error, please try again",
|
||||
"save": "save",
|
||||
"cancel": "cancel",
|
||||
"introduction1": "Ready to open the memory time capsule? Describe your memory, and I'll help you find photos, create videos, or unlock hidden Easter eggs ✨",
|
||||
"introduction2": "Looking for the perfect image? Try these search tips for better results:\n\n• Be specific: Try 'autumn forest', 'minimalist desk', or 'vintage poster design'\n\n• Add details: For specific styles, try 'watercolor cat' or 'cyberpunk city nightscape'; for specific uses, try 'royalty-free landscape' or 'commercial use icons'\n\n• Describe the scene: Try 'sunlight through leaves' or 'rainy day coffee shop window'\n\nEnter these keywords, and you might just find the perfect shot!",
|
||||
"introduction3": "Want to make your videos more engaging and story-driven? Start with an image search!\n\nFirst, decide on your video's theme—whether it's healing natural landscapes, retro cityscapes, or vibrant life moments. Then search for related images. For example, if your theme is 'Spring Limited,' search for 'cherry blossoms falling,' 'picnic in the grass,' or 'first buds of spring.'\n\nThese images can help you visualize your video's flow and even spark new ideas—like how an old photo of a vintage object might inspire a story about time, or how a series of starry sky images could connect into a narrative about dreams and distant places. String these images together with the right music and captions, and you've got yourself a heartwarming video. Give it a try!",
|
||||
"search": "Search Assets",
|
||||
"video": "Create Video"
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user