Skip to content

Commit

Permalink
Merge pull request thunder-app#445 from CTalvio/four_fixes
Browse files Browse the repository at this point in the history
Four little things
  • Loading branch information
hjiangsu authored Jul 22, 2023
2 parents bf1d424 + 35b8824 commit 1a7941c
Show file tree
Hide file tree
Showing 9 changed files with 365 additions and 309 deletions.
15 changes: 8 additions & 7 deletions lib/community/widgets/community_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import 'package:thunder/utils/numbers.dart';

class CommunityHeader extends StatelessWidget {
final FullCommunityView? communityInfo;
final bool? isSidebarOpen;

const CommunityHeader({
super.key,
this.communityInfo,
this.isSidebarOpen,
});

@override
Expand Down Expand Up @@ -91,11 +89,14 @@ class CommunityHeader extends StatelessWidget {
],
),
),
Icon(
isSidebarOpen != null && isSidebarOpen! ? Icons.chevron_right_rounded : Icons.chevron_left_rounded,
size: 50,
shadows: const <Shadow>[Shadow(color: Colors.black, blurRadius: 5.0)],
)
Padding(
padding: const EdgeInsets.all(9.0),
child: Icon(
Icons.info_outline_rounded,
size: 25,
shadows: <Shadow>[Shadow(color: theme.colorScheme.background, blurRadius: 10.0), Shadow(color: theme.colorScheme.background, blurRadius: 20.0)],
),
),
],
),
],
Expand Down
10 changes: 6 additions & 4 deletions lib/community/widgets/community_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ class _CommunitySidebarState extends State<CommunitySidebar> with TickerProvider
child: isBlocked == false
? Padding(
padding: const EdgeInsets.only(
top: 8.0,
top: 10,
left: 12,
right: 12,
bottom: 4,
),
child: Row(
children: [
Expand Down Expand Up @@ -133,7 +134,7 @@ class _CommunitySidebarState extends State<CommunitySidebar> with TickerProvider
),
),
const SizedBox(
width: 8,
width: 10,
height: 8,
),
Expanded(
Expand Down Expand Up @@ -194,10 +195,11 @@ class _CommunitySidebarState extends State<CommunitySidebar> with TickerProvider
},
child: widget.subscribedType != SubscribedType.subscribed
? Padding(
padding: const EdgeInsets.only(
top: 8.0,
padding: EdgeInsets.only(
top: isBlocked ? 10 : 8,
left: 12,
right: 12,
bottom: 4,
),
child: ElevatedButton(
onPressed: isUserLoggedIn
Expand Down
1 change: 0 additions & 1 deletion lib/community/widgets/post_card_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ class _PostCardListState extends State<PostCardList> with TickerProviderStateMix
},
child: CommunityHeader(
communityInfo: widget.communityInfo,
isSidebarOpen: _displaySidebar,
),
)
: null,
Expand Down
75 changes: 39 additions & 36 deletions lib/community/widgets/post_card_view_compact.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,42 +60,45 @@ class PostCardViewCompact extends StatelessWidget {
),
if (!showThumbnailPreviewOnRight && (postViewMedia.media.isNotEmpty || showTextPostIndicator)) const SizedBox(width: 8.0),
Flexible(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(postViewMedia.postView.post.name,
textScaleFactor: state.titleFontSizeScale.textScaleFactor,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.4) : null,
)),
const SizedBox(height: 4.0),
PostCommunityAndAuthor(
showCommunityIcons: false,
showInstanceName: showInstanceName,
postView: postViewMedia.postView,
textStyleCommunity: textStyleCommunityAndAuthor,
textStyleAuthor: textStyleCommunityAndAuthor,
),
const SizedBox(height: 8.0),
],
),
PostCardMetaData(
score: postViewMedia.postView.counts.score,
voteType: postViewMedia.postView.myVote ?? VoteType.none,
comments: postViewMedia.postView.counts.comments,
unreadComments: postViewMedia.postView.unreadComments,
hasBeenEdited: postViewMedia.postView.post.updated != null ? true : false,
published: postViewMedia.postView.post.updated != null ? postViewMedia.postView.post.updated! : postViewMedia.postView.post.published,
saved: postViewMedia.postView.saved,
distinguised: postViewMedia.postView.post.featuredCommunity,
)
],
child: Padding(
padding: const EdgeInsets.only(right: 6.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(postViewMedia.postView.post.name,
textScaleFactor: state.titleFontSizeScale.textScaleFactor,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w600,
color: postViewMedia.postView.read ? theme.textTheme.bodyMedium?.color?.withOpacity(0.4) : null,
)),
const SizedBox(height: 4.0),
PostCommunityAndAuthor(
showCommunityIcons: false,
showInstanceName: showInstanceName,
postView: postViewMedia.postView,
textStyleCommunity: textStyleCommunityAndAuthor,
textStyleAuthor: textStyleCommunityAndAuthor,
),
const SizedBox(height: 8.0),
],
),
PostCardMetaData(
score: postViewMedia.postView.counts.score,
voteType: postViewMedia.postView.myVote ?? VoteType.none,
comments: postViewMedia.postView.counts.comments,
unreadComments: postViewMedia.postView.unreadComments,
hasBeenEdited: postViewMedia.postView.post.updated != null ? true : false,
published: postViewMedia.postView.post.updated != null ? postViewMedia.postView.post.updated! : postViewMedia.postView.post.published,
saved: postViewMedia.postView.saved,
distinguised: postViewMedia.postView.post.featuredCommunity,
)
],
),
),
),
if (showThumbnailPreviewOnRight && (postViewMedia.media.isNotEmpty || showTextPostIndicator))
Expand Down
Loading

0 comments on commit 1a7941c

Please sign in to comment.