Skip to content

Commit

Permalink
feat(RoleRequirements): use ScrollArea
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Oct 1, 2024
1 parent e764032 commit 93951b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@
}

@layer utilities {
.scroll-shadow {
.scroll-shadow,
.scroll-shadow [data-radix-scroll-area-viewport] {
--scroll-shadow-bg: hsl(var(--card-secondary));
--scroll-shadow-from: rgba(0, 0, 0, 0.1);
--scroll-shadow-to: rgba(0, 0, 0, 0);
Expand Down
7 changes: 4 additions & 3 deletions src/components/[guild]/Requirements/RoleRequirements.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ScrollArea } from "@/components/ui/ScrollArea"
import { cn } from "@/lib/utils"
import { Question } from "@phosphor-icons/react/dist/ssr"
import { Fragment } from "react"
Expand Down Expand Up @@ -27,9 +28,9 @@ const RoleRequirements = ({
const { data: requirements, isLoading } = useRequirements(role?.id)

return (
<div
<ScrollArea
className={cn(
"custom-scrollbar flex w-full flex-grow basis-80 flex-col overflow-y-auto opacity-0 md:basis-0",
"flex w-full flex-grow basis-80 flex-col overflow-y-auto opacity-0 md:basis-0",
{
"opacity-100": isOpen,
"basis-full": (requirements?.length ?? 0) < 3,
Expand Down Expand Up @@ -89,7 +90,7 @@ const RoleRequirements = ({
</div>
)}
</div>
</div>
</ScrollArea>
)
}

Expand Down

0 comments on commit 93951b0

Please sign in to comment.