From c882d66b0dd60c5cc289d5cb83116984da76aa22 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 8 Sep 2016 03:02:31 +0100 Subject: [PATCH] make NotificationPanel work --- .../structures/NotificationPanel.js | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/components/structures/NotificationPanel.js b/src/components/structures/NotificationPanel.js index 12bf9750a7..338ca6c1c5 100644 --- a/src/components/structures/NotificationPanel.js +++ b/src/components/structures/NotificationPanel.js @@ -17,18 +17,53 @@ limitations under the License. var React = require('react'); var ReactDOM = require("react-dom"); +var Matrix = require("matrix-js-sdk"); var sdk = require('../../index'); var MatrixClientPeg = require("../../MatrixClientPeg"); var dis = require("../../dispatcher"); /* - * Component which shows the notification timeline using a TimelinePanel + * Component which shows the filtered file using a TimelinePanel */ var NotificationPanel = React.createClass({ displayName: 'NotificationPanel', + propTypes: { + }, + + // this has to be a proper method rather than an unnamed function, + // otherwise react calls it with null on each update. + _gatherTimelinePanelRef: function(r) { + //this.refs.messagePanel = r; + }, + render: function() { // wrap a TimelinePanel with the jump-to-event bits turned off. + var TimelinePanel = sdk.getComponent("structures.TimelinePanel"); + var Loader = sdk.getComponent("elements.Spinner"); + + var timelineSet = MatrixClientPeg.get().getNotifTimelineSet(); + + if (timelineSet) { + return ( + + ); + } + else { + console.error("No notifTimelineSet available!"); + return ( +
+ +
+ ); + } }, });