Browse Source

version tag fe

jusrhee 4 years ago
parent
commit
8869316fd5
1 changed files with 12 additions and 0 deletions
  1. 12 0
      dashboard/src/main/home/navbar/Navbar.tsx

+ 12 - 0
dashboard/src/main/home/navbar/Navbar.tsx

@@ -24,6 +24,7 @@ class Navbar extends Component<PropsType, StateType> {
 
 
   renderSettingsDropdown = () => {
   renderSettingsDropdown = () => {
     if (this.state.showDropdown) {
     if (this.state.showDropdown) {
+      let version = this.context?.capabilities?.version;
       return (
       return (
         <>
         <>
           <CloseOverlay
           <CloseOverlay
@@ -45,6 +46,7 @@ class Navbar extends Component<PropsType, StateType> {
             </UserDropdownButton>
             </UserDropdownButton>
             <UserDropdownButton onClick={this.props.logOut}>
             <UserDropdownButton onClick={this.props.logOut}>
               <i className="material-icons">keyboard_return</i> Log Out
               <i className="material-icons">keyboard_return</i> Log Out
+              {version !== "production" && <VersionTag>{version}</VersionTag>}
             </UserDropdownButton>
             </UserDropdownButton>
           </Dropdown>
           </Dropdown>
         </>
         </>
@@ -53,6 +55,7 @@ class Navbar extends Component<PropsType, StateType> {
   };
   };
 
 
   renderFeedbackButton = () => {
   renderFeedbackButton = () => {
+    console.log("hi", this.context?.capabilities)
     if (this.context?.capabilities?.provisioner) {
     if (this.context?.capabilities?.provisioner) {
       return <Feedback currentView={this.props.currentView} />;
       return <Feedback currentView={this.props.currentView} />;
     }
     }
@@ -80,6 +83,14 @@ Navbar.contextType = Context;
 
 
 export default withAuth(Navbar);
 export default withAuth(Navbar);
 
 
+const VersionTag = styled.div`
+  position: absolute;
+  right: 10px;
+  top: 15px;
+  color: #ffffff22;
+  font-weight: 400;
+`;
+
 const SettingsIcon = styled.div`
 const SettingsIcon = styled.div`
   > i {
   > i {
     background: none;
     background: none;
@@ -119,6 +130,7 @@ const CloseOverlay = styled.div`
 
 
 const UserDropdownButton = styled.button`
 const UserDropdownButton = styled.button`
   padding: 13px;
   padding: 13px;
+  position: relative;
   height: 40px;
   height: 40px;
   font-size: 13px;
   font-size: 13px;
   font-weight: 500;
   font-weight: 500;