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
9 changes: 0 additions & 9 deletions src/app/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
"use client";

import { usePwaMode } from "@/lib/use-pwa-mode";
import { PwaShell } from "@/components/pwa-shell";

export default function AppLayout({ children }: { children: React.ReactNode }) {
const { isPwa } = usePwaMode();

// In installed PWA mode, ConditionalShell already wraps everything in PwaShell.
// Only apply PwaShell here when browsing /app in a regular browser tab.
if (isPwa) {
return <>{children}</>;
}

return <PwaShell>{children}</PwaShell>;
}
22 changes: 18 additions & 4 deletions src/app/app/more/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<Link
key={href}
href={href}
className="flex items-center gap-4 rounded-2xl border border-border-default bg-bg-surface p-4 transition hover:border-accent/50"
className="flex items-center gap-4 p-2 -mx-2 rounded-xl transition hover:bg-accent/5"
>
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl bg-accent/10">
<Icon className="size-6 text-accent" />
Expand All @@ -69,12 +69,12 @@
href="https://github.com/sparshsam/openproof"
target="_blank"
rel="noreferrer"
className="flex items-center gap-4 rounded-2xl border border-border-default bg-bg-surface p-4 transition hover:border-accent/50"
className="flex items-center gap-4 p-2 -mx-2 rounded-xl transition hover:bg-accent/5"
>
<div className="flex size-12 shrink-0 items-center justify-center rounded-xl bg-accent/10">
<ExternalLink className="size-6 text-accent" />
</div>
<div className="flex-1">
<div className="flex-1 min-w-0">
<p className="font-semibold text-text-primary">GitHub</p>
<p className="mt-0.5 text-sm text-text-secondary">
Source code, issues, and contribution guide
Expand All @@ -100,9 +100,23 @@
</div>

<p className="text-center text-xs text-text-muted">
OpenProof v0.9.3 &middot; AGPL-3.0
OpenProof v0.9.4 &middot; AGPL-3.0
</p>

{/* Kovina wordmark — visible on all devices */}
<div className="pt-4 text-center">
<a className="inline-block" href="https://kovina.org" rel="noreferrer" target="_blank" aria-label="Kovina">
<style>{`
[data-theme="dark"] .more-kovina-light { opacity: 0 !important; }
[data-theme="dark"] .more-kovina-dark { opacity: 1 !important; }
`}</style>
<span className="relative inline-block h-[18px] w-[140px] sm:w-[180px] align-middle">
<img alt="" className="more-kovina-light absolute inset-0 h-[18px] w-[140px] sm:w-[180px] transition-opacity duration-300" src="/kovina-wordmark.svg" />

Check warning on line 114 in src/app/app/more/page.tsx

View workflow job for this annotation

GitHub Actions / Validate

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
<img alt="" className="more-kovina-dark absolute inset-0 h-[18px] w-[140px] sm:w-[180px] transition-opacity duration-300 opacity-0" src="/kovina-wordmark-white.svg" />

Check warning on line 115 in src/app/app/more/page.tsx

View workflow job for this annotation

GitHub Actions / Validate

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
</span>
</a>
</div>

{/* Footer spacer for bottom nav on mobile */}
<div className="h-20 md:hidden" />
</div>
Expand Down
9 changes: 8 additions & 1 deletion src/components/conditional-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function ConditionalShell({ children }: { children: React.ReactNode }) {
}
}, [isPwa, pathname, router]);

// After hydration: use PWA-aware routing (may differ from SSR)
// After hydration: use PWA-aware routing
if (hydrated && isPwa) {
// While redirecting from / → /app, show a minimal placeholder
if (pathname === "/") {
Expand All @@ -36,10 +36,17 @@ export function ConditionalShell({ children }: { children: React.ReactNode }) {
</PwaShell>
);
}
// /app routes: AppLayout provides PwaShell — pass through
if (pathname.startsWith("/app")) {
return <>{children}</>;
}
// Non-/app routes: wrap in PwaShell here
return <PwaShell>{children}</PwaShell>;
}

// Before hydration OR browser mode: pathname-based routing (matches SSR)
// /app routes: AppLayout always provides PwaShell
// Non-/app routes: AppShell provides the website layout
const isAppRoute = pathname.startsWith("/app");
if (isAppRoute) {
return <>{children}</>;
Expand Down
Loading