Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nextui in favour of shadcn #23

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
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
151 changes: 87 additions & 64 deletions app/(home)/bot/pronouns/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import type { Metadata } from "next";
import { Montserrat, Patrick_Hand } from "next/font/google";
import Image from "next/image";
import Link from "next/link";
import { BsDiscord } from "react-icons/bs";
import { HiHome, HiUserAdd } from "react-icons/hi";

import { ClientButton } from "@/components/client";
import Comment from "@/components/comment";
import ImageGrid from "@/components/image-grid";
import { Button } from "@/components/ui/button";
import { defaultFetchOptions } from "@/lib/api";
import ArrowPic from "@/public/icons/arroww.webp";
import type { ApiV1TopguildsGetResponse } from "@/typings";
Expand Down Expand Up @@ -57,19 +56,17 @@ export default async function RootLayout({
.then((res) => res.json())
.catch(() => null) as ApiV1TopguildsGetResponse[] | null;

return (
<div>

<div className="lg:text-7xl text-5xl flex font-semibold md:mb-6 mb-4 dark:text-neutral-100 text-neutral-900 break-words w-full">
<h1 className={montserrat.className}>
<span className="bg-gradient-to-r from-indigo-400 to-pink-400 bg-clip-text text-transparent h-20 break-keep">Pronouns</span>
{" in "}
<span className="underline decoration-blurple break-keep">discord</span>
</h1>
</div>

{
topGuilds &&
return (<>
<div className="lg:text-7xl text-5xl flex font-semibold md:mb-6 mb-4 dark:text-neutral-100 text-neutral-900 break-words w-full">
<h1 className={montserrat.className}>
<span className="bg-gradient-to-r from-indigo-400 to-pink-400 bg-clip-text text-transparent h-20 break-keep">Pronouns</span>
{" in "}
<span className="underline decoration-blurple break-keep">discord</span>
</h1>
</div>

{
topGuilds &&
<ImageGrid images={topGuilds
.sort((a, b) => b.memberCount - a.memberCount)
.map((guild) => ({
Expand All @@ -78,83 +75,109 @@ export default async function RootLayout({
link: getCanonicalUrl("leaderboard", guild.id)
}))}
/>
}
}

<div className="md:text-xl text-lg lg:flex w-full mt-4">
<div className="font-medium w-full grid grid-cols-2 md:flex flex-wrap h-min gap-2">
<ClientButton
as={Link}
<div className="md:text-xl text-lg lg:flex w-full mt-4">
<div className="font-medium w-full grid grid-cols-2 md:flex flex-wrap h-min gap-2">
<Button
asChild
className="w-1/2 lg:w-fit text-lg"
>
<Link
prefetch={false}
href="/bot/pronouns"
>
<HiHome />
</ClientButton>
<ClientButton
as={Link}
</Link>
</Button>
<Button
asChild
className="w-1/2 lg:w-fit text-lg"
>
<Link
prefetch={false}
href="/bot/pronouns/pronouns"
>
Pronouns
</ClientButton>
<ClientButton
as={Link}
</Link>
</Button>
<Button
asChild
className="w-1/2 lg:w-fit text-lg"
>
<Link
prefetch={false}
href="/bot/pronouns/genders"
>
Genders
</ClientButton>
<ClientButton
as={Link}
</Link>
</Button>
<Button
asChild
className="w-1/2 lg:w-fit text-lg"
>
<Link
prefetch={false}
href="/bot/pronouns/sexualities"
>
Sexualities
</ClientButton>
</div>
</Link>
</Button>
</div>

<div className="flex flex-col min-w-full lg:min-w-[420px]">
<div className="flex flex-col min-w-full lg:min-w-[420px]">

<div className="lg:ml-auto flex gap-2 text-xl font-medium mt-4 lg:mt-0">
<ClientButton
as={Link}
startContent={<HiUserAdd />}
className="button-primary w-1/2 lg:w-fit !text-xl !font-medium"
<div className="lg:ml-auto flex gap-2 text-xl font-medium mt-4 lg:mt-0">
<Button
asChild
className="w-1/2 lg:w-fit text-lg font-medium"
variant="secondary"
>
<Link
prefetch={false}
href="https://discord.com/oauth2/authorize?client_id=912003493777268767&permissions=8&scope=bot%20applications.commands"
size="lg"
>
<HiUserAdd />
<span className="block sm:hidden">Invite</span>
<span className="hidden sm:block">Invite Pronouns</span>
</ClientButton>
<ClientButton
as={Link}
startContent={<BsDiscord />}
className="w-1/2 lg:w-fit !text-xl !font-medium"
</Link>
</Button>
<Button
asChild
className="w-1/2 lg:w-fit text-lg"
>
<Link
prefetch={false}
href="/support"
size="lg"
>
<HiUserAdd />
<span className="block sm:hidden">Support</span>
<span className="hidden sm:block">Join support</span>
</ClientButton>
</div>

<span className="hidden sm:block">Join Support</span>
</Link>
</Button>
</div>

<span className={cn(handwritten.className, "lg:ml-auto flex gap-2 text-neutral-500 font-mediumr mt-3 opacity-80 pl-20 lg:pr-20 rotate-2")}>
<Image src={ArrowPic} width={24} height={24} alt="arrow up" className="h-5 w-5 relative top-px" draggable={false} />
Get started here in seconds
</span>

</div>
<span className={cn(handwritten.className, "lg:ml-auto flex gap-2 text-neutral-500 font-mediumr mt-3 opacity-80 pl-20 lg:pr-20 rotate-2")}>
<Image src={ArrowPic} width={24} height={24} alt="arrow up" className="h-5 w-5 relative top-px" draggable={false} />
Get started here in seconds
</span>

</div>

</div>

<div className="lg:my-10 my-8 w-full">
{children}
</div>

<Comment
username="@deleted user"
bio="Pronouns user"
avatar="/discord.webp"
content="I have a lot of friends who have different preferred pronouns and identities and I think it's super sweet y'all have the feature that they can change their pronouns anytime so I put your bot in my servers and a friend may put it in theirs too 🥰"
/>
<div className="lg:my-10 my-8 w-full">
{children}
</div>

<Comment
username="@deleted user"
bio="Pronouns user"
avatar="/discord.webp"
content="I have a lot of friends who have different preferred pronouns and identities and I think it's super sweet y'all have the feature that they can change their pronouns anytime so I put your bot in my servers and a friend may put it in theirs too 🥰"
/>

</div >
);
</>);
}
2 changes: 1 addition & 1 deletion app/(home)/bot/pronouns/list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function List({ res, type }: Props) {
return (
<div>
<div className="w-full flex items-center justify-between mb-2">
<span className="text-3xl font-semibold bg-gradient-to-r from-indigo-400 to-pink-400 bg-clip-text text-transparent break-keep">{type}</span>
<span className="text-3xl font-semibold bg-linear-to-r from-indigo-400 to-pink-400 bg-clip-text text-transparent break-keep">{type}</span>
<span>{res.content.length} avaliable</span>
</div>

Expand Down
39 changes: 21 additions & 18 deletions app/(home)/bot/pronouns/page.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import { Chip } from "@nextui-org/react";
import { Montserrat } from "next/font/google";
import Image from "next/image";
import Link from "next/link";
import { HiCash, HiPlus } from "react-icons/hi";
import { BsPlus } from "react-icons/bs";
import { HiCash } from "react-icons/hi";

import Box from "@/components/box";
import { ClientButton } from "@/components/client";
import DiscordMessage from "@/components/discord/message";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { cn } from "@/utils/cn";

const montserrat = Montserrat({ subsets: ["latin"] });

export default function Home() {

const styles = {
h2: cn(montserrat.className, "lg:text-5xl text-4xl bg-gradient-to-b bg-clip-text text-transparent from-neutral-200 from-40% to-violet-300 font-bold underline decoration-violet-400"),
h3: cn(montserrat.className, "lg:text-2xl text-xl bg-gradient-to-b bg-clip-text text-transparent from-neutral-200 from-40% to-neutral-300 font-semibold")
h2: cn(montserrat.className, "lg:text-5xl text-4xl bg-linear-to-b bg-clip-text text-transparent from-neutral-200 from-40% to-violet-300 font-bold underline decoration-violet-400"),
h3: cn(montserrat.className, "lg:text-2xl text-xl bg-linear-to-b bg-clip-text text-transparent from-neutral-200 from-40% to-neutral-300 font-semibold")
};

const messageProps = (command: string) => {
Expand Down Expand Up @@ -45,14 +46,14 @@ export default function Home() {

<Box className="flex flex-col md:flex-row gap-10 items-center">
<div className="md:w-1/2">
<Chip
<Badge
className="mb-2"
color="secondary"
variant="flat"
startContent={<HiCash className="mx-1" />}
radius="rounded"
>
<span className="font-semibold">Everything for free</span>
</Chip>
<HiCash />
Everything for free
</Badge>

<h3 className={styles.h3}>Sexualities, Genders & Pronouns</h3>

Expand All @@ -62,14 +63,16 @@ export default function Home() {
</div>

<div className="flex gap-2 mt-6">
<ClientButton
as={Link}
className="bg-wamellow-alpha"
startContent={<HiPlus />}
href="/support"
>
Request additional
</ClientButton>
<Button asChild>
<Link
prefetch={false}
href="/support"
target="_blank"
>
<BsPlus />
Request Additional
</Link>
</Button>
</div>
</div>

Expand Down
18 changes: 9 additions & 9 deletions app/(home)/commands.component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HiFire, HiInformationCircle } from "react-icons/hi";

import Box from "@/components/box";
import { ClientChip } from "@/components/client";
import { Badge } from "@/components/ui/badge";
import { defaultFetchOptions } from "@/lib/api";
import { intl } from "@/utils/numbers";

Expand All @@ -26,21 +26,21 @@ export async function Commands({
className="p-5 pb-3 dark:bg-wamellow bg-wamellow-100 rounded-lg my-4 w-full"
>
<div className="flex">
<ClientChip
color="secondary"
<Badge
variant="flat"
size="sm"
startContent={<HiFire className="ml-1" />}
radius="rounded"
>
<span className="font-semibold">Popular Slash Commands</span>
</ClientChip>
<HiFire />
Popular Slash Commands
</Badge>

<div className="ml-auto flex items-center gap-1 opacity-80">
<span className="text-xs">Since 7th December</span>
<span className="text-xs">Since September 2024</span>
<HiInformationCircle />
</div>
</div>

{commands && Array.isArray(commands) ?
{commands && Array.isArray(commands) && commands.length ?
<div className="divide-y divide-wamellow">
{commands
.sort((a, b) => b.uses - a.uses)
Expand Down
Loading