From a4e495a2a6de2b3a35e726e2da2cd156cda8b665 Mon Sep 17 00:00:00 2001 From: ladudu Date: Wed, 17 Sep 2025 18:44:55 +0900 Subject: [PATCH] fix Slack attachment button color looks wrong color for dark themes (#8959) - Moved STATUS_COLORS declaration outside of the conditional block for better readability. - Updated hexColor assignment logic to ensure a default color is applied when buttonColor is not provided. - Adjusted customButtonStyle and customButtonTextStyle to use the updated hexColor logic. --- .../message_attachments/action_button/index.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/components/post_list/post/body/content/message_attachments/action_button/index.tsx b/app/components/post_list/post/body/content/message_attachments/action_button/index.tsx index 21b3356f8..2246eaca0 100644 --- a/app/components/post_list/post/body/content/message_attachments/action_button/index.tsx +++ b/app/components/post_list/post/body/content/message_attachments/action_button/index.tsx @@ -64,10 +64,15 @@ const ActionButton = ({buttonColor, cookie, disabled, id, name, postId, theme}: } }, [serverUrl, postId, id, cookie])); + const STATUS_COLORS = getStatusColors(theme); + let hexColor: string | undefined; if (buttonColor) { - const STATUS_COLORS = getStatusColors(theme); - const hexColor = secureGetFromRecord(STATUS_COLORS, buttonColor) || secureGetFromRecord(theme, buttonColor) || buttonColor; - customButtonStyle = {borderColor: changeOpacity(hexColor, 0.25), backgroundColor: '#ffffff'}; + hexColor = secureGetFromRecord(STATUS_COLORS, buttonColor) || secureGetFromRecord(theme, buttonColor) || buttonColor; + } else { + hexColor = secureGetFromRecord(STATUS_COLORS, 'default'); + } + if (hexColor) { + customButtonStyle = {borderColor: changeOpacity(hexColor, 0.16), backgroundColor: changeOpacity(hexColor, 0.08), borderWidth: 0}; customButtonTextStyle = {color: hexColor}; }