Skip to content

Commit

Permalink
Update PolymorphicComponent* references to WordPressComponentProps*
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies committed Sep 2, 2021
1 parent bc95706 commit 9f13cfa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import DropdownMenu from '../../dropdown-menu';
import MenuGroup from '../../menu-group';
import MenuItem from '../../menu-item';
import { useToolsPanelHeader } from './hook';
import { contextConnect, PolymorphicComponentProps } from '../../ui/context';
import { contextConnect, WordPressComponentProps } from '../../ui/context';
import type { ToolsPanelHeaderProps } from '../types';

const ToolsPanelHeader = (
props: PolymorphicComponentProps< ToolsPanelHeaderProps, 'h2' >,
props: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >,
forwardedRef: Ref< any >
) => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { useMemo } from '@wordpress/element';
*/
import * as styles from '../styles';
import { useToolsPanelContext } from '../context';
import { useContextSystem, PolymorphicComponentProps } from '../../ui/context';
import { useContextSystem, WordPressComponentProps } from '../../ui/context';
import { useCx } from '../../utils/hooks/use-cx';
import type { ToolsPanelHeaderProps } from '../types';

export function useToolsPanelHeader(
props: PolymorphicComponentProps< ToolsPanelHeaderProps, 'h2' >
props: WordPressComponentProps< ToolsPanelHeaderProps, 'h2' >
) {
const { className, ...otherProps } = useContextSystem(
props,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import type { Ref } from 'react';
*/
import { useToolsPanelItem } from './hook';
import { View } from '../../view';
import { contextConnect, PolymorphicComponentProps } from '../../ui/context';
import { contextConnect, WordPressComponentProps } from '../../ui/context';
import type { ToolsPanelItemProps } from '../types';

// This wraps controls to be conditionally displayed within a tools panel. It
// prevents props being applied to HTML elements that would make them invalid.
const ToolsPanelItem = (
props: PolymorphicComponentProps< ToolsPanelItemProps, 'div' >,
props: WordPressComponentProps< ToolsPanelItemProps, 'div' >,
forwardedRef: Ref< any >
) => {
const { children, isShown, ...toolsPanelItemProps } = useToolsPanelItem(
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/tools-panel/tools-panel-item/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { useEffect, useMemo } from '@wordpress/element';
*/
import * as styles from '../styles';
import { useToolsPanelContext } from '../context';
import { useContextSystem, PolymorphicComponentProps } from '../../ui/context';
import { useContextSystem, WordPressComponentProps } from '../../ui/context';
import { useCx } from '../../utils/hooks/use-cx';
import type { ToolsPanelItemProps } from '../types';

export function useToolsPanelItem(
props: PolymorphicComponentProps< ToolsPanelItemProps, 'div' >
props: WordPressComponentProps< ToolsPanelItemProps, 'div' >
) {
const {
className,
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/tools-panel/tools-panel/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import ToolsPanelHeader from '../tools-panel-header';
import { ToolsPanelContext } from '../context';
import { useToolsPanel } from './hook';
import { View } from '../../view';
import { contextConnect, PolymorphicComponentProps } from '../../ui/context';
import { contextConnect, WordPressComponentProps } from '../../ui/context';
import type { ToolsPanelProps } from '../types';

const ToolsPanel = (
props: PolymorphicComponentProps< ToolsPanelProps, 'div' >,
props: WordPressComponentProps< ToolsPanelProps, 'div' >,
forwardedRef: Ref< any >
) => {
const {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/tools-panel/tools-panel/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { useEffect, useMemo, useState } from '@wordpress/element';
* Internal dependencies
*/
import * as styles from '../styles';
import { useContextSystem, PolymorphicComponentProps } from '../../ui/context';
import { useContextSystem, WordPressComponentProps } from '../../ui/context';
import { useCx } from '../../utils/hooks/use-cx';
import type { ToolsPanelProps, ToolsPanelItem } from '../types';

export function useToolsPanel(
props: PolymorphicComponentProps< ToolsPanelProps, 'div' >
props: WordPressComponentProps< ToolsPanelProps, 'div' >
) {
const { className, resetAll, ...otherProps } = useContextSystem(
props,
Expand Down

0 comments on commit 9f13cfa

Please sign in to comment.