Skip to content

Commit

Permalink
Rename SlotFillConsumer to Consumer to be inline with provider name
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Oct 31, 2018
1 parent 08dfc36 commit d04fb12
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );

Expand Down Expand Up @@ -302,7 +302,7 @@ class Popover extends Component {
}

return (
<SlotFillConsumer>
<Consumer>
{ ( { getSlot } ) => {
// In case there is no slot context in which to render,
// default to an in-place rendering.
Expand All @@ -317,7 +317,7 @@ class Popover extends Component {
</span>
);
} }
</SlotFillConsumer>
</Consumer>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/slot-fill/fill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => (
<SlotFillConsumer>
<Consumer>
{ ( { getSlot, registerFill, unregisterFill } ) => (
<FillComponent
{ ...props }
Expand All @@ -25,7 +25,7 @@ const Fill = ( props ) => (
unregisterFill={ unregisterFill }
/>
) }
</SlotFillConsumer>
</Consumer>
);

class FillComponent extends Component {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/slot-fill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) => <Fill name={ name } { ...props } />;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/slot-fill/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ class SlotFillProvider extends Component {
}

export default SlotFillProvider;
export { Consumer as SlotFillConsumer };
export { Consumer };
6 changes: 3 additions & 3 deletions packages/components/src/slot-fill/slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {
/**
* Internal dependencies
*/
import { SlotFillConsumer } from './provider';
import { Consumer } from './provider';

const Slot = ( props ) => (
<SlotFillConsumer>
<Consumer>
{ ( { registerSlot, unregisterSlot, getFills } ) => (
<SlotComponent
{ ...props }
Expand All @@ -34,7 +34,7 @@ const Slot = ( props ) => (
getFills={ getFills }
/>
) }
</SlotFillConsumer>
</Consumer>
);

class SlotComponent extends Component {
Expand Down

0 comments on commit d04fb12

Please sign in to comment.