feat: 对话样式
This commit is contained in:
parent
125da0e660
commit
153838aec0
@ -40,6 +40,7 @@ const renderMessage = ({ insets, item, sessionId, setModalVisible, modalVisible,
|
|||||||
const isVideo = (data: Video | MaterialItem): data is Video => {
|
const isVideo = (data: Video | MaterialItem): data is Video => {
|
||||||
return 'video' in data;
|
return 'video' in data;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 创建一个新的 VideoPlayer 组件
|
// 创建一个新的 VideoPlayer 组件
|
||||||
const VideoPlayer = ({
|
const VideoPlayer = ({
|
||||||
videoUrl,
|
videoUrl,
|
||||||
@ -100,18 +101,18 @@ const renderMessage = ({ insets, item, sessionId, setModalVisible, modalVisible,
|
|||||||
|
|
||||||
{(mergeArrays(item.content.image_material_infos || [], item.content.video_material_infos || [])?.length || 0 > 0) && (
|
{(mergeArrays(item.content.image_material_infos || [], item.content.video_material_infos || [])?.length || 0 > 0) && (
|
||||||
<View className="relative">
|
<View className="relative">
|
||||||
<View style={styles.imageGridContainer}>
|
<View style={[styles.imageGridContainer, { flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between' }]}>
|
||||||
{mergeArrays(item.content.image_material_infos || [], item.content.video_material_infos || [])?.slice(0, 3)?.map((image, index, array) => (
|
{mergeArrays(item.content.image_material_infos || [], item.content.video_material_infos || [])?.slice(0, 3)?.map((image) => (
|
||||||
<Pressable
|
<Pressable
|
||||||
key={`${image.role}-${image.timestamp}`}
|
key={image?.id || image?.video?.id}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
setModalVisible({ visible: true, data: image });
|
setModalVisible({ visible: true, data: image });
|
||||||
}}
|
}}
|
||||||
style={({ pressed }) => ({
|
style={{
|
||||||
width: '32%',
|
width: '32%',
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
opacity: pressed ? 0.8 : 1
|
marginBottom: 8,
|
||||||
})}
|
}}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
source={{ uri: image?.preview_file_info?.url || image.video?.preview_file_info?.url }}
|
source={{ uri: image?.preview_file_info?.url || image.video?.preview_file_info?.url }}
|
||||||
@ -307,8 +308,7 @@ export default renderMessage;
|
|||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
imageGridContainer: {
|
imageGridContainer: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'nowrap',
|
||||||
justifyContent: 'space-between',
|
|
||||||
width: '100%',
|
width: '100%',
|
||||||
marginTop: 8,
|
marginTop: 8,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user