fix insurance table layout

This commit is contained in:
vchikalkin 2023-05-08 14:10:32 +03:00
parent c85fb50823
commit 038a46ed66
3 changed files with 19 additions and 8 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable react/forbid-component-props */
/* eslint-disable canonical/sort-keys */
import { buildOptionComponent, buildValueComponent } from './builders';
import type * as Insurance from './types';
@ -17,12 +18,21 @@ export const columns: ColumnsType<Insurance.RowValues> = [
key: 'insuranceCompany',
dataIndex: 'insuranceCompany',
title: 'Страховая компания',
width: 300,
render: (_, record) => {
const Component = buildOptionComponent(record.key, Select, 'insuranceCompany');
return <Component optionFilterProp="label" showSearch />;
return (
<Component
optionFilterProp="label"
showSearch
style={{
width: '290px',
maxWidth: '290px',
}}
/>
);
},
width: '290px',
},
{
key: 'insured',
@ -37,7 +47,7 @@ export const columns: ColumnsType<Insurance.RowValues> = [
{
key: 'insCost',
dataIndex: 'insCost',
title: 'Стоимость за 1-й период',
title: 'Сумма за 1-й период',
render: (_, record) => {
const Component = buildValueComponent(record.key, InputNumber, 'insCost');
@ -50,9 +60,13 @@ export const columns: ColumnsType<Insurance.RowValues> = [
parser={parser}
precision={2}
step={1000}
style={{
width: '150px',
}}
/>
);
},
width: '150px',
},
{
key: 'insTerm',

View File

@ -13,11 +13,8 @@ export const Grid = styled(Box)`
grid-template-columns: 2fr 1fr;
}
${min('laptop-hd')} {
grid-template-columns: 2fr 1fr 1.5fr;
}
${min('desktop')} {
grid-template-columns: 2fr 1fr 1.5fr;
margin: 8px 5%;
}

View File

@ -4,7 +4,7 @@ const threshold = 0;
const screens = {
tablet: 768,
laptop: 1024,
'laptop-hd': 1280,
'laptop-m': 1280,
desktop: 1680,
'desktop-xl': 1921,
};