mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Fix the lint
This commit is contained in:
parent
e2092d23f0
commit
f3d5c56663
5 changed files with 888 additions and 620 deletions
|
@ -1,39 +1,53 @@
|
|||
import data from '../../utils/data';
|
||||
import TitleBadge, { TITLE_BADGE_INFO } from "./TitleBadge";
|
||||
import { __ } from "@wordpress/i18n";
|
||||
import TitleBadge, { TITLE_BADGE_INFO } from './TitleBadge';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
const BadgeBox = ( props ) => {
|
||||
const titleSize = props.titleType && props.titleType === BADGE_BOX_TITLE_BIG ? BADGE_BOX_TITLE_BIG : BADGE_BOX_TITLE_SMALL
|
||||
const titleSize =
|
||||
props.titleType && props.titleType === BADGE_BOX_TITLE_BIG
|
||||
? BADGE_BOX_TITLE_BIG
|
||||
: BADGE_BOX_TITLE_SMALL;
|
||||
|
||||
const titleTextClassName = 'ppcp-r-badge-box__title-text ' + `ppcp-r-badge-box__title-text--${ titleSize }`;
|
||||
const titleTextClassName =
|
||||
'ppcp-r-badge-box__title-text ' +
|
||||
`ppcp-r-badge-box__title-text--${ titleSize }`;
|
||||
|
||||
const titleBaseClassName = 'ppcp-r-badge-box__title';
|
||||
const titleClassName = props.imageBadge ? `${ titleBaseClassName } ppcp-r-badge-box__title--has-image-badge` : titleBaseClassName;
|
||||
const titleBaseClassName = 'ppcp-r-badge-box__title';
|
||||
const titleClassName = props.imageBadge
|
||||
? `${ titleBaseClassName } ppcp-r-badge-box__title--has-image-badge`
|
||||
: titleBaseClassName;
|
||||
return (
|
||||
<div className="ppcp-r-badge-box">
|
||||
<span className={ titleClassName }>
|
||||
<span className={ titleTextClassName }>{props.title}</span>
|
||||
<div className="ppcp-r-badge-box">
|
||||
<span className={ titleClassName }>
|
||||
<span className={ titleTextClassName }>{ props.title }</span>
|
||||
|
||||
{ props.imageBadge && (
|
||||
<span className="ppcp-r-badge-box__title-image-badge">
|
||||
{ props.imageBadge.map( ( badge ) => data().getImage( badge ) ) }
|
||||
</span>
|
||||
) }
|
||||
{ props.imageBadge && (
|
||||
<span className="ppcp-r-badge-box__title-image-badge">
|
||||
{ props.imageBadge.map( ( badge ) =>
|
||||
data().getImage( badge )
|
||||
) }
|
||||
</span>
|
||||
) }
|
||||
|
||||
{ props.textBadge && (
|
||||
<TitleBadge type={ TITLE_BADGE_INFO } text={ props.textBadge }/>
|
||||
) }
|
||||
</span>
|
||||
<div className="ppcp-r-badge-box__description">
|
||||
{ props?.description && (
|
||||
<p
|
||||
className="ppcp-r-badge-box__description"
|
||||
dangerouslySetInnerHTML={ { __html: props.description, } }
|
||||
></p>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
{ props.textBadge && (
|
||||
<TitleBadge
|
||||
type={ TITLE_BADGE_INFO }
|
||||
text={ props.textBadge }
|
||||
/>
|
||||
) }
|
||||
</span>
|
||||
<div className="ppcp-r-badge-box__description">
|
||||
{ props?.description && (
|
||||
<p
|
||||
className="ppcp-r-badge-box__description"
|
||||
dangerouslySetInnerHTML={ {
|
||||
__html: props.description,
|
||||
} }
|
||||
></p>
|
||||
) }
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const BADGE_BOX_TITLE_BIG = 'big';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue