Skip to content

Commit

Permalink
patch: correct calendar direction buttons (#1310)
Browse files Browse the repository at this point in the history
Co-authored-by: Davis SHYAKA <[email protected]>
  • Loading branch information
shyakadavis and shyakadavis authored Oct 11, 2024
1 parent 2893f33 commit 2a36dde
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ChevronRight class="size-4" />
{/snippet}

<CalendarPrimitive.PrevButton
<CalendarPrimitive.NextButton
bind:ref
class={cn(
buttonVariants({ variant: "outline" }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
let {
ref = $bindable(null),
class: className,
child: childProp,
children: childrenProp,
children,
...restProps
}: CalendarPrimitive.PrevButtonProps = $props();
</script>
Expand All @@ -17,26 +16,13 @@
<ChevronLeft class="size-4" />
{/snippet}

{#if childProp}
<CalendarPrimitive.NextButton
bind:ref
class={cn(
buttonVariants({ variant: "outline" }),
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
className
)}
{...restProps}
child={childProp}
/>
{:else}
<CalendarPrimitive.NextButton
bind:ref
class={cn(
buttonVariants({ variant: "outline" }),
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
className
)}
{...restProps}
children={childrenProp || Fallback}
/>
{/if}
<CalendarPrimitive.PrevButton
bind:ref
class={cn(
buttonVariants({ variant: "outline" }),
"size-7 bg-transparent p-0 opacity-50 hover:opacity-100",
className
)}
{...restProps}
children={children || Fallback}
/>

0 comments on commit 2a36dde

Please sign in to comment.