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.
This commit is contained in:
parent
432cfb08fe
commit
a4e495a2a6
1 changed files with 8 additions and 3 deletions
|
|
@ -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};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue