mirror of
https://github.com/opus-tango/socialdb-sh.git
synced 2026-03-20 12:05:21 +00:00
add placeholder pages for people
This commit is contained in:
7
src/app/person/desktop.tsx
Normal file
7
src/app/person/desktop.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function PersonDesktop() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Person</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
7
src/app/person/mobile.tsx
Normal file
7
src/app/person/mobile.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
export default function PersonMobile() {
|
||||
return (
|
||||
<div>
|
||||
<h1>Person</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
31
src/app/person/page.tsx
Normal file
31
src/app/person/page.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { authClient } from "@/utils/auth-client";
|
||||
import PersonMobile from "./mobile";
|
||||
import PersonDesktop from "./desktop";
|
||||
|
||||
export default function PersonPage() {
|
||||
const { data: session, isPending, error, refetch } = authClient.useSession();
|
||||
|
||||
// Handle session states
|
||||
if (isPending) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
if (error) {
|
||||
return <div>Error: {error.message}</div>;
|
||||
}
|
||||
|
||||
// Get window width for responsive design
|
||||
const width = typeof window !== "undefined" ? window.innerWidth : 0;
|
||||
if (width === 0) {
|
||||
return <div>Loading...</div>;
|
||||
}
|
||||
|
||||
// Render the mobile component if the window width is less than 768
|
||||
if (!isPending && session && width < 768) {
|
||||
return <PersonMobile />;
|
||||
}
|
||||
|
||||
// Render the desktop component if the window width is greater than or equal to 768
|
||||
if (!isPending && session && width >= 768) {
|
||||
return <PersonDesktop />;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user