Added snooze icon to journal

#17
This commit is contained in:
Daniel J. Summers 2018-06-18 21:05:04 -05:00
parent d0ea7cf3c6
commit d1fd5f68e7
3 changed files with 11 additions and 5 deletions

View File

@ -25,7 +25,6 @@ article
import Vue from 'vue' import Vue from 'vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
import chunk from 'lodash/chunk'
import EditRequest from './request/EditRequest' import EditRequest from './request/EditRequest'
import FullRequest from './request/FullRequest' import FullRequest from './request/FullRequest'
@ -53,9 +52,6 @@ export default {
title () { title () {
return `${this.user.given_name}’s Prayer Journal` return `${this.user.given_name}’s Prayer Journal`
}, },
journalCardRows () {
return chunk(this.journal, 3)
},
toast () { toast () {
return this.$parent.$refs.toast return this.$parent.$refs.toast
}, },

View File

@ -1,11 +1,12 @@
<template lang="pug"> <template lang="pug">
b-col(md='6' lg='4') b-col(v-if="!isSnoozed" md='6' lg='4')
.mpj-request-card .mpj-request-card
b-card-header.text-center.py-1. b-card-header.text-center.py-1.
#[b-btn(@click='markPrayed()' variant='outline-primary' title='Pray' size='sm'): icon(name='check')] #[b-btn(@click='markPrayed()' variant='outline-primary' title='Pray' size='sm'): icon(name='check')]
#[b-btn(@click.stop='showEdit()' variant='outline-secondary' title='Edit' size='sm'): icon(name='pencil')] #[b-btn(@click.stop='showEdit()' variant='outline-secondary' title='Edit' size='sm'): icon(name='pencil')]
#[b-btn(@click.stop='showNotes()' variant='outline-secondary' title='Add Notes' size='sm'): icon(name='file-text-o')] #[b-btn(@click.stop='showNotes()' variant='outline-secondary' title='Add Notes' size='sm'): icon(name='file-text-o')]
#[b-btn(@click.stop='showFull()' variant='outline-secondary' title='View Full Request' size='sm'): icon(name='search')] #[b-btn(@click.stop='showFull()' variant='outline-secondary' title='View Full Request' size='sm'): icon(name='search')]
#[b-btn(@click.stop='snooze()' variant='outline-secondary' title='Snooze Request' size='sm'): icon(name='clock-o')]
b-card-body.p-0 b-card-body.p-0
p.card-text.mpj-request-text.mb-1.px-3.pt-3 p.card-text.mpj-request-text.mb-1.px-3.pt-3
| {{ request.text }} | {{ request.text }}
@ -27,6 +28,11 @@ export default {
toast: { required: true }, toast: { required: true },
events: { required: true } events: { required: true }
}, },
computed: {
isSnoozed () {
return Date.now() < this.request.snoozedUntil
}
},
methods: { methods: {
async markPrayed () { async markPrayed () {
await this.$store.dispatch(actions.UPDATE_REQUEST, { await this.$store.dispatch(actions.UPDATE_REQUEST, {
@ -45,6 +51,9 @@ export default {
}, },
showNotes () { showNotes () {
this.events.$emit('notes', this.request) this.events.$emit('notes', this.request)
},
snooze () {
// Nothing yet
} }
} }
} }

View File

@ -12,6 +12,7 @@ import 'vue-toast/dist/vue-toast.min.css'
// Only import the icons we need; the whole set is ~500K! // Only import the icons we need; the whole set is ~500K!
import 'vue-awesome/icons/check' import 'vue-awesome/icons/check'
import 'vue-awesome/icons/clock-o'
import 'vue-awesome/icons/file-text-o' import 'vue-awesome/icons/file-text-o'
import 'vue-awesome/icons/pencil' import 'vue-awesome/icons/pencil'
import 'vue-awesome/icons/plus' import 'vue-awesome/icons/plus'