mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-18 09:02:11 +03:00
Fix table mock mode (#1007)
This commit is contained in:
parent
58e5d24261
commit
a90cbac5e6
@ -0,0 +1,11 @@
|
|||||||
|
import { companyViewFields } from '@/companies/constants/companyViewFields';
|
||||||
|
import { useSetEntityTableData } from '@/ui/table/hooks/useSetEntityTableData';
|
||||||
|
|
||||||
|
import { mockedCompaniesData } from './companies-mock-data';
|
||||||
|
export function CompanyTableMockData() {
|
||||||
|
const setEntityTableData = useSetEntityTableData();
|
||||||
|
|
||||||
|
setEntityTableData(mockedCompaniesData, companyViewFields, []);
|
||||||
|
|
||||||
|
return <></>;
|
||||||
|
}
|
@ -3,9 +3,12 @@ import { EntityTable } from '@/ui/table/components/EntityTable';
|
|||||||
import { useUpdateOneCompanyMutation } from '~/generated/graphql';
|
import { useUpdateOneCompanyMutation } from '~/generated/graphql';
|
||||||
import { availableSorts } from '~/pages/companies/companies-sorts';
|
import { availableSorts } from '~/pages/companies/companies-sorts';
|
||||||
|
|
||||||
|
import { CompanyTableMockData } from './CompanyTableMockData';
|
||||||
|
|
||||||
export function CompanyTableMockMode() {
|
export function CompanyTableMockMode() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<CompanyTableMockData />
|
||||||
<EntityTable
|
<EntityTable
|
||||||
viewName="All Companies"
|
viewName="All Companies"
|
||||||
viewIcon={<IconList size={16} />}
|
viewIcon={<IconList size={16} />}
|
||||||
|
@ -127,7 +127,7 @@ export function EntityTable<SortField>({
|
|||||||
onSortsUpdate={onSortsUpdate}
|
onSortsUpdate={onSortsUpdate}
|
||||||
/>
|
/>
|
||||||
<StyledTableWrapper>
|
<StyledTableWrapper>
|
||||||
{viewFields.length && (
|
{viewFields.length > 0 && (
|
||||||
<StyledTable>
|
<StyledTable>
|
||||||
<EntityTableHeader viewFields={viewFields} />
|
<EntityTableHeader viewFields={viewFields} />
|
||||||
<EntityTableBody />
|
<EntityTableBody />
|
||||||
|
Loading…
Reference in New Issue
Block a user