From 6e77cc992e7abb1295d3800bb49d4e7d584d0276 Mon Sep 17 00:00:00 2001 From: Petr Stefan Date: Mon, 20 Nov 2017 19:29:22 +0100 Subject: [PATCH] Fix loading error (but the page is still crappy) --- src/components/widgets/InfoBox/InfoBox.js | 16 ++++++++++------ src/pages/User/User.js | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/widgets/InfoBox/InfoBox.js b/src/components/widgets/InfoBox/InfoBox.js index caf039056..b80676952 100644 --- a/src/components/widgets/InfoBox/InfoBox.js +++ b/src/components/widgets/InfoBox/InfoBox.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { FormattedMessage, FormattedNumber } from 'react-intl'; import Icon from 'react-fontawesome'; import classNames from 'classnames'; +import GroupsName from '../../../components/Groups/GroupsName'; const InfoBox = ({ title, @@ -12,7 +13,7 @@ const InfoBox = ({ progress, description = '', color = 'green' -}) => ( +}) =>
- {title} - {value} + + {title} + + + {value} +
@@ -32,13 +37,12 @@ const InfoBox = ({ {description}
-
-); +
; InfoBox.propTypes = { title: PropTypes.oneOfType([ PropTypes.string, - PropTypes.shape({ type: PropTypes.oneOf([FormattedMessage]) }) + PropTypes.shape({ type: PropTypes.oneOf([FormattedMessage, GroupsName]) }) ]).isRequired, value: PropTypes.oneOfType([ PropTypes.number, diff --git a/src/pages/User/User.js b/src/pages/User/User.js index f8955e3e9..5c62d5e7b 100644 --- a/src/pages/User/User.js +++ b/src/pages/User/User.js @@ -313,7 +313,7 @@ export default withLinks( isAdmin: isSuperadmin, studentOfGroupsIds: studentOfGroupsIdsSelector(userId)(state).toArray(), groupAssignments: groupId => groupsAssignmentsSelector(groupId)(state), - groupStatistics: createGroupsStatsSelector(state), + groupStatistics: groupId => createGroupsStatsSelector(groupId)(state), usersStatistics: statistics => statistics.find(stat => stat.userId === userId) || {}, commonGroups