feat(chat): prompt facebook users to open external browser

This commit is contained in:
2026-06-18 10:59:13 +08:00
parent d2bced8889
commit 172ef28060
9 changed files with 242 additions and 30 deletions
@@ -0,0 +1,64 @@
.overlay {
position: fixed;
inset: 0;
z-index: 70;
display: flex;
align-items: center;
justify-content: center;
padding: var(--spacing-md, 16px);
background: rgba(0, 0, 0, 0.5);
}
.dialog {
width: 100%;
max-width: 360px;
padding: 24px 18px 18px;
text-align: center;
background: var(--color-page-background, #ffffff);
border-radius: 32px;
box-shadow: 0 20px 48px rgba(0, 0, 0, 0.22);
}
.title {
margin: 0 0 10px;
font-size: var(--font-size-22, 22px);
font-weight: 700;
line-height: 1.2;
color: var(--color-text-foreground, #171717);
}
.content {
margin: 0 12px 22px;
font-size: var(--font-size-md, 15px);
line-height: 1.5;
color: var(--color-text-secondary, #555555);
white-space: pre-line;
}
.actions {
display: flex;
gap: var(--spacing-md, 12px);
}
.button {
flex: 1 1 auto;
height: 44px;
border: 0;
border-radius: 999px;
font-size: var(--font-size-md, 15px);
font-weight: 700;
cursor: pointer;
}
.secondary {
color: var(--color-text-secondary, #555555);
background: #efefef;
}
.primary {
color: #ffffff;
background: linear-gradient(
var(--color-button-gradient-start, #ff67e0),
var(--color-button-gradient-end, #ff52a2)
);
}
@@ -0,0 +1,52 @@
"use client";
import styles from "./external-browser-dialog.module.css";
export interface ExternalBrowserDialogProps {
open: boolean;
onClose: () => void;
onConfirm: () => void;
}
export function ExternalBrowserDialog({
open,
onClose,
onConfirm,
}: ExternalBrowserDialogProps) {
if (!open) return null;
return (
<div
className={styles.overlay}
role="dialog"
aria-modal="true"
aria-labelledby="external-browser-title"
>
<div className={styles.dialog}>
<h2 id="external-browser-title" className={styles.title}>
Open in browser
</h2>
<p className={styles.content}>
Sync your Facebook profile to an external browser{"\n"}
for the best chat experience.
</p>
<div className={styles.actions}>
<button
type="button"
className={`${styles.button} ${styles.secondary}`}
onClick={onClose}
>
Later
</button>
<button
type="button"
className={`${styles.button} ${styles.primary}`}
onClick={onConfirm}
>
Continue
</button>
</div>
</div>
</div>
);
}
+1
View File
@@ -11,6 +11,7 @@ export * from "./chat-input-text-field";
export * from "./chat-quota-exhausted-banner";
export * from "./chat-send-button";
export * from "./date-header";
export * from "./external-browser-dialog";
export * from "./fullscreen-image-viewer";
export * from "./image-bubble";
export * from "./language-dialog";