2021-02-03 09:21:49 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
import history from "utils/history";
|
2023-01-23 03:50:47 +00:00
|
|
|
import { Classes, Icon, IconSize, Text, TextType } from "design-system-old";
|
2021-02-03 09:21:49 +00:00
|
|
|
import { useLocation } from "react-router-dom";
|
|
|
|
|
|
2023-04-06 13:03:49 +00:00
|
|
|
const StyledManageUsers = styled("a")<{ isApplicationInvite?: boolean }>`
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
${(props) =>
|
|
|
|
|
props.isApplicationInvite
|
|
|
|
|
? `padding: 12px 0; border-top: 1px solid
|
|
|
|
|
${props.theme.colors.menuBorder};`
|
|
|
|
|
: `padding: 12px 0 0;`}
|
|
|
|
|
|
2021-02-03 09:21:49 +00:00
|
|
|
&&&& {
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.${Classes.TEXT} {
|
|
|
|
|
color: ${(props) => props.theme.colors.modal.manageUser};
|
|
|
|
|
margin-right: ${(props) => props.theme.spaces[1]}px;
|
2022-02-18 09:51:02 +00:00
|
|
|
font-size: 13px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
letter-spacing: 0.6px;
|
2023-04-13 09:42:37 +00:00
|
|
|
line-height: normal;
|
2021-02-03 09:21:49 +00:00
|
|
|
}
|
|
|
|
|
.${Classes.ICON} {
|
|
|
|
|
svg path {
|
|
|
|
|
fill: ${(props) => props.theme.colors.modal.manageUser};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
.${Classes.TEXT} {
|
|
|
|
|
color: ${(props) => props.theme.colors.modal.headerText};
|
|
|
|
|
}
|
|
|
|
|
.${Classes.ICON} {
|
|
|
|
|
svg path {
|
|
|
|
|
fill: ${(props) => props.theme.colors.modal.headerText};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
2023-04-06 13:03:49 +00:00
|
|
|
function ManageUsers({
|
|
|
|
|
isApplicationInvite,
|
|
|
|
|
workspaceId,
|
|
|
|
|
}: {
|
|
|
|
|
isApplicationInvite?: boolean;
|
|
|
|
|
workspaceId: string;
|
|
|
|
|
}) {
|
2021-02-03 09:21:49 +00:00
|
|
|
const currentPath = useLocation().pathname;
|
2022-06-15 15:37:41 +00:00
|
|
|
const pathRegex = /(?:\/workspace\/)\w+(?:\/settings)/;
|
2021-02-03 09:21:49 +00:00
|
|
|
|
|
|
|
|
return !pathRegex.test(currentPath) ? (
|
|
|
|
|
<StyledManageUsers
|
|
|
|
|
className="manageUsers"
|
2023-04-06 13:03:49 +00:00
|
|
|
isApplicationInvite={isApplicationInvite}
|
2021-02-03 09:21:49 +00:00
|
|
|
onClick={() => {
|
2022-06-15 15:37:41 +00:00
|
|
|
history.push(`/workspace/${workspaceId}/settings/members`);
|
2021-02-03 09:21:49 +00:00
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Text type={TextType.H6}>MANAGE USERS</Text>
|
2022-02-18 09:51:02 +00:00
|
|
|
<Icon name="manage" size={IconSize.XS} />
|
2021-02-03 09:21:49 +00:00
|
|
|
</StyledManageUsers>
|
|
|
|
|
) : null;
|
2021-04-28 10:28:39 +00:00
|
|
|
}
|
2021-02-03 09:21:49 +00:00
|
|
|
export default ManageUsers;
|