|
|
@@ -0,0 +1,175 @@
|
|
|
+import React, { Component } from "react";
|
|
|
+import styled from "styled-components";
|
|
|
+import close from "assets/close.png";
|
|
|
+
|
|
|
+import api from "shared/api";
|
|
|
+import { Context } from "shared/Context";
|
|
|
+
|
|
|
+import SaveButton from "components/SaveButton";
|
|
|
+import InputRow from "components/values-form/InputRow";
|
|
|
+
|
|
|
+type PropsType = {};
|
|
|
+type StateType = {
|
|
|
+ namespaceName: string;
|
|
|
+ status: string | null;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+export default class NamespaceModal extends Component<PropsType, StateType> {
|
|
|
+ state = {
|
|
|
+ namespaceName: "",
|
|
|
+ status: null as string | null,
|
|
|
+ }
|
|
|
+
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <StyledUpdateProjectModal>
|
|
|
+ <CloseButton
|
|
|
+ onClick={() => {
|
|
|
+ this.context.setCurrentModal(null, null);
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <CloseButtonImg src={close} />
|
|
|
+ </CloseButton>
|
|
|
+
|
|
|
+ <ModalTitle>Add Namespace</ModalTitle>
|
|
|
+ <Subtitle>Name</Subtitle>
|
|
|
+
|
|
|
+ <InputWrapper>
|
|
|
+ <DashboardIcon>
|
|
|
+ <i className="material-icons">space_dashboard</i>
|
|
|
+ </DashboardIcon>
|
|
|
+ <InputRow
|
|
|
+ type="string"
|
|
|
+ value={this.state.namespaceName}
|
|
|
+ setValue={(x: string) => this.setState({ namespaceName: x })}
|
|
|
+ placeholder="ex: porter-workers"
|
|
|
+ width="480px"
|
|
|
+ />
|
|
|
+ </InputWrapper>
|
|
|
+
|
|
|
+ {/* <Help
|
|
|
+ href="https://docs.getporter.dev/docs/deleting-dangling-resources"
|
|
|
+ target="_blank"
|
|
|
+ >
|
|
|
+ <i className="material-icons">help_outline</i> Help
|
|
|
+ </Help> */}
|
|
|
+
|
|
|
+ <SaveButton
|
|
|
+ text="Create Namespace"
|
|
|
+ color="#616FEEcc"
|
|
|
+ onClick={() => console.log('ok')}
|
|
|
+ status={this.state.status}
|
|
|
+ />
|
|
|
+ </StyledUpdateProjectModal>
|
|
|
+ );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+NamespaceModal.contextType = Context;
|
|
|
+
|
|
|
+const Help = styled.a`
|
|
|
+ position: absolute;
|
|
|
+ left: 31px;
|
|
|
+ bottom: 35px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #ffffff55;
|
|
|
+ font-size: 13px;
|
|
|
+ :hover {
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+
|
|
|
+ > i {
|
|
|
+ margin-right: 9px;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+`;
|
|
|
+
|
|
|
+const DashboardIcon = styled.div`
|
|
|
+ width: 32px;
|
|
|
+ margin-top: 6px;
|
|
|
+ min-width: 25px;
|
|
|
+ height: 32px;
|
|
|
+ border-radius: 3px;
|
|
|
+ overflow: hidden;
|
|
|
+ position: relative;
|
|
|
+ margin-right: 15px;
|
|
|
+ font-weight: 400;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background: #676c7c;
|
|
|
+ border: 2px solid #8e94aa;
|
|
|
+ color: white;
|
|
|
+
|
|
|
+ > i {
|
|
|
+ font-size: 17px;
|
|
|
+ }
|
|
|
+`;
|
|
|
+
|
|
|
+const InputWrapper = styled.div`
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+`;
|
|
|
+
|
|
|
+const Subtitle = styled.div`
|
|
|
+ margin-top: 23px;
|
|
|
+ font-family: "Work Sans", sans-serif;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #aaaabb;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ margin-bottom: -10px;
|
|
|
+`;
|
|
|
+
|
|
|
+const ModalTitle = styled.div`
|
|
|
+ margin: 0px 0px 13px;
|
|
|
+ display: flex;
|
|
|
+ flex: 1;
|
|
|
+ font-family: "Assistant";
|
|
|
+ font-size: 18px;
|
|
|
+ color: #ffffff;
|
|
|
+ user-select: none;
|
|
|
+ font-weight: 700;
|
|
|
+ align-items: center;
|
|
|
+ position: relative;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+`;
|
|
|
+
|
|
|
+const CloseButton = styled.div`
|
|
|
+ position: absolute;
|
|
|
+ display: block;
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ padding: 13px 0 12px 0;
|
|
|
+ z-index: 1;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 50%;
|
|
|
+ right: 15px;
|
|
|
+ top: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ :hover {
|
|
|
+ background-color: #ffffff11;
|
|
|
+ }
|
|
|
+`;
|
|
|
+
|
|
|
+const CloseButtonImg = styled.img`
|
|
|
+ width: 14px;
|
|
|
+ margin: 0 auto;
|
|
|
+`;
|
|
|
+
|
|
|
+const StyledUpdateProjectModal = styled.div`
|
|
|
+ width: 100%;
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ height: 100%;
|
|
|
+ padding: 25px 30px;
|
|
|
+ overflow: hidden;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #202227;
|
|
|
+`;
|