From d9b14c607945d2f42c520ca9042406ec79121653 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 25 Jun 2022 14:45:00 -0500 Subject: [PATCH 1/3] StatusActionButton: show selected emoji --- .../components/status-action-button.tsx | 33 +++++++++++-------- app/soapbox/components/status_action_bar.tsx | 1 + 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/soapbox/components/status-action-button.tsx b/app/soapbox/components/status-action-button.tsx index 6bbd86fa8..43cfea942 100644 --- a/app/soapbox/components/status-action-button.tsx +++ b/app/soapbox/components/status-action-button.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React from 'react'; -import { Text, Icon } from 'soapbox/components/ui'; +import { Text, Icon, Emoji } from 'soapbox/components/ui'; import { shortNumberFormat } from 'soapbox/utils/numbers'; const COLORS = { @@ -15,7 +15,7 @@ interface IStatusActionCounter { count: number, } -/** Action button numerical counter, eg "5" likes */ +/** Action button numerical counter, eg "5" likes. */ const StatusActionCounter: React.FC = ({ count = 0 }): JSX.Element => { return ( @@ -31,10 +31,11 @@ interface IStatusActionButton extends React.ButtonHTMLAttributes): JSX.Element => { - const { icon, className, iconClassName, active, color, filled = false, count = 0, ...filteredProps } = props; +const StatusActionButton = React.forwardRef((props, ref): JSX.Element => { + const { icon, className, iconClassName, active, color, filled = false, count = 0, emoji, ...filteredProps } = props; return ( + ) : ( + + )} ) : ( Date: Mon, 4 Jul 2022 17:24:18 -0500 Subject: [PATCH 3/3] StatusActionButton: use a black/white counter if emoji is present --- app/soapbox/components/status-action-button.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/soapbox/components/status-action-button.tsx b/app/soapbox/components/status-action-button.tsx index 43cfea942..0e837168d 100644 --- a/app/soapbox/components/status-action-button.tsx +++ b/app/soapbox/components/status-action-button.tsx @@ -47,8 +47,9 @@ const StatusActionButton = React.forwardRef