diff --git a/src/components/AddVariable/StyledAddVariable.tsx b/src/components/AddVariable/StyledAddVariable.tsx index f8d31536..01ca06c7 100644 --- a/src/components/AddVariable/StyledAddVariable.tsx +++ b/src/components/AddVariable/StyledAddVariable.tsx @@ -17,6 +17,9 @@ export const NewVariable = styled.div` .add-var-btn { margin-top: 16px; } + button.icon { + padding: 0 10px; + } `; export const NewVariableModal = styled.div` diff --git a/src/components/Button/StyledButton.tsx b/src/components/Button/StyledButton.tsx index d607f7a2..ded0cc14 100644 --- a/src/components/Button/StyledButton.tsx +++ b/src/components/Button/StyledButton.tsx @@ -8,7 +8,10 @@ const sharedStyles = css` border-radius: 3px; color: ${color.white}; cursor: pointer; - &:not(:has(span[role="img"])){ + &:not(:has(span[role='img'])) { + padding: 10px 30px; + } + &:has(span[aria-label='loading']) { padding: 10px 30px; } @media ${bp.tinyUp} { @@ -42,7 +45,7 @@ const sharedStyles = css` &.btn-white { // background-color: ${color.white}; background: transparent; - color: ${color.blue}; + color: ${color.blue}; border: 1px solid ${color.blue}; &.btn--disabled { background-color: ${color.lightestGrey}; @@ -103,7 +106,7 @@ const sharedStyles = css` width: 48px; height: 36px; } - + i.edit { background-image: url('/static/images/edit.svg'); width: 48px; diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 2d953234..268de7cb 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -1,17 +1,28 @@ import React, { FC, MouseEvent, ReactNode } from 'react'; +import { LoadingOutlined } from '@ant-design/icons'; + import { ButtonElem, LinkElement } from './StyledButton'; interface ButtonProps { action: (e: MouseEvent) => void; href?: string; disabled?: boolean; + loading?: boolean; children?: ReactNode; variant?: string; icon?: string; } -const Button: FC = ({ action = undefined, href = undefined, disabled, children, variant, icon }) => { +const Button: FC = ({ + action = undefined, + href = undefined, + disabled, + loading, + children, + variant, + icon, +}) => { const createClassName = () => { let className = `${variant ? `btn-${variant}` : 'btn'} ${disabled ? 'btn--disabled' : ''}`; if (icon) { @@ -34,10 +45,17 @@ const Button: FC = ({ action = undefined, href = undefined, disable {icon && } {children} ) : ( - + {icon && (typeof icon === 'string' ? : icon)} {!icon && children} + + {loading && } ); diff --git a/src/components/DeleteVariable/StyledDeleteVariable.tsx b/src/components/DeleteVariable/StyledDeleteVariable.tsx index 2178a53c..4744b371 100644 --- a/src/components/DeleteVariable/StyledDeleteVariable.tsx +++ b/src/components/DeleteVariable/StyledDeleteVariable.tsx @@ -21,5 +21,11 @@ export const DeleteVariableModal = styled.div` } .deleteConfirmImg span { cursor: pointer; -} + } +`; + +export const DeleteVariableButton = styled.div` + button.icon { + padding: 0 10px; + } `; \ No newline at end of file diff --git a/src/components/DeleteVariable/index.js b/src/components/DeleteVariable/index.js index bb25123d..04cb8639 100644 --- a/src/components/DeleteVariable/index.js +++ b/src/components/DeleteVariable/index.js @@ -4,7 +4,7 @@ import ButtonBootstrap from "react-bootstrap/Button"; import Button from 'components/Button' import { Mutation } from "react-apollo"; import withLogic from "components/AddVariable/logic"; -import {DeleteVariableModal} from "./StyledDeleteVariable"; +import {DeleteVariableModal, DeleteVariableButton} from "./StyledDeleteVariable"; import DeleteEnvVariableMutation from "../../lib/mutation/deleteEnvVariableByName"; /** @@ -27,16 +27,18 @@ export const DeleteVariable = ({ }) => { return ( - { - icon ? - - : - - } + + { + icon ? + + : + + } + * { + display: flex; + align-items: center; + justify-content: center; + } +`; + export const StyledEnvironmentVariableDetails = styled.div` padding: 32px calc((100vw / 16) * 1); width: 100%; @@ -267,10 +278,20 @@ export const StyledVariableTable = styled.div` & .varUpdate { display: flex; padding: 0; - width: 10%; + + button { + background-color: #fff; + } } - & .varDelete { - width: 10%; + & .varActions { + width: 20%; + display: flex; + align-items: center; + + &:last-child { + justify-content: flex-end; + -webkit-box-pack: end; + } } } @@ -308,8 +329,17 @@ export const StyledVariableTable = styled.div` & .varScope { width: 30%; } - & .varDelete { + & .varActions { width: 10%; + display: flex; + + &:last-child { + justify-content: flex-end; + -webkit-box-pack: end; + } + } + & .varDelete { + padding-right: 10px; } &.skeleton { @@ -500,8 +530,14 @@ export const StyledProjectVariableTable = styled.div` & .varName { padding-left: 20px; } - & .varDelete { - width: 5%; + & .varActions { + width: 10%; + display: flex; + + &:last-child { + justify-content: flex-end; + -webkit-box-pack: end; + } } &.skeleton { @@ -526,4 +562,4 @@ export const StyledProjectVariableTable = styled.div` display: none; transition: unset; } -`; +`; \ No newline at end of file diff --git a/src/components/EnvironmentVariables/index.js b/src/components/EnvironmentVariables/index.js index ce5b5041..0ebf909d 100644 --- a/src/components/EnvironmentVariables/index.js +++ b/src/components/EnvironmentVariables/index.js @@ -13,6 +13,7 @@ import { StyledEnvironmentVariableDetails, StyledProjectVariableTable, StyledVariableTable, + VariableActions, } from "./StyledEnvironmentVariables"; import Image from "next/image"; import show from "../../static/images/show.svg"; @@ -267,35 +268,39 @@ const EnvironmentVariables = ({ environment, onVariableAdded, closeModal }) => { )} - -
- -
-
-
- +
+ + +
+ +
+
+
+ +
+
diff --git a/src/components/Organizations/AddGroupToProject/index.js b/src/components/Organizations/AddGroupToProject/index.js index 40807ddc..7ecf19b6 100644 --- a/src/components/Organizations/AddGroupToProject/index.js +++ b/src/components/Organizations/AddGroupToProject/index.js @@ -51,7 +51,7 @@ export const AddGroupToProject = ({ console.error(e)}> - {(addGroupProject, { error, data }) => { + {(addGroupProject, { called, error, data }) => { if (error) { return
{error.message}
; } @@ -86,7 +86,7 @@ export const AddGroupToProject = ({