Skip to content

Commit

Permalink
fix: link in edit moves page - refs #254291
Browse files Browse the repository at this point in the history
  • Loading branch information
dobri1408 committed Jul 20, 2023
1 parent 1f54dc1 commit 04fd659
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/StatisticBlock/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ const View = ({ data, mode }) => {
>
{items.map((item, index) => {
const href = mode !== 'edit' ? getFieldURL(item.href) : '#';
const StatisticWrapper = href ? UniversalLink : Statistic;
const StatisticWrapper =
href && href !== '#' ? UniversalLink : Statistic;
const valueNodes = serializeToNodes(item.value);
const valueNo = Number(serializeNodesToText(valueNodes));

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

0 comments on commit 04fd659

Please sign in to comment.