mirror of https://github.com/vector-im/riot-web
Support sending the current theme to widgets
This is a namespaced variable because some clients may not be able to support themes, or may have varying definitions of what "light" means. Widgets are recommended to opt for per-client checks, or accept that some clients may differ. Signed-off-by: Travis Ralston <travpc@gmail.com>pull/21833/head
parent
adaea9ad5b
commit
94ef80c008
|
@ -27,6 +27,7 @@ import ScalarAuthClient from '../../../ScalarAuthClient';
|
||||||
import ScalarMessaging from '../../../ScalarMessaging';
|
import ScalarMessaging from '../../../ScalarMessaging';
|
||||||
import { _t } from '../../../languageHandler';
|
import { _t } from '../../../languageHandler';
|
||||||
import WidgetUtils from '../../../WidgetUtils';
|
import WidgetUtils from '../../../WidgetUtils';
|
||||||
|
import SettingsStore from "../../../settings/SettingsStore";
|
||||||
|
|
||||||
// The maximum number of widgets that can be added in a room
|
// The maximum number of widgets that can be added in a room
|
||||||
const MAX_WIDGETS = 2;
|
const MAX_WIDGETS = 2;
|
||||||
|
@ -131,6 +132,9 @@ module.exports = React.createClass({
|
||||||
'$matrix_room_id': this.props.room.roomId,
|
'$matrix_room_id': this.props.room.roomId,
|
||||||
'$matrix_display_name': user ? user.displayName : this.props.userId,
|
'$matrix_display_name': user ? user.displayName : this.props.userId,
|
||||||
'$matrix_avatar_url': user ? MatrixClientPeg.get().mxcUrlToHttp(user.avatarUrl) : '',
|
'$matrix_avatar_url': user ? MatrixClientPeg.get().mxcUrlToHttp(user.avatarUrl) : '',
|
||||||
|
|
||||||
|
// Namespaced for Riot
|
||||||
|
'$riot_theme': SettingsStore.getValue("theme"),
|
||||||
};
|
};
|
||||||
|
|
||||||
app.id = appId;
|
app.id = appId;
|
||||||
|
|
Loading…
Reference in New Issue