1
0
Fork 0

Combine warning and options iconed buttons in one line

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2023-11-27 17:12:22 +08:00
parent b7087711aa
commit 38541f8928
4 changed files with 51 additions and 48 deletions

View File

@ -255,13 +255,10 @@ button {
.item-card-name, .item-card-name,
.price { .price {
> .alert-warning, .alert-info { .alert-warning, .alert-info {
background-color: inherit; background-color: inherit;
height: inherit; height: inherit;
width: 20px; width: 20px;
padding-bottom: 3px;
}
.alert-info {
padding-bottom: 0; padding-bottom: 0;
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -655,8 +655,8 @@ class ProductCartItem extends React.PureComponent {
provided.draggableProps.style, provided.draggableProps.style,
snapshot, snapshot,
true, true,
hovered ? true : false, !!hovered,
model.selected ? true : false, !!model.selected,
true true
)}} )}}
onMouseEnter={this.handleOnMouseEnterRemoveItem.bind(this, index)} onMouseEnter={this.handleOnMouseEnterRemoveItem.bind(this, index)}
@ -664,9 +664,12 @@ class ProductCartItem extends React.PureComponent {
> >
{/* warning container */} {/* warning container */}
<OverlayTrigger
<div className="progress-container warning d-flex justify-content-evenly">
{warning &&
(<OverlayTrigger
placement="bottom" placement="bottom"
trigger={warning ? ['click', 'hover', 'focus'] : []} trigger={['click', 'hover', 'focus']}
overlay={ overlay={
({arrowProps, hasDoneInitialMeasure, show, ...props}) => ( ({arrowProps, hasDoneInitialMeasure, show, ...props}) => (
<div className="k-popup-warning" {...props}> <div className="k-popup-warning" {...props}>
@ -677,10 +680,11 @@ class ProductCartItem extends React.PureComponent {
} }
rootClose rootClose
> >
<div className="progress-container warning"> <img className="alert-warning" src={`/images${warning.icon}`}/>
{warning ? </OverlayTrigger>)
(<img className="alert-warning" src={warning ? `/images${warning.icon}` : null}/>) : }
(options && (
{options && (
<OptionsDialogPopup <OptionsDialogPopup
options={options} options={options}
data={options_data} data={options_data}
@ -700,10 +704,8 @@ class ProductCartItem extends React.PureComponent {
}) })
}} }}
/> />
)) )}
}
</div> </div>
</OverlayTrigger>
<h6>{model.name_number}</h6> <h6>{model.name_number}</h6>
@ -1423,30 +1425,35 @@ class OrderSumary extends React.PureComponent {
</td> </td>
<td className="price"> <td className="price">
<div> <div className="d-inline-flex align-content-center">
{`${currency} ${formatMoney(item.price)}`} {`${currency} ${formatMoney(item.price)}`}
<button onClick={this.handleOnDeleteItem.bind(this, index)}> <button onClick={this.handleOnDeleteItem.bind(this, index)}>
<img src="/images/shop/icon-remove.svg" /> <img src="/images/shop/icon-remove.svg" />
</button> </button>
</div>
{warning ? ( <div style={{'width': '45px', 'height': '20px'}} className="d-inline-flex align-content-center align-self-center justify-content-evenly">
{(warning ? (
<img <img
style={{'marginLeft': '10px'}} className="alert-warning align-self-start"
className="alert-warning"
src={`/images/${warning.icon}`} src={`/images/${warning.icon}`}
/> />
) : ( (options && options_data) ? ) : (
( <OptionsSummaryPopup id={item.id + "options"} options={options} data={options_data} /> ) : null
)}
{(!warning && !options) && (
<span style={{ <span style={{
'display': 'inline-block', 'display': 'inline-block',
'width': '30px', 'width': '20px',
}}>&nbsp;</span> }}>&nbsp;</span>
)} ))}
{((options && options_data) ? (
<OptionsSummaryPopup id={item.id + "options"} options={options} data={options_data} />
) : (
<span style={{
'display': 'inline-block',
'width': '20px',
}}>&nbsp;</span>
))}
</div>
</div>
</td> </td>
</tr> </tr>
); );

View File

@ -423,7 +423,6 @@ export function OptionsSummaryPopup({id, options, data}) {
return ( return (
<div ref={ref}> <div ref={ref}>
<img className="alert-info" src={show ? "/images/shop/icon-close.svg" : "/images/shop/icon-customize.svg"} <img className="alert-info" src={show ? "/images/shop/icon-close.svg" : "/images/shop/icon-customize.svg"}
style={{'marginLeft': '10px'}}
id={id + "img"} id={id + "img"}
onClick={handleClick}/> onClick={handleClick}/>
<div style={{'display': show ? 'flex' : 'none', 'top': position.y, 'left': position.x}} <div style={{'display': show ? 'flex' : 'none', 'top': position.y, 'left': position.x}}