Skip to content

Commit

Permalink
fix(number-box): add deprecation code
Browse files Browse the repository at this point in the history
  • Loading branch information
Arukuen committed Jan 15, 2025
1 parent 8d535e1 commit 52a3fa0
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/block/number-box/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,58 @@ import { withVersion } from '~stackable/higher-order'
import {
deprecateBlockBackgroundColorOpacity, deprecateTypographyGradientColor, deprecationBackgrounColorOpacity,
deprecateBlockShadowColor, deprecateContainerShadowColor, deprecateShadowColor,
BlockDiv, CustomCSS, Typography,
getResponsiveClasses, getTypographyClasses, getAlignmentClasses,
} from '~stackable/block-components'
import classnames from 'classnames'

const depecatedSave_3_13_11 = props => {
const {
className,
attributes,
} = props

const responsiveClass = getResponsiveClasses( props.attributes )
const textClasses = getTypographyClasses( props.attributes )
const blockAlignmentClass = getAlignmentClasses( props.attributes )

const blockClassNames = classnames( [
className,
'stk-block-number-box',
responsiveClass,
blockAlignmentClass,
], {
'stk--has-shape': attributes.hasShape,
} )

const textClassNames = classnames( [
'stk-block-number-box__text',
textClasses,
] )

return (
<BlockDiv.Content
className={ blockClassNames }
attributes={ attributes }
version={ props.version }
>
{ attributes.generatedCss && <style>{ attributes.generatedCss }</style> }
<CustomCSS.Content attributes={ attributes } />
<Typography.Content
tagName="div"
attributes={ attributes }
className={ textClassNames }
role="presentation"
/>
</BlockDiv.Content>
)
}

const deprecated = [
{
attributes: attributes( '3.13.11' ),
save: depecatedSave_3_13_11,
},
{
// Support the new shadow color.
attributes: attributes( '3.12.11' ),
Expand Down

0 comments on commit 52a3fa0

Please sign in to comment.