PromucFlow_constructor/app/client/src/pages/organization/ManageUsers.tsx
Satish Gandham 7f7f6f666b
Development: Add eslint rules for code consistency (#4083)
Co-authored-by: Satish Gandham <satish@appsmith.com>
Co-authored-by: Abhinav Jha <abhinav@appsmith.com>
2021-04-28 15:58:39 +05:30

55 lines
1.4 KiB
TypeScript

import React from "react";
import styled from "styled-components";
import history from "utils/history";
import Text, { TextType } from "components/ads/Text";
import Icon, { IconSize } from "components/ads/Icon";
import { Classes } from "components/ads/common";
import { useLocation } from "react-router-dom";
const StyledManageUsers = styled("a")`
margin-top: 20px;
display: inline-flex;
&&&& {
text-decoration: none;
}
.${Classes.TEXT} {
color: ${(props) => props.theme.colors.modal.manageUser};
margin-right: ${(props) => props.theme.spaces[1]}px;
}
.${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};
}
}
}
`;
function ManageUsers({ orgId }: { orgId: string }) {
const currentPath = useLocation().pathname;
const pathRegex = /(?:\/org\/)\w+(?:\/settings)/;
return !pathRegex.test(currentPath) ? (
<StyledManageUsers
className="manageUsers"
onClick={() => {
history.push(`/org/${orgId}/settings/members`);
}}
>
<Text type={TextType.H6}>MANAGE USERS</Text>
<Icon name="manage" size={IconSize.XXS} />
</StyledManageUsers>
) : null;
}
export default ManageUsers;