Rename callback props in IntroductionBanner to make them clearer.

This commit is contained in:
Gan Eng Chin 2023-03-19 21:10:22 +08:00
parent 6b75b5db38
commit c6a95ae9bf
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
2 changed files with 8 additions and 8 deletions

View File

@ -20,13 +20,13 @@ import illustrationUrl from './illustration.svg';
import illustrationLargeUrl from './illustration-large.svg';
type IntroductionBannerProps = {
onDismiss: () => void;
onAddChannels: () => void;
onDismissClick: () => void;
onAddChannelsClick: () => void;
};
export const IntroductionBanner = ( {
onDismiss,
onAddChannels,
onDismissClick,
onAddChannelsClick,
}: IntroductionBannerProps ) => {
const [ isModalOpen, setModalOpen ] = useState( false );
const { data: dataRegistered } = useRegisteredChannels();
@ -120,7 +120,7 @@ export const IntroductionBanner = ( {
{ showAddChannelsButton && (
<Button
variant="secondary"
onClick={ onAddChannels }
onClick={ onAddChannelsClick }
>
{ __( 'Add channels', 'woocommerce' ) }
</Button>
@ -137,7 +137,7 @@ export const IntroductionBanner = ( {
<Button
isSmall
className="woocommerce-marketing-introduction-banner-close-button"
onClick={ onDismiss }
onClick={ onDismissClick }
>
<Icon icon={ closeSmall } />
</Button>

View File

@ -68,8 +68,8 @@ export const MarketingOverviewMultichannel: React.FC = () => {
<div className="woocommerce-marketing-overview-multichannel">
{ ! isIntroductionBannerDismissed && (
<IntroductionBanner
onDismiss={ dismissIntroductionBanner }
onAddChannels={ () => {
onDismissClick={ dismissIntroductionBanner }
onAddChannelsClick={ () => {
addChannelsButtonRef.current?.focus();
addChannelsButtonRef.current?.click();
addChannelsButtonRef.current?.scrollIntoView();