Edited the post item styles

This commit is contained in:
2025-07-30 22:16:36 +08:00
parent e4bb031138
commit 7c92dee097
11 changed files with 271 additions and 581 deletions

View File

@@ -399,19 +399,9 @@ class _ActivityListView extends HookConsumerWidget {
switch (item.type) {
case 'posts.new':
case 'posts.new.replies':
final isReply = item.type == 'posts.new.replies';
itemWidget = PostItem(
backgroundColor:
isWideScreen(context) ? Colors.transparent : null,
itemWidget = PostActionableItem(
borderRadius: 8,
item: SnPost.fromJson(item.data!),
padding:
isReply
? const EdgeInsets.only(
left: 16,
right: 16,
bottom: 16,
)
: null,
onRefresh: () {
activitiesNotifier.forceRefresh();
},
@@ -422,21 +412,10 @@ class _ActivityListView extends HookConsumerWidget {
);
},
);
if (isReply) {
itemWidget = Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: [
const Icon(Symbols.reply),
const Gap(8),
Text('Replying your post'),
],
).padding(horizontal: 20, vertical: 8),
itemWidget,
],
);
}
itemWidget = Card(
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
child: itemWidget,
);
break;
case 'discovery':
itemWidget = _DiscoveryActivityItem(data: item.data!);
@@ -445,7 +424,7 @@ class _ActivityListView extends HookConsumerWidget {
itemWidget = const Placeholder();
}
return Column(children: [itemWidget, const Divider(height: 1)]);
return itemWidget;
},
),
SliverGap(getTabbedPadding(context).bottom),

View File

@@ -470,7 +470,9 @@ class PostComposeScreen extends HookConsumerWidget {
color: colorScheme.primary,
),
IconButton(
onPressed: () => ComposeLogic.addAttachmentById(ref, state, context),
onPressed:
() =>
ComposeLogic.addAttachmentById(ref, state, context),
icon: const Icon(Symbols.attach_file),
color: colorScheme.primary,
),
@@ -655,7 +657,7 @@ class PostComposeScreen extends HookConsumerWidget {
child: SingleChildScrollView(
controller: scrollController,
padding: const EdgeInsets.all(16),
child: PostItem(item: post, isOpenable: false),
child: PostItem(item: post),
),
),
],

View File

@@ -71,7 +71,6 @@ class PostDetailScreen extends HookConsumerWidget {
children: [
PostItem(
item: post!,
isOpenable: false,
isFullPost: true,
backgroundColor: isWide ? Colors.transparent : null,
onUpdate: (newItem) {