Merge pull request #44 from twentyhq/sammy/t-102-i-see-people-chip-designed-with-picture
Sammy/t 102 i see people chip designed with picture
This commit is contained in:
@ -1,42 +0,0 @@
|
||||
import * as React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
type OwnProps = {
|
||||
name: string;
|
||||
picture?: string;
|
||||
href: string;
|
||||
};
|
||||
|
||||
const StyledContainer = styled.span`
|
||||
background-color: ${(props) => props.theme.tertiaryBackground};
|
||||
border-radius: ${(props) => props.theme.spacing(1)};
|
||||
color: ${(props) => props.theme.text80};
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: ${(props) => props.theme.spacing(1)};
|
||||
gap: ${(props) => props.theme.spacing(1)};
|
||||
|
||||
:hover {
|
||||
filter: brightness(95%);
|
||||
}
|
||||
|
||||
img {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
object-fit: cover;
|
||||
}
|
||||
`;
|
||||
|
||||
function CellLink({ name, picture, href }: OwnProps) {
|
||||
return (
|
||||
<Link to={href}>
|
||||
<StyledContainer>
|
||||
{picture && <img src={picture?.toString()} alt="" />}
|
||||
{name}
|
||||
</StyledContainer>
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
||||
export default CellLink;
|
||||
13
front/src/components/table/ClickableCell.tsx
Normal file
13
front/src/components/table/ClickableCell.tsx
Normal file
@ -0,0 +1,13 @@
|
||||
import * as React from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
type OwnProps = {
|
||||
href: string;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
function ClickableCell({ href, children }: OwnProps) {
|
||||
return <Link to={href}>{children}</Link>;
|
||||
}
|
||||
|
||||
export default ClickableCell;
|
||||
Reference in New Issue
Block a user