Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
14 changes: 14 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@
--animate-tour-card-in: tour-card-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
--animate-tour-nudge: tour-nudge 0.36s ease-in-out;
--animate-tour-rise: tour-rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;

/* Landing page (app/page.tsx) */
--animate-landing-float: landing-float 6s ease-in-out infinite;
--animate-landing-rise: tour-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
--animate-landing-glow: landing-glow 8s ease-in-out infinite;
}

@keyframes landing-float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-10px); }
}
@keyframes landing-glow {
0%, 100% { opacity: 0.55; transform: scale(1); }
50% { opacity: 0.8; transform: scale(1.08); }
}

/* The ring breathing around what to click next */
Expand Down
2 changes: 1 addition & 1 deletion src/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function NotFound() {
</p>
</div>
<div className="flex gap-3 justify-center">
<Link href="/">
<Link href="/dashboard">
<Button style={{ backgroundColor: 'var(--brand)' }}>Go to dashboard</Button>
</Link>
<Link href="/patients">
Expand Down
404 changes: 404 additions & 0 deletions src/app/page.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/app/setup/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function SetupPage() {
</>
)}

<Link href="/" className="inline-block font-medium text-brand underline underline-offset-2">Try again</Link>
<Link href="/dashboard" className="inline-block font-medium text-brand underline underline-offset-2">Try again</Link>
</div>
</main>
)
Expand Down
4 changes: 2 additions & 2 deletions src/components/layout/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface NavItem {

/** The everyday screens, in the order a nurse reaches for them. Settings sits apart, at the bottom. */
export const NAV_ITEMS: NavItem[] = [
{ label: 'Overview', href: '/', icon: LayoutDashboard },
{ label: 'Overview', href: '/dashboard', icon: LayoutDashboard },
{ label: 'Patients', href: '/patients', icon: Users, alsoActiveOn: ['/episodes'] },
{ label: 'Alerts', href: '/alerts', icon: Bell },
{ label: 'Appointments', href: '/appointments', icon: Calendar },
Expand All @@ -32,7 +32,7 @@ export const NAV_ITEMS: NavItem[] = [
export const SETTINGS_ITEM: NavItem = { label: 'Settings', href: '/settings', icon: Settings }

export function isNavActive(pathname: string, item: NavItem) {
if (item.href === '/') return pathname === '/'
if (item.href === '/dashboard') return pathname === '/dashboard'
return [item.href, ...(item.alsoActiveOn ?? [])].some((p) => pathname === p || pathname.startsWith(`${p}/`))
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/tour/tour-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function TourProvider({ enabled, children }: { enabled: boolean; children
},
start: () => {
tour.start()
if (window.location.pathname !== '/') router.push('/')
if (window.location.pathname !== '/dashboard') router.push('/dashboard')
},
resume: () => {
tour.resume()
Expand Down
26 changes: 13 additions & 13 deletions src/components/tour/tour-steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ export const TOUR_STEPS: TourStep[] = [
{
id: 'overview-stats',
chapter: 'overview',
route: /^\/$/,
href: () => '/',
route: /^\/dashboard$/,
href: () => '/dashboard',
target: '[data-tour="overview-stats"]',
placement: ['bottom', 'top'],
title: 'The whole ward at a glance',
Expand All @@ -114,8 +114,8 @@ export const TOUR_STEPS: TourStep[] = [
{
id: 'overview-attention',
chapter: 'overview',
route: /^\/$/,
href: () => '/',
route: /^\/dashboard$/,
href: () => '/dashboard',
target: '[data-tour="overview-attention"]',
placement: ['right', 'left', 'top', 'bottom'],
title: 'Who needs a nurse, right now',
Expand All @@ -125,8 +125,8 @@ export const TOUR_STEPS: TourStep[] = [
{
id: 'overview-whatsapp',
chapter: 'overview',
route: /^\/$/,
href: () => '/',
route: /^\/dashboard$/,
href: () => '/dashboard',
target: '[data-tour="whatsapp-line"]',
placement: ['right', 'top'],
optional: true,
Expand All @@ -137,8 +137,8 @@ export const TOUR_STEPS: TourStep[] = [
{
id: 'overview-phone',
chapter: 'overview',
route: /^\/$/,
href: () => '/',
route: /^\/dashboard$/,
href: () => '/dashboard',
wide: true,
title: 'Try it on your own phone',
body: (
Expand All @@ -159,8 +159,8 @@ export const TOUR_STEPS: TourStep[] = [
{
id: 'overview-add',
chapter: 'overview',
route: /^\/$/,
href: () => '/',
route: /^\/dashboard$/,
href: () => '/dashboard',
target: '[data-tour="add-patient"]',
placement: ['bottom', 'left'],
title: 'Let’s send a patient home',
Expand Down Expand Up @@ -380,7 +380,7 @@ export const TOUR_STEPS: TourStep[] = [
id: 'explore-alerts',
chapter: 'explore',
route: null,
href: () => '/',
href: () => '/dashboard',
target: '[data-tour="nav-alerts"]',
placement: ['right', 'bottom'],
optional: true,
Expand All @@ -392,7 +392,7 @@ export const TOUR_STEPS: TourStep[] = [
id: 'explore-analytics',
chapter: 'explore',
route: null,
href: () => '/',
href: () => '/dashboard',
target: '[data-tour="nav-analytics"]',
placement: ['right', 'bottom'],
optional: true,
Expand All @@ -404,7 +404,7 @@ export const TOUR_STEPS: TourStep[] = [
id: 'explore-finish',
chapter: 'explore',
route: null,
href: () => '/',
href: () => '/dashboard',
target: '[data-tour="tour-button"]',
placement: ['bottom', 'left'],
title: 'That’s CareLoop',
Expand Down
6 changes: 3 additions & 3 deletions src/lib/supabase/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ export async function updateSession(request: NextRequest) {

const { pathname } = request.nextUrl

// Public routes that don't require a user session.
// Public routes that don't require a user session. / is the landing page.
// /api/webhooks is verified by Twilio signature; /api/cron by CRON_SECRET bearer token.
const publicPaths = ['/setup', '/invite', '/api/webhooks', '/api/cron', '/api/v1/auth']
const isPublic = publicPaths.some((p) => pathname.startsWith(p))
const isPublic = pathname === '/' || publicPaths.some((p) => pathname.startsWith(p))

// There is no login screen. The old /login address goes to the dashboard.
if (pathname === '/login') {
const url = request.nextUrl.clone()
url.pathname = '/'
url.pathname = '/dashboard'
return NextResponse.redirect(url)
}

Expand Down
Loading