для старейдров добавил innerWidth настройки

This commit is contained in:
Denis 2022-09-11 17:36:01 +03:00
parent 4cf7c1f921
commit 4f591a4649
2 changed files with 24 additions and 7 deletions

View File

@ -35,9 +35,17 @@ export default class CalculationsList extends React.Component
super(props);
this.state = {
company: {},
width: 1920
};
}
componentDidMount()
{
this.setState({
width: window.innerWidth
})
}
_handle_onCalculation = (calculation_id) =>
{
//href={ `/contract/${ number }/change/#${ calculation.addcontract_number }` }
@ -50,11 +58,11 @@ export default class CalculationsList extends React.Component
dots: false,
infinite: false,
speed: 500,
slidesToShow: 2.3,
slidesToScroll: 1,
slidesToShow: this.state.width < 1279 ? 1 : 2.3,
centerMode: false,
variableWidth: false,
nextArrow: <NextArrow />,
variableWidth: this.state.width < 1279 ? true : false,
dragFree: this.state.width < 1279 ? true : false,
nextArrow: <NextArrow />,
prevArrow: <PrevArrow />,
};

View File

@ -34,19 +34,28 @@ export default class SignatoriesList extends React.Component
super(props);
this.state = {
company: {},
width: 1920
};
}
componentDidMount()
{
this.setState({
width: window.innerWidth
})
}
render()
{
const settings = {
dots: false,
infinite: false,
speed: 500,
slidesToShow: 2.5,
slidesToScroll: 1,
slidesToShow: this.state.width < 1279 ? 1 : 2.5,
centerMode: false,
variableWidth: this.state.width < 1279 ? true : false,
dragFree: this.state.width < 1279 ? true : false,
centerMode: false,
variableWidth: false,
nextArrow: <NextArrow />,
prevArrow: <PrevArrow />,
};