ok
This commit is contained in:
@@ -5,6 +5,7 @@ const Item = ({
|
||||
forCart,
|
||||
forInvoice,
|
||||
portrait,
|
||||
hideDetails,
|
||||
name: initialName,
|
||||
description: initialDescription,
|
||||
price: initialPrice,
|
||||
@@ -147,75 +148,14 @@ const Item = ({
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className={styles.itemDetails}>
|
||||
{forInvoice &&
|
||||
<div className={styles.plusNegative2} onClick={onRemoveClick}>
|
||||
⌧
|
||||
</div>
|
||||
}
|
||||
{/* Title under image for portrait, non-overlay */}
|
||||
{portrait && null}
|
||||
{!portrait && (
|
||||
<div style={{ marginRight: forInvoice ? 10 : 0 }}>
|
||||
<h3 className={styles.title} style={{ width: forInvoice ? 160 : 'auto' }}>{displayName}</h3>
|
||||
{initialDescription && !forInvoice && (
|
||||
<p className={styles.desc}>{initialDescription}</p>
|
||||
)}
|
||||
{!forInvoice && (
|
||||
<div className={styles.priceRow}>
|
||||
{promoPrice && promoPrice != 0 && promoPrice != '' ? (
|
||||
<>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 10 }}>
|
||||
<span className={`${styles.itemPriceList} ${styles.promo}`}>Rp {formatCurrency(promoPrice)}</span>
|
||||
<span className={`${styles.itemPriceList} ${styles.original}`}>Rp {formatCurrency(initialPrice)}</span>
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<span className={styles.itemPriceList}>Rp {formatCurrency(initialPrice)}</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{forInvoice && (
|
||||
<>
|
||||
<p className={styles.multiplySymbol}>x</p>
|
||||
<p className={styles.qtyInvoice}>{itemQty}</p>
|
||||
</>
|
||||
)}
|
||||
|
||||
{!forInvoice && (
|
||||
portrait ? (
|
||||
(blank || isBeingEdit) ? (
|
||||
<div className={styles.itemQty}>
|
||||
<button className={styles.addButton} style={{ backgroundColor: '#ffffff', color: 'var(--brand-sage, #6B8F71)', borderColor: 'var(--brand-sage, #6B8F71)', minWidth: 90, height: 36, fontSize: 14 }} onClick={isBeingEdit ? handleUpdate : handleCreate}>
|
||||
{isBeingEdit ? 'Simpan' : 'Buat'}
|
||||
</button>
|
||||
</div>
|
||||
) : null
|
||||
) : (
|
||||
!isBeingEdit ? (
|
||||
<div className={styles.itemQty}>
|
||||
<div className={styles.qtyGroup}>
|
||||
<button className={styles.qtyBtn} onClick={handleNegativeClick} aria-label="Kurangi" style={{ width: 36, height: 36, fontSize: 18 }}>-</button>
|
||||
<span className={styles.qtyVal}>{itemQty}</span>
|
||||
<button className={styles.qtyBtn} onClick={handlePlusClick} aria-label="Tambah" style={{ width: 36, height: 36, fontSize: 18 }}>+</button>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className={styles.itemQty}>
|
||||
<button className={styles.addButton} style={{ backgroundColor: '#ffffff', color: 'var(--brand-sage, #6B8F71)', borderColor: 'var(--brand-sage, #6B8F71)', width: 130, height: 36, fontSize: 14 }} onClick={isBeingEdit ? handleUpdate : handleCreate}>
|
||||
{isBeingEdit ? 'Simpan' : 'Buat'}
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
)
|
||||
)}
|
||||
|
||||
{forInvoice && (
|
||||
{forInvoice && (
|
||||
<div className={styles.itemDetails}>
|
||||
<div className={styles.plusNegative2} onClick={onRemoveClick}>⌧</div>
|
||||
<p className={styles.multiplySymbol}>x</p>
|
||||
<p className={styles.qtyInvoice}>{itemQty}</p>
|
||||
<p className={styles.itemPriceInvoice}>Rp {formatCurrency(itemQty * (promoPrice > 0 ? promoPrice : itemPrice))}</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{forCart && (
|
||||
<div className={styles.remove} onClick={handleRemoveClick}>
|
||||
ⓧ
|
||||
@@ -227,4 +167,4 @@ const Item = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default Item;
|
||||
export default Item;
|
||||
|
||||
@@ -20,10 +20,7 @@
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.item:hover {
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.item:hover { /* remove hover effect on list items */ }
|
||||
|
||||
/* Portrait variant for cafe page grid */
|
||||
.itemPortrait {
|
||||
@@ -726,10 +723,7 @@
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.item-card:hover {
|
||||
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.item-card:hover { /* no hover */ }
|
||||
|
||||
/* List variant */
|
||||
.item-list-item {
|
||||
@@ -743,6 +737,4 @@
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.item-list-item:hover {
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
||||
}
|
||||
.item-list-item:hover { /* no hover */ }
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
z-index: 200;
|
||||
z-index: 2147483600 !important; /* above watermark and page layers */
|
||||
background-color: rgba(0, 0, 0, 0.38); /* #00000061 */
|
||||
}
|
||||
|
||||
@@ -98,4 +98,4 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ const ItemLister = ({
|
||||
availability: true,
|
||||
selectedImage: null,
|
||||
}));
|
||||
const displayItems = showGrid ? [...items, ...dummyItems] : items;
|
||||
const displayItems = items; // no dummy items on cafe page
|
||||
|
||||
const handlePlusClick = (itemId) => {
|
||||
const updatedItems = items.map((item) => {
|
||||
@@ -913,7 +913,7 @@ const ItemLister = ({
|
||||
cancelEdit={() => toggleAddNewItem()}
|
||||
handleCreateItem={onCreateItem}
|
||||
/>
|
||||
<Item blank={true} handleCreateItem={onCreateItem} />
|
||||
<Item blank={true} handleCreateItem={onCreateItem} hideDetails={!showGrid} />
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
@@ -977,6 +977,7 @@ const ItemLister = ({
|
||||
qty={item.qty}
|
||||
imageUrl={item.image}
|
||||
imageFile={item.selectedImage}
|
||||
hideDetails={!showGrid}
|
||||
onPlusClick={() => handlePlusClick(item.itemId)}
|
||||
onNegativeClick={() => handleNegativeClick(item.itemId)}
|
||||
onRemoveClick={() => handleRemoveClick(item.itemId)}
|
||||
@@ -991,7 +992,7 @@ const ItemLister = ({
|
||||
) : null;
|
||||
})}
|
||||
|
||||
{(showGrid ? [...items, ...dummyItems] : items).map((item, indexx) => {
|
||||
{items.map((item, indexx) => {
|
||||
return !forCart || (forCart && item.qty > 0) ? (
|
||||
<div
|
||||
key={item.itemId}>
|
||||
@@ -1061,10 +1062,11 @@ const ItemLister = ({
|
||||
|
||||
<Item
|
||||
key={item.itemId}
|
||||
last={index === indexTotal - 1 && indexx === (showGrid ? (items.length + dummyItems.length) : items.length) - 1}
|
||||
last={index === indexTotal - 1 && indexx === items.length - 1}
|
||||
forCart={forCart}
|
||||
forInvoice={forInvoice}
|
||||
portrait={showGrid}
|
||||
hideDetails={!showGrid}
|
||||
name={item.name}
|
||||
price={item.price}
|
||||
promoPrice={item.promoPrice}
|
||||
@@ -1111,4 +1113,4 @@ const ItemLister = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ItemLister;
|
||||
export default ItemLister;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
z-index: 150; /* Memastikan berada di bawah material list */
|
||||
z-index: 0 !important; /* ensure behind modal overlay */
|
||||
}
|
||||
|
||||
.fullscreen {
|
||||
@@ -20,7 +20,7 @@
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: white;
|
||||
z-index: 1000;
|
||||
z-index: 100; /* keep above page, below modal overlays (>=200) */
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
||||
position: relative;
|
||||
z-index: 151;
|
||||
z-index: 0 !important; /* ensure behind modal overlay */
|
||||
}
|
||||
|
||||
.titleActions {
|
||||
@@ -120,7 +120,7 @@
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
|
||||
position: relative;
|
||||
z-index: 152;
|
||||
z-index: 0 !important; /* ensure behind modal overlay */
|
||||
}
|
||||
.iconBtn:disabled {
|
||||
opacity: 0.5;
|
||||
@@ -169,26 +169,50 @@
|
||||
}
|
||||
|
||||
.add-item-button {
|
||||
margin-top: 16px;
|
||||
padding: 12px 20px;
|
||||
font-size: 16px;
|
||||
background-color: #359d42d1;
|
||||
color: #fff;
|
||||
margin: 0; /* follow parent gap for top/bottom spacing */
|
||||
display: inline-block;
|
||||
width: 275px; /* requested size */
|
||||
height: 275px; /* requested size */
|
||||
padding: 0; /* match image padding (none) */
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
background: transparent; /* card drawn via ::before */
|
||||
color: transparent; /* no visible text */
|
||||
border-radius: 12px; /* match portrait image radius */
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
box-shadow: 0 2px 6px rgba(53, 157, 66, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
transition: none;
|
||||
box-shadow: none;
|
||||
position: relative;
|
||||
z-index: 151;
|
||||
z-index: 1; /* behind modal overlay */
|
||||
}
|
||||
|
||||
.add-item-button::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0; /* fill container */
|
||||
border-radius: 12px; /* match portrait image radius */
|
||||
background:
|
||||
/* vertical bar */
|
||||
linear-gradient(var(--brand-sage, #6B8F71), var(--brand-sage, #6B8F71)) center/5px 20% no-repeat,
|
||||
/* horizontal bar */
|
||||
linear-gradient(var(--brand-sage, #6B8F71), var(--brand-sage, #6B8F71)) center/20% 5px no-repeat,
|
||||
/* base */
|
||||
var(--brand-sage-50, #F0F6F2);
|
||||
border: 2px dashed var(--brand-sage, #6B8F71);
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.10);
|
||||
}
|
||||
|
||||
.add-item-button:focus-visible {
|
||||
outline: 2px solid var(--brand-sage, #6B8F71);
|
||||
outline-offset: 2px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
/* Overlay text inside the left tile area */
|
||||
.add-item-button::after { content: none; }
|
||||
|
||||
.add-item-button:hover {
|
||||
background-color: #2d8a39;
|
||||
box-shadow: 0 4px 10px rgba(53, 157, 66, 0.3);
|
||||
background-color: #ffffff;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.item-list {
|
||||
@@ -196,7 +220,20 @@
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
position: relative;
|
||||
z-index: 150;
|
||||
z-index: 0 !important; /* ensure behind modal overlay */
|
||||
}
|
||||
|
||||
/* Generic switch row styling reused in multiple spots */
|
||||
.switch-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.switch-label {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Grid layout for portrait cards on cafe page */
|
||||
@@ -234,33 +271,62 @@
|
||||
position: relative;
|
||||
z-index: 150;
|
||||
}
|
||||
.itemWrapper:hover {
|
||||
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.itemWrapper:hover { /* remove hover effect */ }
|
||||
|
||||
.editModeLayout {
|
||||
border-radius: 12px 12px 0 0;
|
||||
.editModeLayout {
|
||||
/* Turn full-width bar into subtle corner controls over image */
|
||||
position: absolute;
|
||||
z-index: 155; /* Memastikan berada di atas itemWrapper */
|
||||
background-color: #000000cc;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
font-size: 14px;
|
||||
padding: 12px 16px;
|
||||
color: white;
|
||||
inset: 0;
|
||||
z-index: 155; /* above itemWrapper */
|
||||
pointer-events: none; /* only children are interactive */
|
||||
}
|
||||
|
||||
.editModeLayout h3 {
|
||||
margin: 0;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
/* Left badge: availability switch + label */
|
||||
.editModeLayout > div:first-child {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
left: 16px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
color: #fff;
|
||||
border-radius: 999px;
|
||||
padding: 6px 10px;
|
||||
pointer-events: auto;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
/* Right badge: edit/unmark button */
|
||||
.editModeLayout > div:last-child {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
color: #fff;
|
||||
border-radius: 999px;
|
||||
pointer-events: auto;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s ease, transform 0.2s ease;
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
.editModeLayout > div:last-child:hover {
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* When label exists, keep it compact and readable */
|
||||
.editModeLayout .switch-label {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.PaymentOption {
|
||||
@@ -384,4 +450,4 @@
|
||||
color: #727272;
|
||||
font-size: 12px;
|
||||
text-decoration: line-through;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 9999;
|
||||
z-index: 2147483647 !important; /* ensure above any app layers */
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user