Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Update the incompatible gateways notice design #8365

Merged
merged 5 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
.wc-blocks-incompatible-extensions-notice__element {
display: flex;
align-items: center;
position: relative;

&::before {
content: "•";
position: absolute;
left: -13px;
font-size: 1.2rem;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
createInterpolateElement,
useEffect,
} from '@wordpress/element';
import { alert } from '@woocommerce/icons';
import { Alert } from '@woocommerce/icons';
import { Icon } from '@wordpress/icons';
/**
* Internal dependencies
Expand Down Expand Up @@ -74,7 +74,7 @@ export function IncompatiblePaymentGatewaysNotice( {
<div className="wc-blocks-incompatible-extensions-notice__content">
<Icon
className="wc-blocks-incompatible-extensions-notice__warning-icon"
icon={ alert }
icon={ <Alert /> }
/>
<div>
<p>{ noticeContent }</p>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export { default as woo } from './library/woo';
export { default as miniCart } from './library/mini-cart';
export { default as miniCartAlt } from './library/mini-cart-alt';
export { default as stacks } from './library/stacks';
export { default as alert } from './library/alert';
export { default as Alert } from './library/alert';
export { default as customerAccount } from './library/customer-account';
export { default as customerAccountStyle } from './library/customer-account-style';
export { default as customerAccountStyleAlt } from './library/customer-account-style-alt';
30 changes: 24 additions & 6 deletions assets/js/icons/library/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
/**
* External dependencies
*/
import { IconProps } from '@wordpress/icons/build-types/icon';
import { SVG } from '@wordpress/primitives';

const cart = (
<SVG xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
interface AlertProps {
status?: 'warning' | 'error' | 'success' | 'info';
props?: IconProps;
}

const statusToColorMap = {
warning: '#F0B849',
error: '#CC1818',
success: '#46B450',
info: '#0073AA',
};

const Alert = ( { status = 'warning', ...props }: AlertProps ) => (
<SVG
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
{ ...props }
>
<path
d="M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z"
stroke="#CC1818"
stroke={ statusToColorMap[ status ] }
strokeWidth="1.5"
/>
<path d="M13 7H11V13H13V7Z" fill="#CC1818" />
<path d="M13 15H11V17H13V15Z" fill="#CC1818" />
<path d="M13 7H11V13H13V7Z" fill={ statusToColorMap[ status ] } />
<path d="M13 15H11V17H13V15Z" fill={ statusToColorMap[ status ] } />
</SVG>
);

export default cart;
export default Alert;