Skip to content

Commit

Permalink
refactor(components): updated prop types and ref usage
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotomoyamada committed Sep 12, 2024
1 parent a6e9988 commit ea49b54
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion components/data-display/category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ const CategoryCarousel: FC<CategoryCarouselProps> = memo(
<Box
position="relative"
w="full"
var={[
vars={[
{
name: "slide-gap",
token: "spaces",
Expand Down
3 changes: 2 additions & 1 deletion components/data-display/color-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {
AspectRatioProps,
BoxProps,
GridProps,
Merge,
MotionProps,
} from "@yamada-ui/react"
import {
Expand All @@ -26,7 +27,7 @@ export type ColorCardProps = AspectRatioProps & {
size?: "md" | "lg"
hex: string
name?: string
linkProps?: Omit<BoxProps, "as"> & Omit<LinkProps, "as">
linkProps?: Merge<BoxProps, Omit<LinkProps, "as">>
motionProps?: MotionProps
gridProps?: GridProps
boxProps?: BoxProps
Expand Down
6 changes: 3 additions & 3 deletions components/forms/palette-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const PaletteMenu = memo(
})
const { t } = useI18n()
const { changePalette } = useApp()
const firstRef = useRef<HTMLDivElement>(null)
const firstRef = useRef<HTMLButtonElement>(null)

const onSelect = useCallback(
({ colors, ...rest }: ColorPalette) => {
Expand Down Expand Up @@ -120,7 +120,7 @@ export const PaletteMenu = memo(
PaletteMenu.displayName = "PaletteMenu"

type PaletteButtonsProps = {
firstRef: RefObject<HTMLDivElement>
firstRef: RefObject<HTMLButtonElement>
onSelect: (palette: ColorPalette) => void
}

Expand Down Expand Up @@ -211,7 +211,7 @@ const PaletteButtons: FC<PaletteButtonsProps> = memo(
PaletteButtons.displayName = "PaletteButtons"

type CreatePaletteProps = {
firstRef: RefObject<HTMLDivElement>
firstRef: RefObject<HTMLButtonElement>
onCloseRef: MutableRefObject<() => void>
}

Expand Down

0 comments on commit ea49b54

Please sign in to comment.