web2019/static/js/shop/FakePlaceholder.jsx
Egor Savkin 84562f276a Add horizontal items into the cart
Signed-off-by: Egor Savkin <es@m-labs.hk>
2024-11-06 17:18:23 +08:00

28 lines
669 B
JavaScript

import React from 'react';
/**
* Component that displays a placeholder inside crate.
* Allows to display how it remains space for the current crate.
*/
export function FakePlaceholder({isDraggingOver, nToDraw}) {
const fakePlaceholder = [];
for (let i = nToDraw; i > 0; i--) {
fakePlaceholder.push(
<div key={i} style={{
display: isDraggingOver ? 'none' : 'block',
border: '1px dashed #ccc',
width: '69px',
marginBottom: '5px',
}}></div>
);
}
return (
<React.Fragment>
{fakePlaceholder}
</React.Fragment>
);
}