Code refactor with CardHeaderTitle component.
This component will be used in other components later.
(cherry picked from commit 995fb7e02d
)
This commit is contained in:
parent
3f56382cf1
commit
0fe028d8c2
|
@ -0,0 +1,6 @@
|
|||
.woocommerce-marketing-card-header-title {
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 28px;
|
||||
letter-spacing: 0;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import './CardHeaderTitle.scss';
|
||||
|
||||
export const CardHeaderTitle: React.FC = ( { children } ) => {
|
||||
return (
|
||||
<div className="woocommerce-marketing-card-header-title">
|
||||
{ children }
|
||||
</div>
|
||||
);
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export { CardHeaderTitle } from './CardHeaderTitle';
|
|
@ -1,9 +1,5 @@
|
|||
.woocommerce-collapsible-card {
|
||||
.components-card-header {
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 28px;
|
||||
letter-spacing: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import classnames from 'classnames';
|
|||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { CardHeaderTitle } from '~/marketing/components';
|
||||
import './CollapsibleCard.scss';
|
||||
|
||||
type CollapsibleCardProps = {
|
||||
|
@ -48,7 +49,7 @@ const CollapsibleCard: React.FC< CollapsibleCardProps > = ( {
|
|||
) }
|
||||
>
|
||||
<CardHeader onClick={ handleClick }>
|
||||
<div>{ header }</div>
|
||||
<CardHeaderTitle>{ header }</CardHeaderTitle>
|
||||
<Button
|
||||
isSmall
|
||||
icon={ collapsed ? chevronDown : chevronUp }
|
||||
|
|
|
@ -5,4 +5,5 @@ export { default as Slider } from './slider';
|
|||
export { default as ReadBlogMessage } from './ReadBlogMessage';
|
||||
export { CollapsibleCard, CardBody, CardDivider } from './CollapsibleCard';
|
||||
export { PluginCardBody } from './PluginCardBody';
|
||||
export { CardHeaderTitle } from './CardHeaderTitle';
|
||||
export { CenteredSpinner } from './CenteredSpinner';
|
||||
|
|
Loading…
Reference in New Issue