Skip to content

Commit

Permalink
fix: use computed href instead of plain href
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Jun 8, 2023
1 parent f707d99 commit 6657284
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/StatisticBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ const View = ({ data, mode }) => {
>
{items.map((item, index) => {
const href = getFieldURL(item.href);
const StatisticWrapper = item.href ? UniversalLink : Statistic;
const StatisticWrapper = href ? UniversalLink : Statistic;
const valueNodes = serializeToNodes(item.value);
const valueNo = Number(serializeNodesToText(valueNodes));

return (
<StatisticWrapper
key={`${index}-${item.label}`}
{...(href ? { className: 'ui statistic', href: item.href } : {})}
{...(href ? { className: 'ui statistic', href } : {})}
>
<Statistic.Value className={cx('slate', valueVariation)}>
{animation.enabled && isNumber(valueNo) && !isNaN(valueNo) ? (
Expand Down

0 comments on commit 6657284

Please sign in to comment.