You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2020/03/15 13:08:24 UTC
[incubator-dolphinscheduler-website] branch master updated: Add
selection prompt to official website menu
This is an automated email from the ASF dual-hosted git repository.
lidongdai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler-website.git
The following commit(s) were added to refs/heads/master by this push:
new 9568ccf Add selection prompt to official website menu
new 343a802 Merge pull request #112 from break60/master
9568ccf is described below
commit 9568ccf29fef7bdcf7851fe94e39bd13cb7cc07b
Author: break60 <79...@qq.com>
AuthorDate: Fri Mar 13 10:01:46 2020 +0800
Add selection prompt to official website menu
---
src/components/header/index.jsx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx
index cd0e993..2404ab6 100755
--- a/src/components/header/index.jsx
+++ b/src/components/header/index.jsx
@@ -57,6 +57,15 @@ class Header extends React.Component {
};
}
componentDidMount() {
+ if(localStorage.getItem("currents") == null) {
+ this.setState({
+ current: 'home'
+ });
+ } else {
+ this.setState({
+ current: localStorage.getItem("currents")
+ });
+ }
window.addEventListener('scroll', () => {
const scrollTop = getScrollTop();
if (scrollTop > 66) {
@@ -80,6 +89,7 @@ class Header extends React.Component {
handleClick = e => {
+ localStorage.setItem("currents",e.key);
this.setState({
current: e.key,
});