Page MenuHomePhabricator

D5344.diff
No OneTemporary

D5344.diff

diff --git a/web/modals/threads/settings/thread-settings-relationship-button.react.js b/web/modals/threads/settings/thread-settings-relationship-button.react.js
--- a/web/modals/threads/settings/thread-settings-relationship-button.react.js
+++ b/web/modals/threads/settings/thread-settings-relationship-button.react.js
@@ -51,22 +51,26 @@
const { username } = otherUserInfo;
invariant(username, 'Other username should be specified');
- let color;
+ let backgroundColor;
if (relationshipButton === relationshipButtons.FRIEND) {
- color = 'success';
+ backgroundColor = '--relationship-button-green';
} else if (relationshipButton === relationshipButtons.UNFRIEND) {
- color = 'danger';
+ backgroundColor = '--relationship-button-red';
} else if (relationshipButton === relationshipButtons.BLOCK) {
- color = 'danger';
+ backgroundColor = '--relationship-button-red';
} else if (relationshipButton === relationshipButtons.UNBLOCK) {
- color = 'success';
+ backgroundColor = '--relationship-button-green';
} else if (relationshipButton === relationshipButtons.ACCEPT) {
- color = 'success';
+ backgroundColor = '--relationship-button-green';
} else if (relationshipButton === relationshipButtons.REJECT) {
- color = 'danger';
+ backgroundColor = '--relationship-button-red';
} else if (relationshipButton === relationshipButtons.WITHDRAW) {
- color = 'danger';
+ backgroundColor = '--relationship-button-red';
}
+ invariant(
+ backgroundColor,
+ 'every relationship type should have a color assigned',
+ );
const { text, action } = React.useMemo(() => {
return {
@@ -129,7 +133,10 @@
return (
<Button
variant="filled"
- buttonColor={color}
+ buttonColor={{
+ backgroundColor: `var(${backgroundColor})`,
+ color: 'var(--relationship-button-text)',
+ }}
onClick={onClick}
disabled={disabled}
>

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 26, 7:49 AM (11 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2704360
Default Alt Text
D5344.diff (1 KB)

Event Timeline