Skip to content

Commit

Permalink
Fix post quick action inkwell colours not using the proper colours (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
micahmo authored Dec 12, 2024
1 parent 6fa4146 commit 1865089
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/post/widgets/general_post_action_bottom_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ class _GeneralPostActionBottomSheetPageState extends State<GeneralPostActionBott
}
}

Color? getBackgroundColor(GeneralQuickPostAction action) {
final state = context.read<ThunderBloc>().state;

switch (action) {
case GeneralQuickPostAction.upvote:
return state.upvoteColor.color;
case GeneralQuickPostAction.downvote:
return state.downvoteColor.color;
case GeneralQuickPostAction.save:
return state.saveColor.color;
case GeneralQuickPostAction.read:
return state.markReadColor.color;
case GeneralQuickPostAction.hide:
return state.hideColor.color;
}
}

Color? getForegroundColor(GeneralQuickPostAction action) {
final state = context.read<ThunderBloc>().state;
final postViewMedia = widget.postViewMedia;
Expand Down Expand Up @@ -224,6 +241,7 @@ class _GeneralPostActionBottomSheetPageState extends State<GeneralPostActionBott
icon: getIcon(generalQuickPostAction),
label: getLabel(generalQuickPostAction),
foregroundColor: getForegroundColor(generalQuickPostAction),
backgroundColor: getBackgroundColor(generalQuickPostAction),
onSelected: isLoggedIn ? () => performAction(generalQuickPostAction) : null,
))
.toList(),
Expand Down

0 comments on commit 1865089

Please sign in to comment.