UI refactor
This commit is contained in:
parent
2aa3dae575
commit
88557e9da3
@ -1,11 +1,14 @@
|
||||
import React from 'react';
|
||||
import { Divider } from 'antd';
|
||||
import Background from 'client/Elements/Background';
|
||||
import { PrimaryText } from 'client/Elements/Text';
|
||||
import Title from 'client/Elements/Title';
|
||||
import { Flex } from 'client/UIKit/grid';
|
||||
import React from 'react';
|
||||
|
||||
const Results = props => (
|
||||
<Background flex="1 0 20%" justifyContent="center">
|
||||
<PrimaryText>Расчет осуществляется по Интересу:</PrimaryText>
|
||||
<PrimaryText>Лизинговой сделке:</PrimaryText>
|
||||
<Divider />
|
||||
<Title text="Результаты" />
|
||||
</Background>
|
||||
);
|
||||
|
||||
@ -966,7 +966,6 @@ export default [
|
||||
title: 'Агент ФЛ',
|
||||
Component: Select,
|
||||
props: {
|
||||
disabled: true,
|
||||
name: 'selectIndAgent',
|
||||
valueName: 'indAgent',
|
||||
},
|
||||
@ -1035,7 +1034,6 @@ export default [
|
||||
title: 'Брокер',
|
||||
Component: Select,
|
||||
props: {
|
||||
disabled: true,
|
||||
name: 'selectCalcBroker',
|
||||
valueName: 'calcBroker',
|
||||
},
|
||||
@ -1072,7 +1070,6 @@ export default [
|
||||
props: {
|
||||
name: 'selectFinDepartment',
|
||||
valueName: 'finDepartment',
|
||||
disabled: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@ -1,14 +0,0 @@
|
||||
import React from 'react';
|
||||
import Background from 'client/Elements/Background';
|
||||
import { PrimaryText } from 'client/Elements/Text';
|
||||
|
||||
const Top = () => {
|
||||
return (
|
||||
<Background>
|
||||
<PrimaryText>Расчет осуществляется по Интересу:</PrimaryText>
|
||||
<PrimaryText>Лизинговой сделке:</PrimaryText>
|
||||
</Background>
|
||||
);
|
||||
};
|
||||
|
||||
export default Top;
|
||||
@ -1,13 +1,11 @@
|
||||
import { Flex, Box } from 'client/UIKit/grid';
|
||||
import { Box, Flex } from 'client/UIKit/grid';
|
||||
import React from 'react';
|
||||
import Results from './Results';
|
||||
import SectionsList from './Sections';
|
||||
import Top from './Top';
|
||||
|
||||
const Calculation = () => {
|
||||
return (
|
||||
<Box mx={['0', '1%', '1%', '10%']}>
|
||||
<Top />
|
||||
<Flex flexWrap="wrap" mb="50px">
|
||||
<SectionsList />
|
||||
<Results />
|
||||
|
||||
@ -24,29 +24,29 @@ const Radio = ({ name, style, computedValue, valueName }) => {
|
||||
disabled={status === Status.Disabled}
|
||||
buttonStyle={style === 'button' && 'solid'}
|
||||
value={value}
|
||||
onChange={(e) => {
|
||||
onChange={e => {
|
||||
if (e && e.target) setCurrentValue(e.target.value);
|
||||
}}
|
||||
>
|
||||
{options.map((option, i) => {
|
||||
switch (style) {
|
||||
case 'button': {
|
||||
case 'button':
|
||||
if (option) {
|
||||
return (
|
||||
<AntRadio.Button value={option.value || ''}>
|
||||
<AntRadio.Button key={i} value={option.value || ''}>
|
||||
{option.name}
|
||||
</AntRadio.Button>
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
if (option)
|
||||
return (
|
||||
<AntRadio value={option.value || ''}>{option.name}</AntRadio>
|
||||
);
|
||||
}
|
||||
if (option)
|
||||
return (
|
||||
<AntRadio key={i} value={option.value || ''}>
|
||||
{option.name}
|
||||
</AntRadio>
|
||||
);
|
||||
break;
|
||||
}
|
||||
})}
|
||||
|
||||
@ -16,12 +16,12 @@ const Select = ({ disabled, name, showSearch, computedValue, valueName }) => {
|
||||
|
||||
return (
|
||||
<AntSelect
|
||||
disabled={disabled || status === Status.Disabled}
|
||||
disabled={status === Status.Disabled}
|
||||
showSearch={showSearch}
|
||||
optionFilterProp="children"
|
||||
filterOption={filter}
|
||||
value={value}
|
||||
onChange={(val) => setCurrentValue(val)}
|
||||
onChange={val => setCurrentValue(val)}
|
||||
>
|
||||
{options.map((option, i) => {
|
||||
if (option)
|
||||
|
||||
@ -4,6 +4,10 @@ interface IInitialStatuses {
|
||||
[elementName: string]: Status;
|
||||
}
|
||||
|
||||
const initialStatuses: IInitialStatuses = {};
|
||||
const initialStatuses: IInitialStatuses = {
|
||||
selectIndAgent: Status.Disabled,
|
||||
selectCalcBroker: Status.Disabled,
|
||||
selectFinDepartment: Status.Disabled,
|
||||
};
|
||||
|
||||
export default initialStatuses;
|
||||
|
||||
Reference in New Issue
Block a user