This commit is contained in:
karyamanswasta
2025-08-27 07:00:14 +07:00
parent df203447a9
commit 6ed982d6ef
6 changed files with 132 additions and 132 deletions

View File

@@ -5,6 +5,7 @@ const Item = ({
forCart, forCart,
forInvoice, forInvoice,
portrait, portrait,
hideDetails,
name: initialName, name: initialName,
description: initialDescription, description: initialDescription,
price: initialPrice, price: initialPrice,
@@ -147,75 +148,14 @@ const Item = ({
)} )}
</div> </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 && ( {forInvoice && (
<> <div className={styles.itemDetails}>
<div className={styles.plusNegative2} onClick={onRemoveClick}></div>
<p className={styles.multiplySymbol}>x</p> <p className={styles.multiplySymbol}>x</p>
<p className={styles.qtyInvoice}>{itemQty}</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 && (
<p className={styles.itemPriceInvoice}>Rp {formatCurrency(itemQty * (promoPrice > 0 ? promoPrice : itemPrice))}</p> <p className={styles.itemPriceInvoice}>Rp {formatCurrency(itemQty * (promoPrice > 0 ? promoPrice : itemPrice))}</p>
)}
</div> </div>
)}
{forCart && ( {forCart && (
<div className={styles.remove} onClick={handleRemoveClick}> <div className={styles.remove} onClick={handleRemoveClick}>

View File

@@ -20,10 +20,7 @@
position: relative; position: relative;
} }
.item:hover { .item:hover { /* remove hover effect on list items */ }
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
transform: translateY(-2px);
}
/* Portrait variant for cafe page grid */ /* Portrait variant for cafe page grid */
.itemPortrait { .itemPortrait {
@@ -726,10 +723,7 @@
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.item-card:hover { .item-card:hover { /* no hover */ }
box-shadow: 0 4px 16px rgba(0,0,0,0.12);
transform: translateY(-2px);
}
/* List variant */ /* List variant */
.item-list-item { .item-list-item {
@@ -743,6 +737,4 @@
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.item-list-item:hover { .item-list-item:hover { /* no hover */ }
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

View File

@@ -8,7 +8,7 @@
bottom: 0; bottom: 0;
display: flex; display: flex;
flex-direction: column-reverse; 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 */ background-color: rgba(0, 0, 0, 0.38); /* #00000061 */
} }

View File

@@ -88,7 +88,7 @@ const ItemLister = ({
availability: true, availability: true,
selectedImage: null, selectedImage: null,
})); }));
const displayItems = showGrid ? [...items, ...dummyItems] : items; const displayItems = items; // no dummy items on cafe page
const handlePlusClick = (itemId) => { const handlePlusClick = (itemId) => {
const updatedItems = items.map((item) => { const updatedItems = items.map((item) => {
@@ -913,7 +913,7 @@ const ItemLister = ({
cancelEdit={() => toggleAddNewItem()} cancelEdit={() => toggleAddNewItem()}
handleCreateItem={onCreateItem} handleCreateItem={onCreateItem}
/> />
<Item blank={true} handleCreateItem={onCreateItem} /> <Item blank={true} handleCreateItem={onCreateItem} hideDetails={!showGrid} />
</> </>
)} )}
</> </>
@@ -977,6 +977,7 @@ const ItemLister = ({
qty={item.qty} qty={item.qty}
imageUrl={item.image} imageUrl={item.image}
imageFile={item.selectedImage} imageFile={item.selectedImage}
hideDetails={!showGrid}
onPlusClick={() => handlePlusClick(item.itemId)} onPlusClick={() => handlePlusClick(item.itemId)}
onNegativeClick={() => handleNegativeClick(item.itemId)} onNegativeClick={() => handleNegativeClick(item.itemId)}
onRemoveClick={() => handleRemoveClick(item.itemId)} onRemoveClick={() => handleRemoveClick(item.itemId)}
@@ -991,7 +992,7 @@ const ItemLister = ({
) : null; ) : null;
})} })}
{(showGrid ? [...items, ...dummyItems] : items).map((item, indexx) => { {items.map((item, indexx) => {
return !forCart || (forCart && item.qty > 0) ? ( return !forCart || (forCart && item.qty > 0) ? (
<div <div
key={item.itemId}> key={item.itemId}>
@@ -1061,10 +1062,11 @@ const ItemLister = ({
<Item <Item
key={item.itemId} 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} forCart={forCart}
forInvoice={forInvoice} forInvoice={forInvoice}
portrait={showGrid} portrait={showGrid}
hideDetails={!showGrid}
name={item.name} name={item.name}
price={item.price} price={item.price}
promoPrice={item.promoPrice} promoPrice={item.promoPrice}

View File

@@ -10,7 +10,7 @@
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
margin-bottom: 20px; margin-bottom: 20px;
position: relative; position: relative;
z-index: 150; /* Memastikan berada di bawah material list */ z-index: 0 !important; /* ensure behind modal overlay */
} }
.fullscreen { .fullscreen {
@@ -20,7 +20,7 @@
left: 0; left: 0;
right: 0; right: 0;
background-color: white; background-color: white;
z-index: 1000; z-index: 100; /* keep above page, below modal overlays (>=200) */
overflow-y: auto; overflow-y: auto;
} }
@@ -97,7 +97,7 @@
margin-bottom: 20px; margin-bottom: 20px;
box-shadow: 0 1px 3px rgba(0,0,0,0.05); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
position: relative; position: relative;
z-index: 151; z-index: 0 !important; /* ensure behind modal overlay */
} }
.titleActions { .titleActions {
@@ -120,7 +120,7 @@
transition: all 0.2s ease; transition: all 0.2s ease;
box-shadow: 0 1px 3px rgba(0,0,0,0.05); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
position: relative; position: relative;
z-index: 152; z-index: 0 !important; /* ensure behind modal overlay */
} }
.iconBtn:disabled { .iconBtn:disabled {
opacity: 0.5; opacity: 0.5;
@@ -169,26 +169,50 @@
} }
.add-item-button { .add-item-button {
margin-top: 16px; margin: 0; /* follow parent gap for top/bottom spacing */
padding: 12px 20px; display: inline-block;
font-size: 16px; width: 275px; /* requested size */
background-color: #359d42d1; height: 275px; /* requested size */
color: #fff; padding: 0; /* match image padding (none) */
border: 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; cursor: pointer;
transition: all 0.2s ease; transition: none;
box-shadow: 0 2px 6px rgba(53, 157, 66, 0.2); box-shadow: none;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
position: relative; 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 { .add-item-button:hover {
background-color: #2d8a39; background-color: #ffffff;
box-shadow: 0 4px 10px rgba(53, 157, 66, 0.3); box-shadow: none;
} }
.item-list { .item-list {
@@ -196,7 +220,20 @@
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
position: relative; 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 */ /* Grid layout for portrait cards on cafe page */
@@ -234,33 +271,62 @@
position: relative; position: relative;
z-index: 150; z-index: 150;
} }
.itemWrapper:hover { .itemWrapper:hover { /* remove hover effect */ }
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
transform: translateY(-2px);
}
.editModeLayout { .editModeLayout {
border-radius: 12px 12px 0 0; /* Turn full-width bar into subtle corner controls over image */
position: absolute; position: absolute;
z-index: 155; /* Memastikan berada di atas itemWrapper */ inset: 0;
background-color: #000000cc; z-index: 155; /* above itemWrapper */
width: 100%; pointer-events: none; /* only children are interactive */
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;
} }
.editModeLayout h3 { /* Left badge: availability switch + label */
margin: 0; .editModeLayout > div:first-child {
font-weight: 500; position: absolute;
font-size: 14px; 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 { .PaymentOption {

View File

@@ -8,7 +8,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 9999; z-index: 2147483647 !important; /* ensure above any app layers */
padding: 20px; padding: 20px;
} }