Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3521274
D9446.id31881.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9446.id31881.diff
View Options
diff --git a/web/chat/relationship-prompt/relationship-prompt-button.js b/web/chat/relationship-prompt/relationship-prompt-button.js
--- a/web/chat/relationship-prompt/relationship-prompt-button.js
+++ b/web/chat/relationship-prompt/relationship-prompt-button.js
@@ -2,6 +2,7 @@
import { type IconDefinition } from '@fortawesome/fontawesome-common-types';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import classnames from 'classnames';
import * as React from 'react';
import css from './relationship-prompt.css';
@@ -12,21 +13,29 @@
+icon: IconDefinition,
+buttonColor: ButtonColor,
+onClick: () => void,
+ +className?: string,
};
function RelationshipPromptButton(props: Props): React.Node {
- const { text, icon, buttonColor, onClick } = props;
+ const { text, icon, buttonColor, onClick, className } = props;
- return (
- <Button
- variant="filled"
- buttonColor={buttonColor}
- onClick={onClick}
- className={css.promptButton}
- >
- <FontAwesomeIcon icon={icon} className={css.promptIcon} />
- <p className={css.promptText}>{text}</p>
- </Button>
+ const buttonClassName = classnames(css.promptButton, className);
+
+ const relationshipPromptButton = React.useMemo(
+ () => (
+ <Button
+ variant="filled"
+ buttonColor={buttonColor}
+ onClick={onClick}
+ className={buttonClassName}
+ >
+ <FontAwesomeIcon icon={icon} />
+ <p className={css.promptText}>{text}</p>
+ </Button>
+ ),
+ [buttonClassName, buttonColor, icon, onClick, text],
);
+
+ return relationshipPromptButton;
}
export default RelationshipPromptButton;
diff --git a/web/chat/relationship-prompt/relationship-prompt.css b/web/chat/relationship-prompt/relationship-prompt.css
--- a/web/chat/relationship-prompt/relationship-prompt.css
+++ b/web/chat/relationship-prompt/relationship-prompt.css
@@ -1,16 +1,14 @@
div.promptButtonContainer {
display: flex;
+ padding: 0.5rem;
+ column-gap: 1rem;
}
button.promptButton {
flex: 1;
- margin: 0.5rem;
+ column-gap: 8px;
}
p.promptText {
font-weight: var(--semi-bold);
}
-
-svg.promptIcon {
- padding: 0.5rem;
-}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 2:47 AM (20 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2696945
Default Alt Text
D9446.id31881.diff (2 KB)
Attached To
Mode
D9446: [web] update RelationshipPromptButton to be more reusable
Attached
Detach File
Event Timeline
Log In to Comment