Browse Source

tweak the prompt for contacts to be able to skip them

kb/add-usage-guide
Trent Larson 8 months ago
parent
commit
f53a6f3045
  1. 47
      src/components/GiftedPrompts.vue
  2. 2
      src/main.ts
  3. 2
      src/views/HomeView.vue

47
src/components/GiftedPrompts.vue

@ -2,9 +2,9 @@
<div v-if="visible" class="dialog-overlay">
<div class="dialog">
<h1 class="text-xl font-bold text-center mb-4">Here's one:</h1>
<span class="flex justify-between h-24">
<span class="flex justify-between">
<span
class="rounded-l border border-slate-400 bg-slate-200 h-full px-4 py-2 flex h-screen"
class="rounded-l border border-slate-400 bg-slate-200 px-4 py-2 flex"
@click="prevIdea()"
>
<fa icon="chevron-left" class="m-auto" />
@ -17,22 +17,35 @@
</p>
</span>
<div v-if="currentIdeaIndex == IDEAS.length + 0">
<p class="text-center text-lg font-bold">
Did this person or someone near them do something &ndash; maybe a
while ago?
<br />
<span v-if="currentContact?.name == null" class="text-orange-500">
<p class="text-center">
<span
v-if="currentContact == null"
class="text-orange-500 text-lg font-bold"
>
That's all your contacts.
</span>
<span v-else>{{
currentContact.name || AppString.NO_CONTACT_NAME
}}</span>
<span v-else>
<span class="text-lg font-bold">
Did {{ currentContact.name || AppString.NO_CONTACT_NAME }}
<br />
or someone near them do anything &ndash; maybe a while ago?
</span>
<span class="flex justify-between">
<span />
<button
class="text-center bg-slate-500 text-white px-1.5 py-2 rounded-md mt-4"
@click="nextIdeaPastContacts()"
>
Skip Contacts <fa icon="forward" />
</button>
</span>
</span>
</p>
</div>
</div>
<span
class="rounded-r border border-slate-400 bg-slate-200 h-full px-4 py-2 flex h-screen"
class="rounded-r border border-slate-400 bg-slate-200 px-4 py-2 flex"
@click="nextIdea()"
>
<fa icon="chevron-right" class="m-auto" />
@ -42,7 +55,7 @@
class="block w-full text-center text-md uppercase bg-slate-500 text-white px-1.5 py-2 rounded-md mt-4"
@click="cancel"
>
That's it.
That's it!
</button>
</div>
</div>
@ -108,7 +121,7 @@ export default class GivenPrompts extends Vue {
if (
this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX - 1 ||
(this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX &&
this.currentContact)
this.shownContactDbIndices.length < this.numContacts)
) {
this.currentIdeaIndex = this.CONTACT_PROMPT_INDEX;
this.findNextUnshownContact();
@ -128,7 +141,7 @@ export default class GivenPrompts extends Vue {
(this.CONTACT_PROMPT_INDEX + 1) %
(this.IDEAS.length + this.OTHER_PROMPTS) ||
(this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX &&
this.currentContact)
this.shownContactDbIndices.length < this.numContacts)
) {
this.currentIdeaIndex = this.CONTACT_PROMPT_INDEX;
this.findNextUnshownContact();
@ -144,6 +157,12 @@ export default class GivenPrompts extends Vue {
}
}
nextIdeaPastContacts() {
this.currentIdeaIndex = 0;
this.currentContact = undefined;
this.shownContactDbIndices = [];
}
async findNextUnshownContact() {
// get a random contact
if (this.shownContactDbIndices.length === this.numContacts) {

2
src/main.ts

@ -36,6 +36,7 @@ import {
faFileLines,
faFloppyDisk,
faFolderOpen,
faForward,
faGift,
faGlobe,
faHand,
@ -92,6 +93,7 @@ library.add(
faFileLines,
faFloppyDisk,
faFolderOpen,
faForward,
faGift,
faGlobe,
faHand,

2
src/views/HomeView.vue

@ -110,7 +110,7 @@
@click="openGiftedPrompts()"
class="block text-center text-md font-bold bg-blue-500 text-white px-2 py-3 rounded-md"
>
If you want an idea...
Ideas...
</button>
</div>

Loading…
Cancel
Save