Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: fix the type definision on the Dashicon component
  • Loading branch information
hideokamoto committed Nov 29, 2022
commit 85fbbe060fcd30a1552934f035ad7991b8e25aa1
8 changes: 2 additions & 6 deletions packages/components/src/dashicon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,16 @@
/**
* Internal dependencies
*/
import type { WordPressComponentProps } from '../ui/context';
import type { DashiconProps } from './types';

/**
* @param {Props} props
* @return {JSX.Element} Element
*/

function Dashicon( {
icon,
className,
size = 20,
style = {},
...extraProps
}: DashiconProps ) {
}: WordPressComponentProps< DashiconProps, 'span', false > ) {
const iconClass = [
'dashicon',
'dashicons',
Expand Down
18 changes: 12 additions & 6 deletions packages/components/src/dashicon/types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
/**
* External dependencies
*/
import type { ComponentPropsWithoutRef } from 'react';

export type DashiconProps = {
/**
* The icon name
*/
icon: IconKey;

/**
* Class name
*/
className?: string;

/**
* Size of the icon
*/
size?: number;
} & ComponentPropsWithoutRef< 'span' >;
};

export type IconKey =
| 'admin-appearance'
Expand Down