-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
492 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"use client"; | ||
|
||
import { cn } from "@umamin/ui/lib/utils"; | ||
import { AnimatedShinyText } from "@umamin/ui/components/animated-shiny-text"; | ||
|
||
export default function Blocked() { | ||
return ( | ||
<div className="flex items-center flex-col min-h-screen lg:pt-44 py-36 md:gap-8 gap-6 container"> | ||
<div | ||
className={cn( | ||
"group rounded-full border border-black/5 bg-zinc-100 text-base text-white transition-all ease-in dark:border-white/5 dark:bg-zinc-900", | ||
)} | ||
> | ||
<AnimatedShinyText className="inline-flex items-center justify-center px-4 py-1 transition ease-out"> | ||
Access Denied | ||
</AnimatedShinyText> | ||
</div> | ||
<div className="border-b-2 border-muted border-dashed md:pb-8 pb-6"> | ||
<h1 className="font-extrabold md:text-7xl text-[10vw] leading-none dark:bg-gradient-to-b from-foreground dark:to-zinc-400 bg-clip-text bg-zinc-800 text-transparent tracking-tighter text-center"> | ||
Your access has been blocked. | ||
</h1> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as React from "react"; | ||
|
||
export function useMediaQuery(query: string) { | ||
const [value, setValue] = React.useState(false); | ||
|
||
React.useEffect(() => { | ||
function onChange(event: MediaQueryListEvent) { | ||
setValue(event.matches); | ||
} | ||
|
||
const result = matchMedia(query); | ||
result.addEventListener("change", onChange); | ||
setValue(result.matches); | ||
|
||
return () => result.removeEventListener("change", onChange); | ||
}, [query]); | ||
|
||
return value; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,30 @@ | ||
import { Suspense } from "react"; | ||
import { cookies } from "next/headers"; | ||
import { Skeleton } from "@umamin/ui/components/skeleton"; | ||
|
||
import { lucia } from "@/lib/auth"; | ||
import { cache } from "react"; | ||
import { getSession } from "@/lib/auth"; | ||
import { getClient } from "@/lib/gql/rsc"; | ||
import { ReceivedMessagesList } from "./list"; | ||
import { RECEIVED_MESSAGES_QUERY } from "../../queries"; | ||
|
||
export async function ReceivedMessages() { | ||
const sessionId = cookies().get(lucia.sessionCookieName)?.value ?? ""; | ||
const getMessages = cache(async (sessionId?: string) => { | ||
const result = await getClient(sessionId).query(RECEIVED_MESSAGES_QUERY, { | ||
type: "received", | ||
}); | ||
|
||
const messages = result?.data?.messages; | ||
return result?.data?.messages; | ||
}); | ||
|
||
export async function ReceivedMessages() { | ||
const { session } = await getSession(); | ||
const messages = await getMessages(session?.id); | ||
|
||
return ( | ||
<Suspense | ||
fallback={ | ||
<div className="space-y-5"> | ||
<Skeleton className="w-full h-[200px] rounded-lg" /> | ||
<Skeleton className="w-full h-[200px] rounded-lg" /> | ||
<Skeleton className="w-full h-[200px] rounded-lg" /> | ||
</div> | ||
} | ||
> | ||
<div className="flex flex-col items-center gap-5 pb-20"> | ||
{!messages?.length ? ( | ||
<p className="text-sm text-muted-foreground mt-4"> | ||
No messages to show | ||
</p> | ||
) : ( | ||
<ReceivedMessagesList messages={messages} /> | ||
)} | ||
</div> | ||
</Suspense> | ||
<div className="flex flex-col items-center gap-5 pb-20"> | ||
{!messages?.length ? ( | ||
<p className="text-sm text-muted-foreground mt-4"> | ||
No messages to show | ||
</p> | ||
) : ( | ||
<ReceivedMessagesList messages={messages} /> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,30 @@ | ||
import { Suspense } from "react"; | ||
import { cookies } from "next/headers"; | ||
import { Skeleton } from "@umamin/ui/components/skeleton"; | ||
|
||
import { lucia } from "@/lib/auth"; | ||
import { cache } from "react"; | ||
import { getSession } from "@/lib/auth"; | ||
import { getClient } from "@/lib/gql/rsc"; | ||
import { SentMessagesList } from "./list"; | ||
import { SENT_MESSAGES_QUERY } from "../../queries"; | ||
|
||
export async function SentMessages() { | ||
const sessionId = cookies().get(lucia.sessionCookieName)?.value ?? ""; | ||
const getMessages = cache(async (sessionId?: string) => { | ||
const result = await getClient(sessionId).query(SENT_MESSAGES_QUERY, { | ||
type: "sent", | ||
}); | ||
const messages = result?.data?.messages; | ||
|
||
return result?.data?.messages; | ||
}); | ||
|
||
export async function SentMessages() { | ||
const { session } = await getSession(); | ||
const messages = await getMessages(session?.id); | ||
|
||
return ( | ||
<Suspense | ||
fallback={ | ||
<div className="space-y-5"> | ||
<Skeleton className="w-full h-[300px] rounded-lg" /> | ||
<Skeleton className="w-full h-[300px] rounded-lg" /> | ||
<Skeleton className="w-full h-[300px] rounded-lg" /> | ||
</div> | ||
} | ||
> | ||
<div className="flex w-full flex-col items-center gap-5 pb-20"> | ||
{!messages?.length ? ( | ||
<p className="text-sm text-muted-foreground mt-4"> | ||
No messages to show | ||
</p> | ||
) : ( | ||
<SentMessagesList messages={messages} /> | ||
)} | ||
</div> | ||
</Suspense> | ||
<div className="flex w-full flex-col items-center gap-5 pb-20"> | ||
{!messages?.length ? ( | ||
<p className="text-sm text-muted-foreground mt-4"> | ||
No messages to show | ||
</p> | ||
) : ( | ||
<SentMessagesList messages={messages} /> | ||
)} | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.