Page MenuHomePhabricator

D10279.id37142.diff
No OneTemporary

D10279.id37142.diff

diff --git a/web/modals/threads/confirm-leave-thread-modal.css b/web/modals/threads/confirm-leave-thread-modal.css
--- a/web/modals/threads/confirm-leave-thread-modal.css
+++ b/web/modals/threads/confirm-leave-thread-modal.css
@@ -1,17 +1,5 @@
div.container {
- padding: 0 40px 32px;
- border-radius: 8px;
- background: var(--modal-bg);
color: var(--modal-fg);
- min-width: 635px;
box-sizing: border-box;
-}
-div.container > p {
font-size: var(--xl-font-20);
- padding-bottom: 32px;
-}
-div.buttonContainer {
- display: flex;
- justify-content: flex-end;
- gap: 24px;
}
diff --git a/web/modals/threads/confirm-leave-thread-modal.react.js b/web/modals/threads/confirm-leave-thread-modal.react.js
--- a/web/modals/threads/confirm-leave-thread-modal.react.js
+++ b/web/modals/threads/confirm-leave-thread-modal.react.js
@@ -18,6 +18,29 @@
const { threadInfo, onClose, onConfirm } = props;
const { uiName } = useResolvedThreadInfo(threadInfo);
+ const primaryButton = React.useMemo(
+ () => (
+ <Button
+ onClick={onConfirm}
+ type="submit"
+ variant="filled"
+ buttonColor={buttonThemes.danger}
+ >
+ Yes, leave chat
+ </Button>
+ ),
+ [onConfirm],
+ );
+
+ const secondaryButton = React.useMemo(
+ () => (
+ <Button variant="outline" onClick={onClose}>
+ Cancel
+ </Button>
+ ),
+ [onClose],
+ );
+
return (
<Modal
size="fit-content"
@@ -25,26 +48,11 @@
icon="warning-circle"
withCloseButton={false}
onClose={onClose}
+ primaryButton={primaryButton}
+ secondaryButton={secondaryButton}
>
<div className={css.container}>
- <p>
- {'Are you sure you want to leave "'}
- <span className={css['thread-name']}>{uiName}</span>
- {'"?'}
- </p>
- <div className={css.buttonContainer}>
- <Button variant="outline" onClick={onClose}>
- Cancel
- </Button>
- <Button
- variant="filled"
- buttonColor={buttonThemes.danger}
- onClick={onConfirm}
- type="submit"
- >
- Yes, leave chat
- </Button>
- </div>
+ Are you sure you want to leave &ldquo;{uiName}&rdquo;?
</div>
</Modal>
);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 8:41 PM (20 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2507099
Default Alt Text
D10279.id37142.diff (2 KB)

Event Timeline