Skip to content

Commit

Permalink
Uses existing ANIMATION_DURATION for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonis Lilis committed May 6, 2021
1 parent 4ddd1d9 commit 8613bc7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components/src/color-palette/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import ColorIndicator from '../color-indicator';
import { colorsUtils } from '../mobile/color-settings/utils';

const ANIMATION_DURATION = 200;
const SEGMENTED_CONTROL_ANIMATION_DURATION_DELAY = 200;

let customIndicatorWidth = 0;

Expand Down Expand Up @@ -98,9 +97,10 @@ function ColorPalette( {
const customText = __( 'Custom' );

useEffect( () => {
const delayedScroll = setTimeout( () => {
resetScrollPosition();
}, SEGMENTED_CONTROL_ANIMATION_DURATION_DELAY );
const delayedScroll = setTimeout(
resetScrollPosition,
ANIMATION_DURATION
);
return () => {
clearTimeout( delayedScroll );
};
Expand Down

0 comments on commit 8613bc7

Please sign in to comment.