feat(call): add streaming voice call experience
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* 顶部保持返回、首充优惠、收藏入口三段结构。
|
||||
*/
|
||||
import type { ReactNode } from "react";
|
||||
import { Lock } from "lucide-react";
|
||||
import { Lock, Phone } from "lucide-react";
|
||||
|
||||
import { BackButton } from "@/app/_components";
|
||||
import { FavoriteEntryButton } from "@/app/_components/core";
|
||||
@@ -27,6 +27,7 @@ export function ChatHeader({
|
||||
const navigator = useAppNavigator();
|
||||
const character = useActiveCharacter();
|
||||
const characterRoutes = useActiveCharacterRoutes();
|
||||
const voiceCallEnabled = process.env.NEXT_PUBLIC_ENABLE_VOICE_CALL === "true";
|
||||
|
||||
return (
|
||||
<header className="flex shrink-0 flex-col items-stretch bg-transparent p-0">
|
||||
@@ -58,10 +59,24 @@ export function ChatHeader({
|
||||
|
||||
<div className="flex min-w-0 justify-center">{offerBanner}</div>
|
||||
|
||||
<FavoriteEntryButton
|
||||
characterSlug={character.slug}
|
||||
tone="dark"
|
||||
/>
|
||||
<div className="flex items-center gap-2">
|
||||
{voiceCallEnabled ? (
|
||||
<button
|
||||
type="button"
|
||||
className="inline-flex size-(--responsive-icon-button-size,42px) cursor-pointer items-center justify-center rounded-full border border-[rgba(255,255,255,0.12)] bg-[rgba(13,11,20,0.7)] text-white shadow-[0_10px_24px_rgba(0,0,0,0.2)] backdrop-blur-md transition hover:bg-[rgba(28,24,39,0.82)] active:scale-96"
|
||||
aria-label={`Call ${character.shortName}`}
|
||||
data-analytics-key="chat.start_voice_call"
|
||||
data-analytics-label="Start voice call"
|
||||
onClick={() => navigator.push(characterRoutes.call)}
|
||||
>
|
||||
<Phone size={19} strokeWidth={2.3} aria-hidden="true" />
|
||||
</button>
|
||||
) : null}
|
||||
<FavoriteEntryButton
|
||||
characterSlug={character.slug}
|
||||
tone="dark"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user