Skip to content

Commit

Permalink
refactor: comp
Browse files Browse the repository at this point in the history
  • Loading branch information
sadmann7 committed Jul 7, 2024
1 parent 2df0304 commit e7dee0f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from "@/components/ui/card"
import { Sortable, SortableItem } from "@/components/ui/sortable"

export function MixedOrientaionDemo() {
export function MixedSortingDemo() {
const [specialTricks, setSpecialTricks] = React.useState(
dataConfig.speicalTricks
)
Expand All @@ -37,7 +37,7 @@ export function MixedOrientaionDemo() {
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-4">
{specialTricks.map((item) => (
<SortableItem key={item.id} value={item.id} asTrigger asChild>
<Card className="flex aspect-video items-center justify-center rounded-md bg-secondary hover:bg-accent">
<Card className="flex aspect-video cursor-auto items-center justify-center rounded-md bg-accent hover:bg-accent/80">
<CardHeader className="items-center">
<CardTitle>{item.name}</CardTitle>
<CardDescription>{item.points} points</CardDescription>
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/vertical-sorting-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function VerticalSortingDemo() {
<SortableDragHandle
variant="outline"
size="icon"
className="size-8 shrink-0 cursor-grab"
className="size-8 shrink-0"
>
<DragHandleDots2Icon
className="size-4"
Expand Down
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Shell } from "@/components/shell"

import { MixedOrientaionDemo } from "./_components/mixed-orientation-demo"
import { MixedSortingDemo } from "./_components/mixed-sorting-demo"
import { VerticalSortingDemo } from "./_components/vertical-sorting-demo"

export default function IndexPage() {
return (
<Shell>
<VerticalSortingDemo />
<MixedOrientaionDemo />
<MixedSortingDemo />
</Shell>
)
}
5 changes: 4 additions & 1 deletion src/components/ui/sortable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ const SortableDragHandle = React.forwardRef<
<Button
ref={composeRefs(ref)}
data-state={isDragging ? "dragging" : undefined}
className={cn(className)}
className={cn(
"cursor-grab data-[state=dragging]:cursor-grabbing",
className
)}
{...attributes}
{...listeners}
{...props}
Expand Down

0 comments on commit e7dee0f

Please sign in to comment.