From 35ec7fd43cdf660946ed1942fa94cc5b635b7ebb Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Wed, 24 Apr 2024 20:38:34 -0600 Subject: [PATCH] put button directly on contacts page to show the given totals --- src/views/ContactsView.vue | 68 ++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/src/views/ContactsView.vue b/src/views/ContactsView.vue index a00fa77..26c8fa7 100644 --- a/src/views/ContactsView.vue +++ b/src/views/ContactsView.vue @@ -41,24 +41,17 @@ -
+
+ +
+
- In the following, only the most recent hours are included. To see more, click
@@ -1188,6 +1181,30 @@ export default class ContactsView extends Vue { .then(() => (this.contactEdit = null)); } + public async toggleShowContactAmounts() { + const newShowValue = !this.showGiveNumbers; + try { + await db.open(); + db.settings.update(MASTER_SETTINGS_KEY, { + showContactGivesInline: newShowValue, + }); + } catch (err) { + this.$notify( + { + group: "alert", + type: "danger", + title: "Error Updating Contact Setting", + text: "The setting may not have saved. Try again, maybe after restarting the app.", + }, + -1, + ); + console.error( + "Telling user to try again after contact-amounts setting update because:", + err, + ); + } + this.showGiveNumbers = newShowValue; + } public toggleShowGiveTotals() { if (this.showGiveTotals) { this.showGiveTotals = false; @@ -1203,9 +1220,12 @@ export default class ContactsView extends Vue { public showGiveAmountsClassNames() { return { - "bg-slate-500": this.showGiveTotals, - "bg-green-600": !this.showGiveTotals && this.showGiveConfirmed, - "bg-yellow-600": !this.showGiveTotals && !this.showGiveConfirmed, + "from-slate-400": this.showGiveTotals, + "to-slate-700": this.showGiveTotals, + "from-green-400": !this.showGiveTotals && this.showGiveConfirmed, + "to-green-700": !this.showGiveTotals && this.showGiveConfirmed, + "from-yellow-400": !this.showGiveTotals && !this.showGiveConfirmed, + "to-yellow-700": !this.showGiveTotals && !this.showGiveConfirmed, }; } }