Skip to content

Commit 91d952c

Browse files
committed
Use a global config for sunset related configs
1 parent 85e8dbc commit 91d952c

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

src/configs.js

+6
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,11 @@ configs.isMoz = () => configs.IS_MOZ === "true";
4646
configs.name = () => (configs.isMoz() ? "Spoke" : "Scene Editor");
4747
configs.longName = () => (configs.isMoz() ? "Spoke by Mozilla" : "Scene Editor");
4848
configs.icon = () => (configs.isMoz() ? fixBaseAssetsPath(spokeIcon) : fixBaseAssetsPath(editorIcon));
49+
configs.sunset = {
50+
notification: {
51+
body: "COPY HERE",
52+
link: "https://www.mozilla.org"
53+
}
54+
};
4955

5056
export default configs;

src/ui/EditorContainer.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,11 @@ class EditorContainer extends Component {
126126
}
127127
};
128128

129-
const features = {
130-
show_global_notification: true,
131-
global_notification_body: "COPY HERE",
132-
global_notification_link: "https://mozilla.org"
133-
};
134-
if (features["show_global_notification"]) {
129+
if (configs.sunset.notification) {
135130
this.showDialog(NotificationDialog, {
136131
title: "Admin notification",
137-
message: features["global_notification_body"],
138-
link: features["global_notification_link"],
132+
message: configs.sunset.notification.body,
133+
link: configs.sunset.notification.link,
139134
onClosed: load,
140135
onConfirm: load,
141136
onCancel: null

src/ui/projects/ProjectsPage.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,13 @@ class ProjectsPage extends Component {
127127
});
128128
}
129129

130-
this.setState({
131-
showGlobalNotification: true,
132-
globalNotificationBody: "COPY HERE",
133-
globalNotificationLink: "https://mozilla.org"
134-
});
130+
if (configs.sunset.notification) {
131+
this.setState({
132+
showGlobalNotification: true,
133+
globalNotificationBody: configs.sunset.notification.body,
134+
globalNotificationLink: configs.sunset.notification.link
135+
});
136+
}
135137
}
136138

137139
onDeleteProject = project => {

0 commit comments

Comments
 (0)