Skip to content

Commit

Permalink
Update function name to not be opinionated
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriel Caires <[email protected]>
  • Loading branch information
renatho and gabrielcaires committed Oct 23, 2024
1 parent 970ce0c commit 4c81714
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const SiteMigrationHowToMigrate: FC< Props > = ( props ) => {
urlData
);

const { onOptionClick } = usePendingMigrationStatus( { onSubmit: navigation.submit } );
const { setPendingMigration } = usePendingMigrationStatus( { onSubmit: navigation.submit } );

const hostingProviderSlug = hostingProviderData?.hosting_provider?.slug;
const shouldDisplayHostIdentificationMessage =
Expand All @@ -78,7 +78,7 @@ const SiteMigrationHowToMigrate: FC< Props > = ( props ) => {
key={ i }
title={ option.label }
text={ option.description }
onClick={ () => onOptionClick( option.value ) }
onClick={ () => setPendingMigration( option.value ) }
/>
) ) }
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const usePendingMigrationStatus = ( { onSubmit }: PendingMigrationStatusProps )
}
}, [ siteId, updateMigrationStatus ] );

const onOptionClick = ( how: string ) => {
const setPendingMigration = ( how: string ) => {
const destination = canInstallPlugins ? 'migrate' : 'upgrade';
if ( siteId ) {
const parsedHow = how === HOW_TO_MIGRATE_OPTIONS.DO_IT_MYSELF ? 'diy' : how;
Expand All @@ -39,7 +39,7 @@ const usePendingMigrationStatus = ( { onSubmit }: PendingMigrationStatusProps )
}
};

return { onOptionClick };
return { setPendingMigration };
};

export default usePendingMigrationStatus;

0 comments on commit 4c81714

Please sign in to comment.