Make static text work for empty values and numbers

This commit is contained in:
SachaG 2018-11-30 15:59:27 +09:00
parent 48092c171e
commit 84ea6d8789

View file

@ -2,7 +2,7 @@ import React from 'react';
import { registerComponent } from 'meteor/vulcan:core';
const parseUrl = value => {
return value.slice(0,4) === 'http' ? <a href={value} target="_blank">{value}</a> : value;
return value && value.toString().slice(0,4) === 'http' ? <a href={value} target="_blank">{value}</a> : value;
}
const StaticComponent = ({ value, label }) => (