Skip to content

Commit

Permalink
Fix Merge Conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod committed Jan 9, 2024
1 parent 8c991e6 commit c69a9dd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import classNames from 'classnames';
import { __ } from '@wordpress/i18n';
import { useRef, useEffect, useState, memo } from '@wordpress/element';

const TextInputSiteGen = ( {
Expand All @@ -17,7 +18,7 @@ const TextInputSiteGen = ( {
textareaRef.current.style.height = height;
const scrollHeight = textareaRef.current.scrollHeight;
textareaRef.current.style.height = scrollHeight + 'px';
const analysisResult = calculateAnalysisScore( customerInput );
const analysisResult = calculateAnalysisScore( customerInput?.trim() );
setAnalysisScore( analysisResult );
setIsValidInput( analysisResult >= 2 );
}, [ customerInput ] );

Check warning on line 24 in src/OnboardingSPA/components/TextInput/TextInputSiteGen/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'height' and 'setIsValidInput'. Either include them or remove the dependency array. If 'setIsValidInput' changes too often, find the parent component that defines it and wrap that definition in useCallback
Expand Down Expand Up @@ -87,7 +88,7 @@ const TextInputSiteGen = ( {
{ customerInput ? (
<div className={ 'nfd-sg-input-box__info' }>
<div className={ 'nfd-sg-input-box__info-text' }>
Detail
{ __( 'Detail', 'wp-module-onboarding' ) }
</div>
{ renderDetails() }
</div>
Expand Down
12 changes: 9 additions & 3 deletions src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,21 @@ const SiteGenSiteDetails = () => {
setDrawerActiveView( false );

if ( currentData.sitegen.siteDetails?.prompt !== '' ) {
setIsValidInput( true );
setFooterNavEnabled( true );
return setCustomerInput( currentData.sitegen.siteDetails.prompt );
}
setFooterNavEnabled( false );
}, [] );

Check warning on line 48 in src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'currentData.sitegen.siteDetails.prompt', 'setDrawerActiveView', 'setFooterNavEnabled', 'setHeaderActiveView', 'setIsHeaderEnabled', and 'setSidebarActiveView'. Either include them or remove the dependency array

useEffect( () => {
setFooterNavEnabled( isValidInput );
currentData.sitegen.siteDetails.prompt = customerInput?.trim();
setCurrentOnboardingData( currentData );
if ( customerInput?.trim() === '' ) {
setFooterNavEnabled( false );
} else {
setFooterNavEnabled( isValidInput );
currentData.sitegen.siteDetails.prompt = customerInput?.trim();
setCurrentOnboardingData( currentData );
}
}, [ customerInput ] );

Check warning on line 58 in src/OnboardingSPA/steps/SiteGen/SiteDetails/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'currentData', 'isValidInput', 'setCurrentOnboardingData', and 'setFooterNavEnabled'. Either include them or remove the dependency array

return (
Expand Down

0 comments on commit c69a9dd

Please sign in to comment.