2021-02-03 09:21:49 +00:00
|
|
|
import React from "react";
|
|
|
|
|
import styled from "styled-components";
|
|
|
|
|
import history from "utils/history";
|
2022-07-11 04:55:28 +00:00
|
|
|
import { Text, TextType } from "design-system";
|
2021-02-03 09:21:49 +00:00
|
|
|
import Icon, { IconSize } from "components/ads/Icon";
|
|
|
|
|
import { Classes } from "components/ads/common";
|
|
|
|
|
import { useLocation } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
const StyledManageUsers = styled("a")`
|
2022-04-26 13:56:07 +00:00
|
|
|
margin-top: 12px;
|
2021-02-03 09:21:49 +00:00
|
|
|
display: inline-flex;
|
|
|
|
|
&&&& {
|
|
|
|
|
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;
|
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};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
2022-06-15 15:37:41 +00:00
|
|
|
function ManageUsers({ workspaceId }: { 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"
|
|
|
|
|
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;
|