Skip to content

Commit

Permalink
feat: use slate_richtext widget instead of plain text
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed May 22, 2023
1 parent aa0ebd2 commit 98983eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/StatisticBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ const View = ({ data, mode }) => {
? { className: 'ui statistic', href: item.href }
: {})}
>
<Statistic.Value className={cx(valueVariation)}>
<Statistic.Value className={cx('slate', valueVariation)}>
{animation.enabled ? (
<CountUp
end={Number(item.value)}
end={Number(serializeText(item.value))}
duration={animation.duration > 0 ? animation.duration : 2}
decimals={animation.decimals > 0 ? animation.decimals : 0}
prefix={animation.prefix || ''}
Expand All @@ -83,11 +83,11 @@ const View = ({ data, mode }) => {
{(props) => <CountUpWrapper {...props} />}
</CountUp>
) : (
item.value
serializeText(item.value)
)}
</Statistic.Value>
<Statistic.Label className={cx(labelVariation)}>
{item.label}
<Statistic.Label className={cx('slate', labelVariation)}>
{serializeText(item.label)}
</Statistic.Label>
<div className={cx('slate text-center', extraVariation)}>
{serializeText(item.info)}
Expand Down
2 changes: 2 additions & 0 deletions src/StatisticBlock/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ const statisticSchema = {
properties: {
value: {
title: 'Value',
widget: 'slate_richtext',
},
label: {
title: 'Label',
widget: 'slate_richtext',
},
info: {
title: 'Extra info',
Expand Down

0 comments on commit 98983eb

Please sign in to comment.