fix: update WindowActionButton styling for improved consistency and adjust header layout in SupportChatShell
This commit is contained in:
@@ -53,7 +53,7 @@ import { cn } from "@/lib/utils"
|
|||||||
import { useI18n } from "@/i18n/provider"
|
import { useI18n } from "@/i18n/provider"
|
||||||
|
|
||||||
const windowActionButtonClass =
|
const windowActionButtonClass =
|
||||||
"size-7 rounded-md border-0 bg-transparent text-muted-foreground shadow-none hover:bg-foreground/[0.06] hover:text-foreground focus-visible:ring-primary/20 dark:hover:bg-white/10"
|
"size-8 rounded-full border-0 bg-transparent text-muted-foreground shadow-none hover:bg-foreground/[0.06] hover:text-foreground focus-visible:ring-primary/20 dark:hover:bg-white/10"
|
||||||
|
|
||||||
function WindowActionButton({
|
function WindowActionButton({
|
||||||
className,
|
className,
|
||||||
@@ -70,7 +70,7 @@ function WindowActionButton({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMobileStatusDotClass(status: string) {
|
function getStatusDotClass(status: string) {
|
||||||
if (status === "connected") {
|
if (status === "connected") {
|
||||||
return "bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]"
|
return "bg-emerald-500 shadow-[0_0_0_3px_rgba(16,185,129,0.14)]"
|
||||||
}
|
}
|
||||||
@@ -298,26 +298,24 @@ export function SupportChatShell() {
|
|||||||
style={{ "--primary": themeColor } as CSSProperties}
|
style={{ "--primary": themeColor } as CSSProperties}
|
||||||
>
|
>
|
||||||
<section className="flex h-full w-full flex-col overflow-hidden bg-card text-card-foreground">
|
<section className="flex h-full w-full flex-col overflow-hidden bg-card text-card-foreground">
|
||||||
<header className="shrink-0 border-b border-border/80 bg-card px-3 py-1.5 shadow-none dark:border-border/70 sm:border-primary/[0.10] sm:bg-primary/[0.04] sm:px-3 sm:py-2 sm:dark:border-primary/20 sm:dark:bg-primary/10">
|
<header className="shrink-0 border-b border-border/70 bg-card/95 px-3 py-2 shadow-[0_1px_0_rgba(15,23,42,0.02)] backdrop-blur dark:border-border/60 dark:bg-card/90 sm:px-4">
|
||||||
<div className="flex min-w-0 items-center justify-between gap-2">
|
<div className="flex min-w-0 items-center justify-between gap-3">
|
||||||
<div className="flex min-w-0 items-center gap-2">
|
<div className="flex min-w-0 items-center gap-2.5">
|
||||||
<div className="hidden size-7 shrink-0 items-center justify-center rounded-md bg-primary text-primary-foreground shadow-[0_6px_14px_rgba(37,99,235,0.16)] sm:flex">
|
<div className="relative flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary ring-1 ring-primary/15 dark:bg-primary/15 dark:ring-primary/25">
|
||||||
<HeadphonesIcon className="size-4" />
|
<HeadphonesIcon className="size-4" />
|
||||||
</div>
|
|
||||||
<div className="min-w-0">
|
|
||||||
<div className="flex min-w-0 items-center gap-2">
|
|
||||||
<span
|
<span
|
||||||
className={cn(
|
className={cn(
|
||||||
"size-1.5 shrink-0 rounded-full sm:hidden",
|
"absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full ring-2 ring-card",
|
||||||
getMobileStatusDotClass(status)
|
getStatusDotClass(status)
|
||||||
)}
|
)}
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="min-w-0 space-y-0.5">
|
||||||
<div className="truncate text-sm font-semibold leading-5 text-foreground">
|
<div className="truncate text-sm font-semibold leading-5 text-foreground">
|
||||||
{title}
|
{title}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="truncate text-[11px] leading-4 text-muted-foreground">
|
||||||
<div className="hidden truncate text-[11px] leading-4 text-muted-foreground sm:block">
|
|
||||||
{subtitle}
|
{subtitle}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -380,7 +378,6 @@ export function SupportChatShell() {
|
|||||||
{status !== "connected" ? (
|
{status !== "connected" ? (
|
||||||
<SupportChatConnectionStatus status={status} />
|
<SupportChatConnectionStatus status={status} />
|
||||||
) : null}
|
) : null}
|
||||||
<div className="flex items-center gap-0.5 rounded-md bg-background/55 p-0.5 shadow-sm ring-1 ring-border/70 dark:bg-background/25 dark:ring-white/10">
|
|
||||||
<WindowActionButton
|
<WindowActionButton
|
||||||
onClick={retry}
|
onClick={retry}
|
||||||
aria-label={t("supportChat.retry")}
|
aria-label={t("supportChat.retry")}
|
||||||
@@ -420,7 +417,6 @@ export function SupportChatShell() {
|
|||||||
</WindowActionButton>
|
</WindowActionButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div className="grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)_auto] overflow-hidden bg-muted/60 dark:bg-muted/30">
|
<div className="grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)_auto] overflow-hidden bg-muted/60 dark:bg-muted/30">
|
||||||
|
|||||||
Reference in New Issue
Block a user