From a5da252b4dfb51a89e030cf7f00f1ec1f726e0c1 Mon Sep 17 00:00:00 2001 From: Davit Date: Fri, 8 Sep 2023 09:12:20 +0400 Subject: [PATCH 1/3] some changes and improvements alongside bugfixes --- src/components/Button/StyledButton.tsx | 9 +- src/components/Button/index.tsx | 22 +++- .../Organizations/AddGroupToProject/index.js | 5 +- .../AddNotificationToProject/index.js | 7 +- .../Organizations/AddUserToGroup/index.js | 14 ++- .../AddUserToGroupSelect/index.tsx | 7 +- .../AddUserToOrganization/index.js | 14 +-- .../Organizations/GroupMembers/index.js | 38 ++++--- src/components/Organizations/Groups/index.js | 17 +-- src/components/Organizations/Manage/index.js | 18 ++-- .../Organizations/NewGroup/index.js | 25 ++--- .../Organizations/NewProject/index.js | 4 +- .../Organizations/Notifications/index.js | 45 +++++--- .../PaginatedTable/PaginatedTable.tsx | 102 ++++++++++++++---- .../Organizations/PaginatedTable/Styles.tsx | 4 + .../ProjectGroupMembers/index.js | 12 ++- .../ProjectNotifications/index.js | 8 +- .../Organizations/Projects/Styles.tsx | 8 ++ .../Organizations/Projects/index.js | 35 +++--- .../RemoveNotificationConfirm/index.js | 6 +- .../RemoveProjectGroupConfirm/index.js | 7 +- .../Organizations/RemoveUserConfirm/index.js | 6 +- src/components/Organizations/SharedStyles.tsx | 4 + src/components/Organizations/User/index.tsx | 8 +- src/components/Organizations/Users/index.js | 28 +++-- src/pages/organizations/project.js | 10 +- 26 files changed, 321 insertions(+), 142 deletions(-) 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/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 = ({