Add close button to introduction banner card.

This commit is contained in:
Gan Eng Chin 2022-12-27 20:47:14 +08:00
parent b6eec1e1bf
commit 82db71c94f
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
2 changed files with 24 additions and 2 deletions

View File

@ -34,6 +34,13 @@
rgba( 196, 152, 217, 0.12 ) 77.75% rgba( 196, 152, 217, 0.12 ) 77.75%
); );
.woocommerce-marketing-introduction-banner-close-button {
position: absolute;
top: $gap-smaller;
right: $gap;
padding: 0;
}
img { img {
display: block; display: block;
width: 100%; width: 100%;

View File

@ -2,8 +2,14 @@
* External dependencies * External dependencies
*/ */
import { __ } from '@wordpress/i18n'; import { __ } from '@wordpress/i18n';
import { Card, Flex, FlexItem, FlexBlock } from '@wordpress/components'; import { Card, Flex, FlexItem, FlexBlock, Button } from '@wordpress/components';
import { Icon, trendingUp, megaphone } from '@wordpress/icons'; import {
Icon,
trendingUp,
megaphone,
closeSmall,
close,
} from '@wordpress/icons';
/** /**
* Internal dependencies * Internal dependencies
@ -73,6 +79,15 @@ export const IntroductionBanner = () => {
</Flex> </Flex>
</div> </div>
<div className="woocommerce-marketing-introduction-banner-illustration"> <div className="woocommerce-marketing-introduction-banner-illustration">
<Button
isSmall
className="woocommerce-marketing-introduction-banner-close-button"
onClick={ () => {
// TODO: dismiss this banner and save it into wp_options.
} }
>
<Icon icon={ closeSmall } />
</Button>
<img <img
src={ illustrationUrl } src={ illustrationUrl }
alt={ __( alt={ __(