forked from ben-jamming-reilly/parasocial
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
e71316b
commit d1aed6a
Showing
19 changed files
with
277 additions
and
84 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,87 @@ | ||
"use client"; | ||
import Link from "next/link"; | ||
import Image from "next/image"; | ||
import { useState } from "react"; | ||
|
||
import { YoutubeVideo } from "~/server/video-query"; | ||
import type { VideoUpload } from "@prisma/client"; | ||
import { ScrollArea } from "~/components/ui/scroll-area"; | ||
import { | ||
Accordion, | ||
AccordionContent, | ||
AccordionItem, | ||
AccordionTrigger, | ||
} from "~/components/ui/accordion"; | ||
import Youtube from "~/components/Youtube"; | ||
|
||
function displayDate(dateString: string) { | ||
const date = new Date(dateString); | ||
return date.toLocaleDateString(); | ||
} | ||
|
||
interface UploadItemProps { | ||
mobile: boolean; | ||
doc: VideoUpload; | ||
} | ||
|
||
function UploadItem({ doc, mobile }: UploadItemProps) { | ||
return ( | ||
<Link | ||
href={doc.url} | ||
className="text flex flex-row gap-2 border-4 border-black bg-black px-3 hover:underline" | ||
> | ||
<div className="flex-1 flex-col-reverse"> | ||
<p className="line-clamp-2 flex-1 tracking-wider text-white"> | ||
{doc.url} | ||
</p> | ||
<p className="text-xs text-neutral-400"> | ||
{doc.create_date.toDateString()} | ||
</p> | ||
</div> | ||
</Link> | ||
); | ||
} | ||
|
||
interface UploadListProps { | ||
documents: VideoUpload[]; | ||
} | ||
|
||
export function UploadList({ documents }: UploadListProps) { | ||
return ( | ||
<> | ||
{/* Mobile View */} | ||
<Accordion className="block sm:hidden w-full" type="single" collapsible> | ||
<AccordionItem className="border-none" value="item-1"> | ||
<AccordionTrigger className="flex flex-1 flex-row bg-black px-3 py-1 font-bold tracking-widest text-white"> | ||
uploads | ||
</AccordionTrigger> | ||
<AccordionContent className="mt-2"> | ||
<ScrollArea className="max-h-[40vh] gap-3 "> | ||
<div className="flex flex-col gap-3 text-white"> | ||
{documents.map((doc) => ( | ||
<UploadItem key={doc.url} mobile={true} doc={doc} /> | ||
))} | ||
</div> | ||
</ScrollArea> | ||
</AccordionContent> | ||
</AccordionItem> | ||
</Accordion> | ||
|
||
{/* Desktop View */} | ||
<div className="hidden sm:block"> | ||
<div className="mb-3 px-3"> | ||
<h3 className="max-w-fit bg-black px-3 font-bold tracking-widest text-white"> | ||
uploads | ||
</h3> | ||
</div> | ||
<ScrollArea className="h-[50vh] "> | ||
<div className="flex flex-col gap-3 text-sm text-white lg:text-base"> | ||
{documents.map((doc) => ( | ||
<UploadItem key={doc.url} mobile={false} doc={doc} /> | ||
))} | ||
</div> | ||
</ScrollArea> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"use client"; | ||
import { useSession } from "next-auth/react"; | ||
type BannerProps = { | ||
messages: string[]; | ||
}; | ||
|
||
export function Banner({ messages }: BannerProps) { | ||
const { data, status } = useSession(); | ||
if (data || status === "loading") return null; | ||
|
||
return ( | ||
<div className="overflow-hidden whitespace-nowrap min-w-10 "> | ||
<div className="text-black tracking-wider items-center text-sm flex flex-row "> | ||
<div className="z-30 bg-inherit font-bold">[</div> | ||
<div className=" animate-banner-scroll my-auto "> | ||
{messages.map((message) => ( | ||
<div className="-z-10">{message}</div> | ||
))} | ||
</div> | ||
<div className="z-30 bg-inherit overflow-hidden font-bold">]</div> | ||
</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
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.