layout fixes

This commit is contained in:
Chika 2020-09-13 18:56:45 +03:00
parent 0c4cb602fd
commit 76f762b9e6
2 changed files with 41 additions and 15 deletions

View File

@ -53,6 +53,7 @@ const renderBlocks = ({ blocks }) => {
return blocks.map((block, ib) => {
const { elements, title: blockTitle, layout } = block;
const newLine = layout && layout.newLine;
const width = (layout && layout.width) || '45%';
return (
<React.Fragment key={ib}>
{newLine && <BreakLine />}
@ -61,13 +62,12 @@ const renderBlocks = ({ blocks }) => {
flex={[
'1 1 100%',
'1 1 100%',
'2 0 45%',
'2 0 45%',
'2 0 45%',
`2 0 ${width}`,
`2 0 ${width}`,
`2 0 ${width}`,
'3 0 30%',
]}
mx="10px"
my="15px"
>
{blockTitle && (
<SecondaryColoredText>{blockTitle}</SecondaryColoredText>
@ -101,7 +101,7 @@ const renderGroups = ({ groups }) => {
});
};
const Sections = props => (
const Sections = (props) => (
<Background {...props}>
<Tabs type="line">
{sectionsList.map((section, is) => {

View File

@ -34,6 +34,13 @@ export default [
showSearch: true,
},
},
],
layout: {
width: '30%',
},
},
{
elements: [
//TODO Custom search
{
title: 'Лизинговая сделка',
@ -44,6 +51,13 @@ export default [
showSearch: true,
},
},
],
layout: {
width: '30%',
},
},
{
elements: [
//TODO Custom search
{
title: 'Выбор Предложения',
@ -54,6 +68,13 @@ export default [
showSearch: true,
},
},
],
layout: {
width: '30%',
},
},
{
elements: [
{
title: 'Пересчет без пересмотра',
Component: Switch,
@ -61,10 +82,6 @@ export default [
name: 'cbxRecalcWithRevision',
valueName: 'recalcWithRevision',
},
layout: {
size: 'min',
flexDirection: 'row',
},
},
],
},
@ -288,6 +305,13 @@ export default [
valueName: 'product',
},
},
],
layout: {
width: '30%',
},
},
{
elements: [
{
title: 'Риск клиента',
Component: Select,
@ -296,6 +320,13 @@ export default [
valueName: 'clientRisk',
},
},
],
layout: {
width: '30%',
},
},
{
elements: [
{
title: 'Тип клиента',
Component: Select,
@ -305,9 +336,8 @@ export default [
},
},
],
// TODO flexDirection row
layout: {
flexDirection: 'row',
width: '30%',
},
},
],
@ -659,10 +689,6 @@ export default [
name: 'cbxLeaseObjectUsed',
valueName: 'leaseObjectUsed',
},
layout: {
size: 'min',
flexDirection: 'row',
},
},
{