mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 15:54:03 +00:00
fix(miniapp): tighten add and delete controls
This commit is contained in:
@@ -716,10 +716,12 @@ export function HouseScreen(props: Props) {
|
|||||||
</header>
|
</header>
|
||||||
<p>{props.copy.utilityBillsEditorBody ?? ''}</p>
|
<p>{props.copy.utilityBillsEditorBody ?? ''}</p>
|
||||||
<div class="panel-toolbar">
|
<div class="panel-toolbar">
|
||||||
<Button variant="secondary" onClick={props.onOpenAddUtilityBill}>
|
<IconButton
|
||||||
|
label={props.copy.addUtilityBillAction ?? ''}
|
||||||
|
onClick={props.onOpenAddUtilityBill}
|
||||||
|
>
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
{props.copy.addUtilityBillAction ?? ''}
|
</IconButton>
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ledger-list">
|
<div class="ledger-list">
|
||||||
{props.cycleState?.utilityBills.length ? (
|
{props.cycleState?.utilityBills.length ? (
|
||||||
@@ -762,10 +764,12 @@ export function HouseScreen(props: Props) {
|
|||||||
</header>
|
</header>
|
||||||
<p>{props.copy.utilityCategoriesBody ?? ''}</p>
|
<p>{props.copy.utilityCategoriesBody ?? ''}</p>
|
||||||
<div class="panel-toolbar">
|
<div class="panel-toolbar">
|
||||||
<Button variant="secondary" onClick={() => props.onOpenCategoryEditor('__new__')}>
|
<IconButton
|
||||||
|
label={props.copy.addCategoryAction ?? ''}
|
||||||
|
onClick={() => props.onOpenCategoryEditor('__new__')}
|
||||||
|
>
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
{props.copy.addCategoryAction ?? ''}
|
</IconButton>
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ledger-list">
|
<div class="ledger-list">
|
||||||
<For each={props.adminSettings?.categories ?? []}>
|
<For each={props.adminSettings?.categories ?? []}>
|
||||||
@@ -874,15 +878,18 @@ export function HouseScreen(props: Props) {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div class="modal-action-row">
|
<div class="modal-action-row">
|
||||||
<Button
|
<IconButton
|
||||||
variant="danger"
|
label={
|
||||||
|
props.deletingUtilityBillId === bill.id
|
||||||
|
? (props.copy.deletingUtilityBill ?? '')
|
||||||
|
: (props.copy.deleteUtilityBillAction ?? '')
|
||||||
|
}
|
||||||
|
class="ui-button--danger"
|
||||||
|
disabled={props.deletingUtilityBillId === bill.id}
|
||||||
onClick={() => void props.onDeleteUtilityBill(bill.id)}
|
onClick={() => void props.onDeleteUtilityBill(bill.id)}
|
||||||
>
|
>
|
||||||
<TrashIcon />
|
<TrashIcon />
|
||||||
{props.deletingUtilityBillId === bill.id
|
</IconButton>
|
||||||
? props.copy.deletingUtilityBill
|
|
||||||
: props.copy.deleteUtilityBillAction}
|
|
||||||
</Button>
|
|
||||||
<div class="modal-action-row__primary">
|
<div class="modal-action-row__primary">
|
||||||
<Button variant="ghost" onClick={props.onCloseUtilityBillEditor}>
|
<Button variant="ghost" onClick={props.onCloseUtilityBillEditor}>
|
||||||
{props.copy.closeEditorAction ?? ''}
|
{props.copy.closeEditorAction ?? ''}
|
||||||
|
|||||||
@@ -199,12 +199,18 @@ export function LedgerScreen(props: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="modal-action-row">
|
<div class="modal-action-row">
|
||||||
<Button variant="danger" onClick={() => void props.onDeletePurchase(entry.id)}>
|
<IconButton
|
||||||
|
label={
|
||||||
|
props.deletingPurchaseId === entry.id
|
||||||
|
? (props.copy.deletingPurchase ?? '')
|
||||||
|
: (props.copy.purchaseDeleteAction ?? '')
|
||||||
|
}
|
||||||
|
class="ui-button--danger"
|
||||||
|
disabled={props.deletingPurchaseId === entry.id}
|
||||||
|
onClick={() => void props.onDeletePurchase(entry.id)}
|
||||||
|
>
|
||||||
<TrashIcon />
|
<TrashIcon />
|
||||||
{props.deletingPurchaseId === entry.id
|
</IconButton>
|
||||||
? props.copy.deletingPurchase
|
|
||||||
: props.copy.purchaseDeleteAction}
|
|
||||||
</Button>
|
|
||||||
<div class="modal-action-row__primary">
|
<div class="modal-action-row__primary">
|
||||||
<Button variant="ghost" onClick={props.onClosePurchaseEditor}>
|
<Button variant="ghost" onClick={props.onClosePurchaseEditor}>
|
||||||
{props.copy.closeEditorAction ?? ''}
|
{props.copy.closeEditorAction ?? ''}
|
||||||
@@ -400,10 +406,12 @@ export function LedgerScreen(props: Props) {
|
|||||||
<Show when={props.readyIsAdmin}>
|
<Show when={props.readyIsAdmin}>
|
||||||
<p>{props.copy.paymentsAdminBody ?? ''}</p>
|
<p>{props.copy.paymentsAdminBody ?? ''}</p>
|
||||||
<div class="panel-toolbar">
|
<div class="panel-toolbar">
|
||||||
<Button variant="secondary" onClick={props.onOpenAddPayment}>
|
<IconButton
|
||||||
|
label={props.copy.paymentsAddAction ?? ''}
|
||||||
|
onClick={props.onOpenAddPayment}
|
||||||
|
>
|
||||||
<PlusIcon />
|
<PlusIcon />
|
||||||
{props.copy.paymentsAddAction ?? ''}
|
</IconButton>
|
||||||
</Button>
|
|
||||||
</div>
|
</div>
|
||||||
</Show>
|
</Show>
|
||||||
{props.paymentEntries.length === 0 ? (
|
{props.paymentEntries.length === 0 ? (
|
||||||
@@ -529,12 +537,18 @@ export function LedgerScreen(props: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="modal-action-row">
|
<div class="modal-action-row">
|
||||||
<Button variant="danger" onClick={() => void props.onDeletePayment(entry.id)}>
|
<IconButton
|
||||||
|
label={
|
||||||
|
props.deletingPaymentId === entry.id
|
||||||
|
? (props.copy.deletingPayment ?? '')
|
||||||
|
: (props.copy.paymentDeleteAction ?? '')
|
||||||
|
}
|
||||||
|
class="ui-button--danger"
|
||||||
|
disabled={props.deletingPaymentId === entry.id}
|
||||||
|
onClick={() => void props.onDeletePayment(entry.id)}
|
||||||
|
>
|
||||||
<TrashIcon />
|
<TrashIcon />
|
||||||
{props.deletingPaymentId === entry.id
|
</IconButton>
|
||||||
? props.copy.deletingPayment
|
|
||||||
: props.copy.paymentDeleteAction}
|
|
||||||
</Button>
|
|
||||||
<div class="modal-action-row__primary">
|
<div class="modal-action-row__primary">
|
||||||
<Button variant="ghost" onClick={props.onClosePaymentEditor}>
|
<Button variant="ghost" onClick={props.onClosePaymentEditor}>
|
||||||
{props.copy.closeEditorAction ?? ''}
|
{props.copy.closeEditorAction ?? ''}
|
||||||
|
|||||||
Reference in New Issue
Block a user