Skip to content

Commit 3d54c13

Browse files
committed
Fix lint errors
1 parent e5861f6 commit 3d54c13

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/app/steps/Blueprints/BlueprintsStep.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { Navigate, SiteGenPreviewCard, Step } from '@/components';
33
import { nfdOnboardingStore } from '@/data/store';
44
import { Container, Spinner, Title } from '@newfold/ui-component-library';
55
import { dispatch, useSelect } from '@wordpress/data';
6-
import { useMemo, useState } from '@wordpress/element';
6+
import { useMemo, useState, useCallback } from '@wordpress/element';
77
import classNames from 'classnames';
8-
import { useLocation, useNavigate } from 'react-router-dom';
8+
import { useNavigate } from 'react-router-dom';
99
/**
1010
* Tabs buttons component.
1111
*
@@ -88,16 +88,19 @@ const BlueprintsStep = () => {
8888
);
8989
};
9090

91-
const handleNext = () => {
91+
const handleNext = useCallback( () => {
9292
navigate( '/blueprints-canvas', {
9393
state: { direction: 'forward' },
9494
} );
95-
};
95+
}, [ navigate ] );
9696

97-
const handleOnPreview = ( slug ) => {
98-
dispatch( nfdOnboardingStore ).setSelectedBlueprint( slug );
99-
handleNext();
100-
};
97+
const handleOnPreview = useCallback(
98+
( slug ) => {
99+
dispatch( nfdOnboardingStore ).setSelectedBlueprint( slug );
100+
handleNext();
101+
},
102+
[ handleNext ]
103+
);
101104

102105
const renderBlueprints = useMemo( () => {
103106
const filteredBlueprints = blueprints.filter( ( blueprint ) => blueprint.type === activeTab );
@@ -149,7 +152,7 @@ const BlueprintsStep = () => {
149152
) ) }
150153
</div>
151154
);
152-
}, [ activeTab, blueprints ] );
155+
}, [ activeTab, blueprints, handleOnPreview ] );
153156

154157
return (
155158
<Step>

0 commit comments

Comments
 (0)