Skip to content

Commit

Permalink
Replace the removed getRTL
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Dec 21, 2020
1 parent dbf03d7 commit 8b30eda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions packages/components/src/navigation/back-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ import classnames from 'classnames';
* WordPress dependencies
*/
import { forwardRef } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { __, isRTL } from '@wordpress/i18n';
import { Icon, chevronLeft, chevronRight } from '@wordpress/icons';

/**
* Internal dependencies
*/
import { useNavigationContext } from '../context';
import { MenuBackButtonUI } from '../styles/navigation-styles';
import { getRTL } from '../../utils/rtl';

function NavigationBackButton(
{ backButtonLabel, className, href, onClick, parentMenu },
Expand All @@ -34,12 +33,12 @@ function NavigationBackButton(
onClick( event );
}

const animationDirection = getRTL() ? 'left' : 'right';
const animationDirection = isRTL() ? 'left' : 'right';
if ( parentMenu && ! event.defaultPrevented ) {
setActiveMenu( parentMenu, animationDirection );
}
};
const icon = getRTL() ? chevronRight : chevronLeft;
const icon = isRTL() ? chevronRight : chevronLeft;
return (
<MenuBackButtonUI
className={ classes }
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/toolbar/toolbar-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { useToolbarState, Toolbar } from 'reakit/Toolbar';
* WordPress dependencies
*/
import { forwardRef } from '@wordpress/element';
import { isRTL } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import ToolbarContext from '../toolbar-context';
import { getRTL } from '../utils/rtl';

function ToolbarContainer( { label, ...props }, ref ) {
// https://reakit.io/docs/basic-concepts/#state-hooks
Expand All @@ -21,7 +21,7 @@ function ToolbarContainer( { label, ...props }, ref ) {
const toolbarState = useToolbarState( {
loop: true,
baseId: props.id,
rtl: getRTL(),
rtl: isRTL(),
} );

return (
Expand Down

0 comments on commit 8b30eda

Please sign in to comment.