From 93138c769ca2dee3e9766a40385f76a9a8f8657b Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Mon, 20 May 2024 17:19:10 +0200 Subject: [PATCH] Solidifying types --- components/icon-picker/icon-picker.tsx | 6 +----- example/src/blocks/icon-picker-example/edit.tsx | 7 +++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/components/icon-picker/icon-picker.tsx b/components/icon-picker/icon-picker.tsx index 55155695..a181167a 100644 --- a/components/icon-picker/icon-picker.tsx +++ b/components/icon-picker/icon-picker.tsx @@ -53,7 +53,7 @@ const StyledIconButton = styled(Icon)` } `; -export interface IconPickerProps { +export type IconPickerProps = Omit, 'children'> & { /** * Value of the selected icon */ @@ -62,10 +62,6 @@ export interface IconPickerProps { * Change handler for when a new icon is selected */ onChange: (icon: { name: string; iconSet: string }) => void; - /** - * Label of the icon picker - */ - label?: string; } export const IconPicker: React.FC = (props) => { diff --git a/example/src/blocks/icon-picker-example/edit.tsx b/example/src/blocks/icon-picker-example/edit.tsx index 40e3a292..11570b00 100644 --- a/example/src/blocks/icon-picker-example/edit.tsx +++ b/example/src/blocks/icon-picker-example/edit.tsx @@ -18,7 +18,10 @@ export function BlockEdit(props) { const { icon } = attributes; const blockProps = useBlockProps(); - const handleIconSelection = value => setAttributes({icon: { name: value.name, iconSet: value.iconSet }}); + const handleIconSelection = (value: { + name: string; + iconSet: string; + }) => setAttributes({icon: { name: value.name, iconSet: value.iconSet }}); return ( <> @@ -44,4 +47,4 @@ export function BlockEdit(props) { ) -} \ No newline at end of file +}