-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Update admin layout and pages (#976)
- Loading branch information
Showing
81 changed files
with
2,060 additions
and
1,267 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
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,42 @@ | ||
"use client"; | ||
|
||
import { cn } from "@rallly/ui"; | ||
import { Link } from "lucide-react"; | ||
import { usePathname } from "next/navigation"; | ||
|
||
import { IconComponent } from "@/types"; | ||
|
||
export function MenuItem({ | ||
href, | ||
children, | ||
icon: Icon, | ||
}: { | ||
href: string; | ||
icon: IconComponent; | ||
children: React.ReactNode; | ||
}) { | ||
const pathname = usePathname(); | ||
const isCurrent = pathname === href; | ||
return ( | ||
<Link | ||
href={href} | ||
className={cn( | ||
isCurrent | ||
? "bg-gray-200 text-indigo-600" | ||
: "text-gray-700 hover:text-primary", | ||
"group flex items-center gap-x-3 rounded-md py-2 px-3 text-sm leading-6 font-semibold", | ||
)} | ||
> | ||
<Icon | ||
className={cn( | ||
isCurrent | ||
? "text-indigo-600" | ||
: "text-gray-400 group-hover:text-indigo-600", | ||
"h-5 w-5 shrink-0", | ||
)} | ||
aria-hidden="true" | ||
/> | ||
{children} | ||
</Link> | ||
); | ||
} |
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,3 @@ | ||
export default function Loading() { | ||
return null; | ||
} |
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,55 @@ | ||
"use client"; | ||
|
||
import { cn } from "@rallly/ui"; | ||
import { Button } from "@rallly/ui/button"; | ||
import Link from "next/link"; | ||
import { usePathname, useSearchParams } from "next/navigation"; | ||
|
||
import { Trans } from "@/components/trans"; | ||
|
||
function PollFolder({ | ||
href, | ||
children, | ||
}: { | ||
href: string; | ||
children: React.ReactNode; | ||
}) { | ||
const pathname = usePathname() ?? ""; | ||
const searchParams = useSearchParams(); | ||
const query = searchParams?.has("status") | ||
? `?${searchParams?.toString()}` | ||
: ""; | ||
const currentUrl = pathname + query; | ||
const isActive = href === currentUrl; | ||
return ( | ||
<Button | ||
asChild | ||
className={cn( | ||
isActive | ||
? "bg-gray-100" | ||
: "shadow-sm text-muted-foreground hover:bg-gray-100 active:bg-gray-200", | ||
)} | ||
> | ||
<Link href={href}>{children}</Link> | ||
</Button> | ||
); | ||
} | ||
|
||
export function PollFolders() { | ||
return ( | ||
<div className="flex flex-wrap gap-3"> | ||
<PollFolder href="/polls"> | ||
<Trans i18nKey="pollStatusAll" defaults="All" /> | ||
</PollFolder> | ||
<PollFolder href="/polls?status=live"> | ||
<Trans i18nKey="pollStatusLive" defaults="Live" /> | ||
</PollFolder> | ||
<PollFolder href="/polls?status=paused"> | ||
<Trans i18nKey="pollStatusPaused" defaults="Paused" /> | ||
</PollFolder> | ||
<PollFolder href="/polls?status=finalized"> | ||
<Trans i18nKey="pollStatusFinalized" defaults="Finalized" /> | ||
</PollFolder> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.
a1bac0c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
landing – ./
landing-rallly.vercel.app
landing-git-main-rallly.vercel.app
rallly-nu.vercel.app
rallly.co
www.rallly.co
landing.rallly.co
a1bac0c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
app – ./
app-rallly.vercel.app
app-git-main-rallly.vercel.app
app.rallly.co