diff --git a/app/(tabs)/memo-list.tsx b/app/(tabs)/memo-list.tsx index 0fa7f11..d2e26db 100644 --- a/app/(tabs)/memo-list.tsx +++ b/app/(tabs)/memo-list.tsx @@ -149,13 +149,7 @@ const MemoList = () => { onPress={() => handleMemoPress(item)} activeOpacity={0.7} > - - - + - + - + - - - - - + + + + + - - + + - - - - + + + + - + @@ -28,9 +28,9 @@ - + - + @@ -38,7 +38,7 @@ - + diff --git a/assets/icons/svg/navBg.svg b/assets/icons/svg/navBg.svg new file mode 100644 index 0000000..98e360b --- /dev/null +++ b/assets/icons/svg/navBg.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/assets/images/png/owner/ask.png b/assets/images/png/owner/ask.png index 8c5f798..0fe206a 100644 Binary files a/assets/images/png/owner/ask.png and b/assets/images/png/owner/ask.png differ diff --git a/assets/images/png/owner/askIP.png b/assets/images/png/owner/askIP.png new file mode 100644 index 0000000..4450a2d Binary files /dev/null and b/assets/images/png/owner/askIP.png differ diff --git a/components/ask/send.tsx b/components/ask/send.tsx index 3125502..d46e355 100644 --- a/components/ask/send.tsx +++ b/components/ask/send.tsx @@ -304,6 +304,7 @@ const styles = StyleSheet.create({ borderRadius: 25, paddingHorizontal: 20, paddingVertical: 13, + lineHeight: 20, fontSize: 16, width: '100%', // 确保输入框宽度撑满 paddingRight: 50 diff --git a/components/chat/message-item/MediaGrid.tsx b/components/chat/message-item/MediaGrid.tsx index d9d28f9..40db826 100644 --- a/components/chat/message-item/MediaGrid.tsx +++ b/components/chat/message-item/MediaGrid.tsx @@ -1,11 +1,11 @@ -import React from 'react'; -import { View, Pressable, Image, StyleSheet } from 'react-native'; -import ContextMenu from "../../gusture/contextMenu"; -import DownloadSvg from "@/assets/icons/svg/download.svg"; import CancelSvg from "@/assets/icons/svg/cancel.svg"; +import DownloadSvg from "@/assets/icons/svg/download.svg"; import { ContentPart } from "@/types/ask"; import { TFunction } from 'i18next'; +import React from 'react'; +import { Image, Pressable, StyleSheet, Text as ThemedText, View } from 'react-native'; import { saveMediaToGallery } from "../../ask/utils"; +import ContextMenu from "../../gusture/contextMenu"; interface MediaGridProps { mediaItems: ContentPart[]; @@ -16,18 +16,32 @@ interface MediaGridProps { } const MediaGrid = ({ mediaItems, setModalVisible, setCancel, cancel, t }: MediaGridProps) => { - // 只取前6个元素(2行,每行3个) + // Only show up to 6 images (2 rows of 3) const displayItems = mediaItems.slice(0, 6); + const itemCount = displayItems.length; + + // Calculate item width based on number of items + const getItemWidth = () => { + if (itemCount === 1) return '100%'; + if (itemCount === 2) return '49%'; + return '32%'; // For 3+ items + }; + + // Calculate container style based on number of items + const getContainerStyle = () => { + if (itemCount === 1) return styles.singleItemContainer; + return styles.multiItemContainer; + }; return ( - - {displayItems.map((media) => ( + + {displayItems.map((media, index) => ( { setModalVisible({ visible: true, data: media }); }} - className="mb-2 w-[32%] aspect-square" + style={[styles.imageContainer, { width: getItemWidth() }]} > + {itemCount > 3 && index === 5 && mediaItems.length > 6 && ( + + +{mediaItems.length - 5} + + )} ))} @@ -76,6 +85,50 @@ const MediaGrid = ({ mediaItems, setModalVisible, setCancel, cancel, t }: MediaG ); }; - +const styles = StyleSheet.create({ + container: { + flexDirection: 'row', + flexWrap: 'wrap', + justifyContent: 'space-between', + }, + singleItemContainer: { + width: '100%', + }, + multiItemContainer: { + width: '100%', + }, + imageContainer: { + marginBottom: 8, + aspectRatio: 1, + }, + image: { + width: '100%', + height: '100%', + borderRadius: 8, + }, + contextMenu: { + backgroundColor: 'white', + borderRadius: 8, + padding: 8, + minWidth: 150, + shadowColor: '#000', + shadowOffset: { width: 0, height: 2 }, + shadowOpacity: 0.25, + shadowRadius: 4, + elevation: 5, + }, + overlay: { + ...StyleSheet.absoluteFillObject, + backgroundColor: 'rgba(0,0,0,0.5)', + borderRadius: 8, + justifyContent: 'center', + alignItems: 'center', + }, + overlayText: { + color: 'white', + fontSize: 24, + fontWeight: 'bold', + }, +}); export default MediaGrid; diff --git a/components/layout/ask.tsx b/components/layout/ask.tsx index 73a657d..ea0a890 100644 --- a/components/layout/ask.tsx +++ b/components/layout/ask.tsx @@ -98,13 +98,7 @@ const AskNavbar = ({ wsStatus }: AskNavbarProps) => { position: 'absolute', bottom: 0, left: 0, - right: 0, - backgroundColor: 'white', - shadowColor: '#000', - shadowOffset: { width: 0, height: -4 }, - shadowOpacity: 0.1, - shadowRadius: 8, - elevation: 10, + right: 0 }, backgroundImage: { width, @@ -132,7 +126,7 @@ const AskNavbar = ({ wsStatus }: AskNavbarProps) => { centerButton: { position: 'absolute', left: width / 2, - top: -42.5, // Adjust this value to move the button up or down + top: -30, // Adjust this value to move the button up or down marginLeft: -42.5, // Half of the button width (85/2) width: 85, height: 85, @@ -168,7 +162,7 @@ const AskNavbar = ({ wsStatus }: AskNavbarProps) => { return ( - + navigateTo('/memo-list')} @@ -186,7 +180,7 @@ const AskNavbar = ({ wsStatus }: AskNavbarProps) => { style={styles.centerButton} > - +