Static widget config per room
This commit is contained in:
@@ -21,18 +21,9 @@ const AddAppDialog = require('../dialogs/AddAppDialog');
|
|||||||
const AppTile = require('../elements/AppTile');
|
const AppTile = require('../elements/AppTile');
|
||||||
const Modal = require("../../../Modal");
|
const Modal = require("../../../Modal");
|
||||||
|
|
||||||
module.exports = React.createClass({
|
// FIXME -- Hard coded widget config
|
||||||
displayName: 'AppsDrawer',
|
const roomWidgetConfig = {
|
||||||
|
'!IAkkwswSrOSzPRWksX:matrix.org': [
|
||||||
propTypes: {
|
|
||||||
},
|
|
||||||
|
|
||||||
componentDidMount: function() {
|
|
||||||
},
|
|
||||||
|
|
||||||
getInitialState: function() {
|
|
||||||
return {
|
|
||||||
apps: [
|
|
||||||
{
|
{
|
||||||
id: "youtube",
|
id: "youtube",
|
||||||
url: "https://www.youtube.com/embed/ZJy1ajvMU1k?controls=0&enablejsapi=1&iv_load_policy=3&modestbranding=1&playsinline=1",
|
url: "https://www.youtube.com/embed/ZJy1ajvMU1k?controls=0&enablejsapi=1&iv_load_policy=3&modestbranding=1&playsinline=1",
|
||||||
@@ -45,6 +36,27 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
module.exports = React.createClass({
|
||||||
|
displayName: 'AppsDrawer',
|
||||||
|
|
||||||
|
propTypes: {
|
||||||
|
},
|
||||||
|
|
||||||
|
componentDidMount: function() {
|
||||||
|
},
|
||||||
|
|
||||||
|
getInitialState: function() {
|
||||||
|
for (const key in roomWidgetConfig) {
|
||||||
|
if(key == this.props.room.roomId) {
|
||||||
|
return {
|
||||||
|
apps: roomWidgetConfig[key],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
apps: [],
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
onClickAddWidget: function() {
|
onClickAddWidget: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user