Skip to content

Commit da80e3b

Browse files
Added message for oauth upgrade
1 parent 225fd12 commit da80e3b

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

ui/app/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Home from "./components/Home";
2525
import NavBar from "./components/NavBar";
2626
import Stats from "./components/Stats";
2727
import Banner from "./components/Banner";
28+
import Message from "./components/Message.js";
2829
import { requireAuth } from "./components/utils";
2930

3031
import "@blueprintjs/core/dist/blueprint.css";
@@ -49,6 +50,7 @@ export default ({ history }) => {
4950
<div style={{ height: "100%" }}>
5051
<Auth />
5152
<NavBar />
53+
<Message/>
5254
<Banner />
5355
<Switch>
5456
<Route path="/authorized" component={Authorized} />

ui/app/components/Message.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import React, { Component } from "react";
2+
3+
class Message extends Component {
4+
constructor(props) {
5+
super(props);
6+
// Use "messageClosed" as the key to check if the message was previously closed
7+
const messageClosed = localStorage.getItem("messageClosed") === "true";
8+
this.state = {
9+
isVisible: !messageClosed,
10+
};
11+
}
12+
13+
handleClose = () => {
14+
this.setState({ isVisible: false });
15+
// When closing, set "messageClosed" in localStorage to "true"
16+
localStorage.setItem("messageClosed", "true");
17+
};
18+
19+
render() {
20+
if (!this.state.isVisible) {
21+
return null;
22+
}
23+
return (
24+
<div className="banner" style={{ backgroundColor: "#ffcc00", color: "black", textAlign: "center", padding: "10px", position: "relative" }}>
25+
<p>We have recently upgraded from OAuth 1.0 to 2.0. Please Logout and Login again before use!</p>
26+
<button onClick={this.handleClose} style={{ position: "absolute", top: "5px", right: "10px", cursor: "pointer" }}>
27+
×
28+
</button>
29+
</div>
30+
);
31+
}
32+
}
33+
34+
export default Message;

0 commit comments

Comments
 (0)