Browse Source

tweak the prompt for contacts to be able to skip them

kb/add-usage-guide
Trent Larson 9 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 v-if="visible" class="dialog-overlay">
<div class="dialog"> <div class="dialog">
<h1 class="text-xl font-bold text-center mb-4">Here's one:</h1> <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 <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()" @click="prevIdea()"
> >
<fa icon="chevron-left" class="m-auto" /> <fa icon="chevron-left" class="m-auto" />
@ -17,22 +17,35 @@
</p> </p>
</span> </span>
<div v-if="currentIdeaIndex == IDEAS.length + 0"> <div v-if="currentIdeaIndex == IDEAS.length + 0">
<p class="text-center text-lg font-bold"> <p class="text-center">
Did this person or someone near them do something &ndash; maybe a <span
while ago? v-if="currentContact == null"
<br /> class="text-orange-500 text-lg font-bold"
<span v-if="currentContact?.name == null" class="text-orange-500"> >
That's all your contacts. That's all your contacts.
</span> </span>
<span v-else>{{ <span v-else>
currentContact.name || AppString.NO_CONTACT_NAME <span class="text-lg font-bold">
}}</span> 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> </p>
</div> </div>
</div> </div>
<span <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()" @click="nextIdea()"
> >
<fa icon="chevron-right" class="m-auto" /> <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" 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" @click="cancel"
> >
That's it. That's it!
</button> </button>
</div> </div>
</div> </div>
@ -108,7 +121,7 @@ export default class GivenPrompts extends Vue {
if ( if (
this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX - 1 || this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX - 1 ||
(this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX && (this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX &&
this.currentContact) this.shownContactDbIndices.length < this.numContacts)
) { ) {
this.currentIdeaIndex = this.CONTACT_PROMPT_INDEX; this.currentIdeaIndex = this.CONTACT_PROMPT_INDEX;
this.findNextUnshownContact(); this.findNextUnshownContact();
@ -128,7 +141,7 @@ export default class GivenPrompts extends Vue {
(this.CONTACT_PROMPT_INDEX + 1) % (this.CONTACT_PROMPT_INDEX + 1) %
(this.IDEAS.length + this.OTHER_PROMPTS) || (this.IDEAS.length + this.OTHER_PROMPTS) ||
(this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX && (this.currentIdeaIndex == this.CONTACT_PROMPT_INDEX &&
this.currentContact) this.shownContactDbIndices.length < this.numContacts)
) { ) {
this.currentIdeaIndex = this.CONTACT_PROMPT_INDEX; this.currentIdeaIndex = this.CONTACT_PROMPT_INDEX;
this.findNextUnshownContact(); this.findNextUnshownContact();
@ -144,6 +157,12 @@ export default class GivenPrompts extends Vue {
} }
} }
nextIdeaPastContacts() {
this.currentIdeaIndex = 0;
this.currentContact = undefined;
this.shownContactDbIndices = [];
}
async findNextUnshownContact() { async findNextUnshownContact() {
// get a random contact // get a random contact
if (this.shownContactDbIndices.length === this.numContacts) { if (this.shownContactDbIndices.length === this.numContacts) {

2
src/main.ts

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

2
src/views/HomeView.vue

@ -110,7 +110,7 @@
@click="openGiftedPrompts()" @click="openGiftedPrompts()"
class="block text-center text-md font-bold bg-blue-500 text-white px-2 py-3 rounded-md" 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> </button>
</div> </div>

Loading…
Cancel
Save