Skip to content

Commit

Permalink
Show URL on condensed post view (thunder-app#1604)
Browse files Browse the repository at this point in the history
* feat: add url to condensed post view

* feat: remove www from host in URL
  • Loading branch information
hjiangsu authored Nov 27, 2024
1 parent f6ff5e8 commit 9580cc0
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions lib/post/widgets/post_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,22 @@ class _PostSubviewState extends State<PostSubview> with SingleTickerProviderStat
if (thunderState.postBodyViewType == PostBodyViewType.condensed && !thunderState.showThumbnailPreviewOnRight && postViewMedia.media.first.mediaType != MediaType.text)
_getMediaPreview(thunderState, hideNsfwPreviews, markPostReadOnMediaView, isUserLoggedIn),
Expanded(
child: ScalableText(
HtmlUnescape().convert(post.name),
fontScale: thunderState.titleFontSizeScale,
style: theme.textTheme.titleMedium,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ScalableText(
HtmlUnescape().convert(post.name),
fontScale: thunderState.titleFontSizeScale,
style: theme.textTheme.titleMedium,
),
if (postViewMedia.media.first.mediaType == MediaType.link && thunderState.postBodyViewType == PostBodyViewType.condensed)
Text(
Uri.tryParse(post.url ?? '')?.host.replaceFirst('www.', '') ?? '',
style: theme.textTheme.bodyMedium?.copyWith(color: theme.colorScheme.onSurface.withOpacity(0.6)),
)
],
),
),
if (thunderState.postBodyViewType == PostBodyViewType.condensed && thunderState.showThumbnailPreviewOnRight && postViewMedia.media.first.mediaType != MediaType.text)
Expand Down

0 comments on commit 9580cc0

Please sign in to comment.