Skip to content

Commit 20938e2

Browse files
authored
Enhance layout and component styles for improved responsiveness and user experience (#73)
- Updated header styles in layout.tsx for better visual consistency and added safe area insets. - Adjusted main content padding in app.tsx to accommodate dynamic top strip height. - Modified avatar-panel.tsx to change alignment of items for better layout. - Enhanced intake-form.tsx with additional padding for improved form usability. - Updated session-view.tsx to allow for better overflow handling in the component structure.
1 parent 2638865 commit 20938e2

5 files changed

Lines changed: 21 additions & 12 deletions

File tree

complex-agents/avatars/anam/frontend/app/layout.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ export default async function RootLayout({ children }: RootLayoutProps) {
7272
disableTransitionOnChange
7373
>
7474
<header
75-
className="fixed top-0 left-0 hidden w-full flex-row items-center justify-between px-4 md:flex"
75+
className="border-border/60 bg-background/90 fixed top-0 left-0 flex w-full items-center justify-between border-b px-3 backdrop-blur-sm md:px-4"
7676
style={{
77-
height: 'var(--app-top-strip-height)',
77+
height: 'calc(var(--app-top-strip-height) + env(safe-area-inset-top))',
78+
paddingTop: 'env(safe-area-inset-top)',
7879
zIndex: 'var(--app-z-header)',
7980
}}
8081
>
@@ -85,29 +86,34 @@ export default async function RootLayout({ children }: RootLayoutProps) {
8586
className="scale-100 transition-transform duration-300 hover:scale-110"
8687
>
8788
{/* eslint-disable-next-line @next/next/no-img-element */}
88-
<img src={logo} alt={`${companyName} Logo`} className="block size-26 dark:hidden" />
89+
<img
90+
src={logo}
91+
alt={`${companyName} Logo`}
92+
className="block size-14 sm:size-26 dark:hidden"
93+
/>
8994
{/* eslint-disable-next-line @next/next/no-img-element */}
9095
<img
9196
src={logoDark ?? logo}
9297
alt={`${companyName} Logo`}
93-
className="hidden size-26 dark:block"
98+
className="hidden size-14 sm:size-26 dark:block"
9499
/>
95100
</a>
96-
<span className="text-foreground font-mono text-xs font-bold tracking-wider uppercase">
97-
Built with{' '}
101+
<span className="text-foreground text-right font-mono text-[11px] font-bold tracking-wider uppercase md:text-xs">
102+
<span className="hidden sm:inline">Built with </span>
98103
<a
99104
target="_blank"
100105
rel="noopener noreferrer"
101106
href="https://docs.livekit.io/agents"
102107
className="underline underline-offset-4"
103108
>
104-
LiveKit Agents
109+
<span className="sm:hidden">LiveKit docs</span>
110+
<span className="hidden sm:inline">LiveKit Agents</span>
105111
</a>
106112
</span>
107113
</header>
108114

109115
{children}
110-
<div className="group fixed bottom-0 left-1/2 z-50 mb-2 -translate-x-1/2">
116+
<div className="group fixed bottom-0 left-1/2 z-50 mb-6 -translate-x-1/2 md:mb-2">
111117
<ThemeToggle className="translate-y-20 transition-transform delay-150 duration-300 group-hover:translate-y-0" />
112118
</div>
113119
</ThemeProvider>

complex-agents/avatars/anam/frontend/components/app/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function App({ appConfig }: AppProps) {
4141
return (
4242
<AgentSessionProvider session={session}>
4343
<AppSetup />
44-
<main className="grid h-svh grid-cols-1 place-content-center pt-[var(--app-top-strip-height)]">
44+
<main className="grid min-h-dvh grid-cols-1 place-content-center pt-[calc(var(--app-top-strip-height)+env(safe-area-inset-top))]">
4545
<ViewController appConfig={appConfig} />
4646
</main>
4747
<StartAudioButton label="Start Audio" />

complex-agents/avatars/anam/frontend/components/app/avatar-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function AvatarPanel({ className }: AvatarPanelProps) {
5959
const videoHeight = trackRef?.publication.dimensions?.height ?? 0;
6060

6161
return (
62-
<div className={cn('flex flex-col items-center justify-center gap-5 p-6', className)}>
62+
<div className={cn('flex flex-col items-center justify-start gap-5 p-6', className)}>
6363
<div className="relative flex aspect-square w-full max-w-xl min-w-0 items-center justify-center overflow-hidden rounded-lg bg-black">
6464
{trackRef ? (
6565
<VideoTrack

complex-agents/avatars/anam/frontend/components/app/intake-form.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ export function IntakeForm({
5656
}
5757

5858
return (
59-
<form className={cn('space-y-6 overflow-y-auto p-6', className)} onSubmit={handleSubmit}>
59+
<form
60+
className={cn('space-y-6 overflow-y-auto p-6 pb-24 md:pb-6', className)}
61+
onSubmit={handleSubmit}
62+
>
6063
<div className="space-y-1">
6164
<h2 className="text-2xl font-semibold tracking-tight">Patient intake form</h2>
6265
<p className="text-muted-foreground text-sm">

complex-agents/avatars/anam/frontend/components/app/session-view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export const SessionView = ({
7171
<div className="flex max-h-[45%] w-full min-w-0 shrink-0 flex-col border-b md:max-h-none md:w-[46%] md:border-b-0">
7272
<AvatarPanel className="flex-1" />
7373
</div>
74-
<div className="flex min-w-0 flex-1 flex-col overflow-hidden">
74+
<div className="flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto">
7575
<IntakeForm
7676
formData={formData}
7777
onFormDataChange={setFormData}

0 commit comments

Comments
 (0)