mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 17:07:07 +00:00
stream bar: Convert module to typescript.
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
import * as stream_data from "./stream_data";
|
import * as stream_data from "./stream_data";
|
||||||
|
import {DEFAULT_COLOR} from "./stream_data";
|
||||||
|
|
||||||
// In an attempt to decrease mixing, set stream bar
|
// In an attempt to decrease mixing, set stream bar
|
||||||
// color look like the stream being used.
|
// color look like the stream being used.
|
||||||
// (In particular, if there's a color associated with it,
|
// (In particular, if there's a color associated with it,
|
||||||
// have that color be reflected here too.)
|
// have that color be reflected here too.)
|
||||||
export function decorate(stream_id, $element) {
|
export function decorate(stream_id: number | undefined, $element: JQuery): void {
|
||||||
const color = stream_data.get_color(stream_id);
|
const color = stream_id === undefined ? DEFAULT_COLOR : stream_data.get_color(stream_id);
|
||||||
$element.css("background-color", color);
|
$element.css("background-color", color);
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export type InviteStreamData = {
|
|||||||
default_stream: boolean;
|
default_stream: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_COLOR = "#c2c2c2";
|
export const DEFAULT_COLOR = "#c2c2c2";
|
||||||
|
|
||||||
// Expose get_subscriber_count for our automated puppeteer tests.
|
// Expose get_subscriber_count for our automated puppeteer tests.
|
||||||
export const get_subscriber_count = peer_data.get_subscriber_count;
|
export const get_subscriber_count = peer_data.get_subscriber_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user