fix(PostImages, CreatePostScreen): adjust image gap for improved layout consistency
Some checks failed
Frontend CI / build-and-push-web (push) Successful in 9m17s
Frontend CI / ota-android (push) Successful in 11m48s
Frontend CI / build-android-apk (push) Successful in 1h12m38s
Frontend CI / ota-android (pull_request) Has been skipped
Frontend CI / build-and-push-web (pull_request) Failing after 37s
Frontend CI / build-android-apk (pull_request) Has been cancelled

- Reduced image gap in PostImages and CreatePostScreen components from 12 to 4 (desktop) and 8 to 2 (mobile) for better spacing.
- Updated ImageGrid component to modify grid item widths for enhanced layout.
- Refactored PostRepository to improve local caching logic, ensuring non-blocking UI updates during cache writes.
- Introduced saveConversationsWithRelatedCache function to streamline conversation, user, and group data saving in the database.
This commit is contained in:
lafay
2026-03-25 17:08:11 +08:00
parent f875b417c8
commit 619f08275c
7 changed files with 91 additions and 49 deletions

View File

@@ -128,11 +128,11 @@ export const CreatePostScreen: React.FC<CreatePostScreenProps> = (props) => {
// 响应式图片网格配置
const imagesPerRow = useResponsiveValue({ xs: 3, sm: 3, md: 4, lg: 5, xl: 6 });
const imageGap = 8;
const imageGap = 4;
const availableWidth = isWideScreen
? Math.min(width, 800) - spacing.lg * 2
: width - spacing.lg * 2;
const imageSize = (availableWidth - imageGap * (imagesPerRow - 1)) / imagesPerRow;
const imageSize = Math.floor((availableWidth - imageGap * (imagesPerRow - 1)) / imagesPerRow);
const contentInputMinHeight = Math.max(
isWideScreen ? 460 : 320,
Math.floor(windowHeight * (isWideScreen ? 0.56 : 0.5))
@@ -896,7 +896,7 @@ function createCreatePostStyles(colors: AppColors) {
flexWrap: 'wrap',
paddingHorizontal: 0,
paddingTop: spacing.md,
gap: 8,
gap: 4,
},
imageGridItem: {
borderRadius: borderRadius.md,