Skip to content

Commit

Permalink
fix: no-string-literals in the nux package (#32145)
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath authored May 25, 2021
1 parent cb90b0b commit 59a3b77
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/nux/src/components/dot-tip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { withSelect, withDispatch } from '@wordpress/data';
import { useCallback, useRef } from '@wordpress/element';
import { close } from '@wordpress/icons';

/**
* Internal dependencies
*/
import { store as nuxStore } from '../../store';

function onClick( event ) {
// Tips are often nested within buttons. We stop propagation so that clicking
// on a tip doesn't result in the button being clicked.
Expand Down Expand Up @@ -69,15 +74,15 @@ export function DotTip( {

export default compose(
withSelect( ( select, { tipId } ) => {
const { isTipVisible, getAssociatedGuide } = select( 'core/nux' );
const { isTipVisible, getAssociatedGuide } = select( nuxStore );
const associatedGuide = getAssociatedGuide( tipId );
return {
isVisible: isTipVisible( tipId ),
hasNextTip: !! ( associatedGuide && associatedGuide.nextTipId ),
};
} ),
withDispatch( ( dispatch, { tipId } ) => {
const { dismissTip, disableTips } = dispatch( 'core/nux' );
const { dismissTip, disableTips } = dispatch( nuxStore );
return {
onDismiss() {
dismissTip( tipId );
Expand Down

0 comments on commit 59a3b77

Please sign in to comment.