From d944daf4354401b67dc5a86fc6369246a4643fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miika=20H=C3=A4nninen?= Date: Mon, 18 Jul 2016 16:56:51 +0300 Subject: [PATCH] Show load spinner on details page when loading --- .../ParticipantDetailsPage/ParticipantDetailsPage.jsx | 3 ++- src/client/stores/ParticipantStore.js | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx index 53d147bd..d51a847b 100644 --- a/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx +++ b/src/client/components/ParticipantDetailsPage/ParticipantDetailsPage.jsx @@ -1,6 +1,7 @@ import React from 'react'; import _ from 'lodash'; import moment from 'moment'; +import Spinner from 'react-spinner'; import { Row, Col, Panel, Button } from 'react-bootstrap'; import { Presence } from '../../components'; import { ParticipantDates } from './ParticipantDates'; @@ -223,7 +224,7 @@ export function getParticipantDetailsPage(participantStore, participantActions) ); } else { return ( -
+ ); } } diff --git a/src/client/stores/ParticipantStore.js b/src/client/stores/ParticipantStore.js index 8611ff27..22465f12 100644 --- a/src/client/stores/ParticipantStore.js +++ b/src/client/stores/ParticipantStore.js @@ -4,6 +4,7 @@ export function getParticipantStore(alt, ParticipantActions, RegistryUserActions this.resetAllData(); this.bindListeners({ + handleFetchParticipantById: ParticipantActions.FETCH_PARTICIPANT_BY_ID, handleUpdateParticipantById: ParticipantActions.UPDATE_PARTICIPANT_BY_ID, handleLoadParticipantList: ParticipantActions.LOAD_PARTICIPANT_LIST, handleParticipantListUpdated: ParticipantActions.PARTICIPANT_LIST_UPDATED, @@ -12,6 +13,10 @@ export function getParticipantStore(alt, ParticipantActions, RegistryUserActions }); } + handleFetchParticipantById() { + this.participantDetails = undefined; + } + handleUpdateParticipantById(participant) { this.participantDetails = participant; } @@ -40,7 +45,7 @@ export function getParticipantStore(alt, ParticipantActions, RegistryUserActions resetAllData() { this.participants = undefined; - this.participantDetails = {}; + this.participantDetails = undefined; this.participantCount = undefined; this.localGroups = [''];