mirror of
https://github.com/lingble/twenty.git
synced 2025-10-30 12:22:29 +00:00
refactor: create Checkbox component
This commit is contained in:
23
front/src/components/form/Checkbox.tsx
Normal file
23
front/src/components/form/Checkbox.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
type OwnProps = {
|
||||
name: string;
|
||||
id: string;
|
||||
};
|
||||
|
||||
const StyledContainer = styled.span`
|
||||
input[type='checkbox'] {
|
||||
accent-color: #1111b7;
|
||||
}
|
||||
`;
|
||||
|
||||
function Checkbox({ name, id }: OwnProps) {
|
||||
return (
|
||||
<StyledContainer>
|
||||
<input type="checkbox" id={id} name={name}></input>
|
||||
</StyledContainer>
|
||||
);
|
||||
}
|
||||
|
||||
export default Checkbox;
|
||||
@@ -16,6 +16,7 @@ import CellLink from '../../components/table/CellLink';
|
||||
import ColumnHead from '../../components/table/ColumnHead';
|
||||
import personPlaceholder from './placeholder.png';
|
||||
import { parsePhoneNumber, CountryCode } from 'libphonenumber-js';
|
||||
import Checkbox from '../../components/form/Checkbox';
|
||||
|
||||
type Person = {
|
||||
fullName: string;
|
||||
@@ -106,11 +107,10 @@ const columns = [
|
||||
header: () => <ColumnHead viewName="People" viewIcon={faUser} />,
|
||||
cell: (props) => (
|
||||
<>
|
||||
<input
|
||||
type="checkbox"
|
||||
<Checkbox
|
||||
id={`person-selected-${props.row.original.email}`}
|
||||
name={`person-selected${props.row.original.email}`}
|
||||
></input>
|
||||
/>
|
||||
<CellLink
|
||||
name={props.row.original.fullName}
|
||||
picture={props.row.original.picture}
|
||||
|
||||
Reference in New Issue
Block a user