diff --git a/dashboard/src/main/home/sidebar/ProjectButton.tsx b/dashboard/src/main/home/sidebar/ProjectButton.tsx index a00c31d3bd..d283aa5a41 100644 --- a/dashboard/src/main/home/sidebar/ProjectButton.tsx +++ b/dashboard/src/main/home/sidebar/ProjectButton.tsx @@ -75,6 +75,13 @@ const ProjectButton: React.FC = (props) => { {/* arrow_drop_down */} + {user.isPorterUser && currentProject.simplified_view_enabled && + + (Visible to @porter.run only) + + Porter Apps {currentProject.validate_apply_v2 ? "V2" : "V1"} + + } {/* {renderDropdown()} */} ); @@ -238,6 +245,33 @@ const MainSelector = styled.div` } `; +const PorterAppDetailContainer = styled.div` + display: flex; + flex-direction: column; + background: #ffffff11; + border: 1px solid #ffffff11; + font-size: 14px; + cursor: ${props => (props.projectsLength > 1 || props.isPorterUser) ? "pointer" : "default"}; + padding: 10px; + position: relative; + :hover { + > i { + background: #ffffff22; + } + } + + > i { + margin-left: 7px; + margin-right: 12px; + font-size: 25px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 20px; + background: "#ffffff22" + } +`; + const ProjectName = styled.div` overflow: hidden; white-space: nowrap; diff --git a/dashboard/src/shared/Context.tsx b/dashboard/src/shared/Context.tsx index 30d746d896..adb3ec35e0 100644 --- a/dashboard/src/shared/Context.tsx +++ b/dashboard/src/shared/Context.tsx @@ -116,12 +116,12 @@ class ContextProvider extends Component { currentProject: null, setCurrentProject: (currentProject: ProjectType, callback?: any) => { if (currentProject) { - sessionStorage.setItem("currentProject", currentProject.id.toString()); + localStorage.setItem("currentProject", currentProject.id.toString()); pushQueryParams(this.props, { project_id: currentProject.id.toString(), }); } else { - sessionStorage.removeItem("currentProject"); + localStorage.removeItem("currentProject"); } this.setState({ currentProject }, () => { callback && callback();