UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

17 lines (16 loc) 442 B
export const formatCroppedName = (name, maxLength) => { if (name.length <= maxLength) { return name; } return name.substring(0, maxLength) + '...'; }; export const formatEventLocationGeolocation = (geolocation, isTitle) => { if (!geolocation) { return null; } const parts = geolocation.split('.'); if (isTitle) { return parts[0].trim(); } return parts.slice(1).join(',').trim(); };