Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
tedw87 committed May 25, 2023
1 parent 4d5c125 commit df7fcd4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/StatisticBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,12 @@ const View = ({ data, mode }) => {
className={styles.align === 'full' ? 'ui container' : ''}
>
{items.map((item, index) => {
const StatisticWrapper = getFieldURL(item.href)
? UniversalLink
: Statistic;
const href = getFieldURL(item.href);
const StatisticWrapper = href ? UniversalLink : Statistic;
return (
<StatisticWrapper
key={`${index}-${item.label}`}
{...(item.href
? { className: 'ui statistic', href: item.href }
: {})}
{...(href ? { className: 'ui statistic', href: item.href } : {})}
>
<Statistic.Value className={cx(valueVariation)}>
{animation.enabled ? (
Expand Down

0 comments on commit df7fcd4

Please sign in to comment.