Files
linumiq_net-web_app/app/activate/page.tsx
T
Gerhard Scheikl 0fbabdad31 feat(ui): responsive layout for mobile and wide screens
- Add explicit viewport meta (device-width) for proper mobile scaling.
- Widen the main container (720 -> 960, 1120 on >=1280px) with fluid
  clamp() padding so wide screens are used better.
- Wrap the top nav and allow it to reflow on narrow screens.
- Collapse the key/value grid to a single column and enlarge touch
  targets on small screens.
- Keep single-form pages (login/signup/activate) in a readable narrow
  column instead of stretching full width.
2026-06-01 21:06:18 +02:00

42 lines
1.1 KiB
TypeScript

import { redirect } from 'next/navigation';
import { createSupabaseServerClient } from '@/lib/supabase/server';
import { getSupabaseAdmin } from '@/lib/supabase/admin';
import { ActivateClient } from './activate-client';
export const dynamic = 'force-dynamic';
export default async function ActivatePage({
searchParams,
}: {
searchParams: { code?: string };
}) {
const supabase = createSupabaseServerClient();
const {
data: { user },
} = await supabase.auth.getUser();
if (!user) redirect('/login?next=/activate');
const admin = getSupabaseAdmin();
const { data: tunnel } = await admin
.from('tunnels')
.select('subdomain')
.eq('user_id', user.id)
.maybeSingle<{ subdomain: string }>();
return (
<div className="form-card">
<h1>Activate device</h1>
<p className="muted">
Enter the code shown by your Home Assistant add-on to pair it with your
account.
</p>
<div className="card">
<ActivateClient
prefillCode={searchParams.code ?? ''}
currentSubdomain={tunnel?.subdomain ?? null}
/>
</div>
</div>
);
}