From 09ed0bccabf528d18fddfac87af12169afe6b077 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 27 Mar 2023 17:03:19 -0500 Subject: [PATCH] AuthorizeRejectButtons: refactor ActionEmblem into a separate component --- .../components/authorize-reject-buttons.tsx | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/app/soapbox/components/authorize-reject-buttons.tsx b/app/soapbox/components/authorize-reject-buttons.tsx index d4d90732e..347201e1b 100644 --- a/app/soapbox/components/authorize-reject-buttons.tsx +++ b/app/soapbox/components/authorize-reject-buttons.tsx @@ -52,19 +52,11 @@ const AuthorizeRejectButtons: React.FC = ({ onAuthorize switch (state) { case 'authorized': return ( -
- - - -
+ } /> ); case 'rejected': return ( -
- - - -
+ } /> ); default: return ( @@ -88,6 +80,20 @@ const AuthorizeRejectButtons: React.FC = ({ onAuthorize } }; +interface IActionEmblem { + text: React.ReactNode +} + +const ActionEmblem: React.FC = ({ text }) => { + return ( +
+ + {text} + +
+ ); +}; + interface IAuthorizeRejectButton { theme: 'primary' | 'danger' icon: string