refactor: rename CellLink to ClickableCell

This commit is contained in:
Sammy Teillet
2023-04-19 12:24:25 +02:00
parent 3696bf2617
commit 5962140656
2 changed files with 9 additions and 9 deletions

View File

@ -8,8 +8,8 @@ type OwnProps = {
children?: React.ReactNode; children?: React.ReactNode;
}; };
function CellLink({ href, children }: OwnProps) { function ClickableCell({ href, children }: OwnProps) {
return <Link to={href}>{children}</Link>; return <Link to={href}>{children}</Link>;
} }
export default CellLink; export default ClickableCell;

View File

@ -12,7 +12,7 @@ import { Company } from '../../interfaces/company.interface';
import { Pipe } from '../../interfaces/pipe.interface'; import { Pipe } from '../../interfaces/pipe.interface';
import { createColumnHelper } from '@tanstack/react-table'; import { createColumnHelper } from '@tanstack/react-table';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import CellLink from '../../components/table/CellLink'; import ClickableCell from '../../components/table/ClickableCell';
import ColumnHead from '../../components/table/ColumnHead'; import ColumnHead from '../../components/table/ColumnHead';
import personPlaceholder from './placeholder.png'; import personPlaceholder from './placeholder.png';
import { parsePhoneNumber, CountryCode } from 'libphonenumber-js'; import { parsePhoneNumber, CountryCode } from 'libphonenumber-js';
@ -113,7 +113,7 @@ const columns = [
id={`person-selected-${props.row.original.email}`} id={`person-selected-${props.row.original.email}`}
name={`person-selected${props.row.original.email}`} name={`person-selected${props.row.original.email}`}
/> />
<CellLink <ClickableCell
name={props.row.original.fullName} name={props.row.original.fullName}
picture={props.row.original.picture} picture={props.row.original.picture}
href="#" href="#"
@ -122,7 +122,7 @@ const columns = [
name={props.row.original.fullName} name={props.row.original.fullName}
picture={props.row.original.picture} picture={props.row.original.picture}
/> />
</CellLink> </ClickableCell>
</HorizontalyAlignedContainer> </HorizontalyAlignedContainer>
), ),
}), }),
@ -137,7 +137,7 @@ const columns = [
columnHelper.accessor('company', { columnHelper.accessor('company', {
header: () => <ColumnHead viewName="Company" viewIcon={faBuildings} />, header: () => <ColumnHead viewName="Company" viewIcon={faBuildings} />,
cell: (props) => ( cell: (props) => (
<CellLink <ClickableCell
name={props.row.original.fullName} name={props.row.original.fullName}
picture={props.row.original.picture} picture={props.row.original.picture}
href="#" href="#"
@ -146,7 +146,7 @@ const columns = [
name={props.row.original.company.name} name={props.row.original.company.name}
picture={`https://www.google.com/s2/favicons?domain=${props.row.original.company.domain}&sz=256`} picture={`https://www.google.com/s2/favicons?domain=${props.row.original.company.domain}&sz=256`}
/> />
</CellLink> </ClickableCell>
), ),
}), }),
columnHelper.accessor('phone', { columnHelper.accessor('phone', {
@ -177,7 +177,7 @@ const columns = [
columnHelper.accessor('pipe', { columnHelper.accessor('pipe', {
header: () => <ColumnHead viewName="Pipe" viewIcon={faRectangleList} />, header: () => <ColumnHead viewName="Pipe" viewIcon={faRectangleList} />,
cell: (props) => ( cell: (props) => (
<CellLink <ClickableCell
name={props.row.original.fullName} name={props.row.original.fullName}
picture={props.row.original.picture} picture={props.row.original.picture}
href="#" href="#"
@ -186,7 +186,7 @@ const columns = [
name={props.row.original.pipe.name} name={props.row.original.pipe.name}
picture={props.row.original.pipe.icon} picture={props.row.original.pipe.icon}
/> />
</CellLink> </ClickableCell>
), ),
}), }),
columnHelper.accessor('city', { columnHelper.accessor('city', {