Skip to content

Commit 52a3fa0

Browse files
committed
fix(number-box): add deprecation code
1 parent 8d535e1 commit 52a3fa0

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

src/block/number-box/deprecated.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,58 @@ import { withVersion } from '~stackable/higher-order'
55
import {
66
deprecateBlockBackgroundColorOpacity, deprecateTypographyGradientColor, deprecationBackgrounColorOpacity,
77
deprecateBlockShadowColor, deprecateContainerShadowColor, deprecateShadowColor,
8+
BlockDiv, CustomCSS, Typography,
9+
getResponsiveClasses, getTypographyClasses, getAlignmentClasses,
810
} from '~stackable/block-components'
11+
import classnames from 'classnames'
12+
13+
const depecatedSave_3_13_11 = props => {
14+
const {
15+
className,
16+
attributes,
17+
} = props
18+
19+
const responsiveClass = getResponsiveClasses( props.attributes )
20+
const textClasses = getTypographyClasses( props.attributes )
21+
const blockAlignmentClass = getAlignmentClasses( props.attributes )
22+
23+
const blockClassNames = classnames( [
24+
className,
25+
'stk-block-number-box',
26+
responsiveClass,
27+
blockAlignmentClass,
28+
], {
29+
'stk--has-shape': attributes.hasShape,
30+
} )
31+
32+
const textClassNames = classnames( [
33+
'stk-block-number-box__text',
34+
textClasses,
35+
] )
36+
37+
return (
38+
<BlockDiv.Content
39+
className={ blockClassNames }
40+
attributes={ attributes }
41+
version={ props.version }
42+
>
43+
{ attributes.generatedCss && <style>{ attributes.generatedCss }</style> }
44+
<CustomCSS.Content attributes={ attributes } />
45+
<Typography.Content
46+
tagName="div"
47+
attributes={ attributes }
48+
className={ textClassNames }
49+
role="presentation"
50+
/>
51+
</BlockDiv.Content>
52+
)
53+
}
954

1055
const deprecated = [
56+
{
57+
attributes: attributes( '3.13.11' ),
58+
save: depecatedSave_3_13_11,
59+
},
1160
{
1261
// Support the new shadow color.
1362
attributes: attributes( '3.12.11' ),

0 commit comments

Comments
 (0)