Skip to content

Commit

Permalink
fix(Select): Renamed SelectOption type DEV-53
Browse files Browse the repository at this point in the history
  • Loading branch information
giubatt committed May 19, 2021
1 parent b4b02e4 commit e8ae33b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { SelectContext } from "./context"
export type SelectValue = string | number | Record<string, unknown>
export type SelectedItems = Array<SelectValue>

export type SelectOption = {
export type SelectOptionType = {
value: SelectValue
label: React.ReactNode
isCustom?: boolean
Expand Down Expand Up @@ -53,7 +53,7 @@ export interface SelectProps {
selectedItems,
}: {
value?: SelectValue
selectedOption?: SelectOption
selectedOption?: SelectOptionType
selectedItems?: SelectedItems
}) => React.ReactNode
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Select/hooks/useSelect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
SelectProps,
SelectedItems,
SelectValue,
SelectOption,
SelectOptionType,
} from "../Select"

export enum SELECT_BULK_ACTIONS {
Expand All @@ -24,7 +24,7 @@ export function useSelect({
onChange,
onSelectedItemsChange,
}: {
options: Array<SelectOption>
options: Array<SelectOptionType>
multi: SelectProps["multi"]
value: SelectProps["value"]
selectedItems: SelectProps["selectedItems"]
Expand Down
6 changes: 3 additions & 3 deletions src/components/Select/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react"
import { toArray } from "../../../helpers/utils"
import { SelectOption } from "../Select"
import { SelectOptionType } from "../Select"

export function getDataFromChildren(nodes: React.ReactNode) {
return (
Expand Down Expand Up @@ -30,9 +30,9 @@ export function getDataFromChildren(nodes: React.ReactNode) {
label,
value: value,
isCustom: isSelectOptionCustom,
} as SelectOption
} as SelectOptionType
})
.filter((data) => data) as SelectOption[]
.filter((data) => data) as SelectOptionType[]
)
}

Expand Down

1 comment on commit e8ae33b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for herzui ready!

✅ Preview
https://herzui-ftavytnnm-micromed.vercel.app

Built with commit e8ae33b.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.