Update ViewerNav.tsx

fixed marginLeft
This commit is contained in:
khitryk 2018-11-19 13:40:30 +00:00 committed by GitHub
parent ec26810ced
commit fd1ea5f05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,9 +21,10 @@ export default class ViewerNav extends React.Component<ViewerNavProps, any> {
}
render() {
let marginLeft = (Math.ceil(this.props.images.length / 2) - this.props.activeIndex - 1) * 1.5 * 30;
var marginLeft = `calc(50% - ${this.props.activeIndex + 1} * 31px)`;
let listStyle = {
marginLeft: `${marginLeft}px`,
marginLeft: marginLeft,
textAlign: 'left'
};
return (