From 875b03468cd2169bbe800a7861262f354d8802ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s?= Date: Fri, 26 Oct 2018 18:13:09 +0200 Subject: [PATCH] Rename SlotFillConsumer to Consumer to be inline with provider name --- packages/components/src/popover/index.js | 6 +++--- packages/components/src/slot-fill/fill.js | 6 +++--- packages/components/src/slot-fill/index.js | 4 ++-- packages/components/src/slot-fill/provider.js | 2 +- packages/components/src/slot-fill/slot.js | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/components/src/popover/index.js b/packages/components/src/popover/index.js index b4b9fb33a2198..7ce7163006a21 100644 --- a/packages/components/src/popover/index.js +++ b/packages/components/src/popover/index.js @@ -19,7 +19,7 @@ import withConstrainedTabbing from '../higher-order/with-constrained-tabbing'; import PopoverDetectOutside from './detect-outside'; import IconButton from '../icon-button'; import ScrollLock from '../scroll-lock'; -import { Slot, Fill, SlotFillConsumer } from '../slot-fill'; +import { Slot, Fill, Consumer } from '../slot-fill'; const FocusManaged = withConstrainedTabbing( withFocusReturn( ( { children } ) => children ) ); @@ -302,7 +302,7 @@ class Popover extends Component { } return ( - + { ( { getSlot } ) => { // In case there is no slot context in which to render, // default to an in-place rendering. @@ -317,7 +317,7 @@ class Popover extends Component { ); } } - + ); } } diff --git a/packages/components/src/slot-fill/fill.js b/packages/components/src/slot-fill/fill.js index 0cb5a5c6fc017..ddb3a61339b44 100644 --- a/packages/components/src/slot-fill/fill.js +++ b/packages/components/src/slot-fill/fill.js @@ -11,12 +11,12 @@ import { Component, createPortal } from '@wordpress/element'; /** * Internal dependencies */ -import { SlotFillConsumer } from './provider'; +import { Consumer } from './provider'; let occurrences = 0; const Fill = ( props ) => ( - + { ( { getSlot, registerFill, unregisterFill } ) => ( ( unregisterFill={ unregisterFill } /> ) } - + ); class FillComponent extends Component { diff --git a/packages/components/src/slot-fill/index.js b/packages/components/src/slot-fill/index.js index 1e7778872cd33..df35989cf959b 100644 --- a/packages/components/src/slot-fill/index.js +++ b/packages/components/src/slot-fill/index.js @@ -3,11 +3,11 @@ */ import Slot from './slot'; import Fill from './fill'; -import Provider, { SlotFillConsumer } from './provider'; +import Provider, { Consumer } from './provider'; export { Slot }; export { Fill }; -export { Provider, SlotFillConsumer }; +export { Provider, Consumer }; export function createSlotFill( name ) { const FillComponent = ( props ) => ; diff --git a/packages/components/src/slot-fill/provider.js b/packages/components/src/slot-fill/provider.js index 6c3de9084d848..df4476fea5b9c 100644 --- a/packages/components/src/slot-fill/provider.js +++ b/packages/components/src/slot-fill/provider.js @@ -109,4 +109,4 @@ class SlotFillProvider extends Component { } export default SlotFillProvider; -export { Consumer as SlotFillConsumer }; +export { Consumer }; diff --git a/packages/components/src/slot-fill/slot.js b/packages/components/src/slot-fill/slot.js index 47be91f20e4f1..139a873d1c668 100644 --- a/packages/components/src/slot-fill/slot.js +++ b/packages/components/src/slot-fill/slot.js @@ -22,10 +22,10 @@ import { /** * Internal dependencies */ -import { SlotFillConsumer } from './provider'; +import { Consumer } from './provider'; const Slot = ( props ) => ( - + { ( { registerSlot, unregisterSlot, getFills } ) => ( ( getFills={ getFills } /> ) } - + ); class SlotComponent extends Component {