Skip to content

Commit

Permalink
Fix loading error (but the page is still crappy)
Browse files Browse the repository at this point in the history
  • Loading branch information
SemaiCZE committed Nov 20, 2017
1 parent 880b5f0 commit 6e77cc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions src/components/widgets/InfoBox/InfoBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -12,7 +13,7 @@ const InfoBox = ({
progress,
description = '',
color = 'green'
}) => (
}) =>
<div
className={classNames({
'info-box': true,
Expand All @@ -23,22 +24,25 @@ const InfoBox = ({
<Icon name={icon} spin={spin} />
</span>
<div className="info-box-content">
<span className="info-box-text">{title}</span>
<span className="info-box-number">{value}</span>
<span className="info-box-text">
{title}
</span>
<span className="info-box-number">
{value}
</span>
<div className="progress">
<div className="progress-bar" style={{ width: `${progress * 100}%` }} />
</div>
<span className="progress-description">
{description}
</span>
</div>
</div>
);
</div>;

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,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/User/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e77cc9

Please sign in to comment.