From 4765dd1283c94143842faa3c0b9a84dcf3a5d58f Mon Sep 17 00:00:00 2001 From: dartcafe Date: Wed, 16 Sep 2020 18:45:15 +0200 Subject: [PATCH] initial --- src/js/components/VoteTable/VoteTable.vue | 10 ++-- .../VoteTable/VoteTableHeaderItem.vue | 29 +++++++-- src/js/store/modules/settings.js | 4 ++ src/js/views/Vote.vue | 59 +++++++++++++++++-- 4 files changed, 85 insertions(+), 17 deletions(-) diff --git a/src/js/components/VoteTable/VoteTable.vue b/src/js/components/VoteTable/VoteTable.vue index 73e0a5652..d19cbc656 100644 --- a/src/js/components/VoteTable/VoteTable.vue +++ b/src/js/components/VoteTable/VoteTable.vue @@ -21,7 +21,7 @@ --> @@ -52,9 +52,9 @@ export default { type: Object, default: undefined, }, - tableMode: { - type: Boolean, - default: false, + viewMode: { + type: String, + default: 'desktop', }, }, @@ -69,6 +69,23 @@ export default { confirmedOptions: 'poll/options/confirmed', }), + optionStyle() { + if (this.viewMode === 'desktop') { + return 'dateBox' + } else { + return 'textBox' + } + }, + counterStyle() { + if (this.viewMode === 'desktop') { + return 'iconStyle' + } else { + return 'barStyle' + } + }, + showNo() { + return (this.viewMode === 'desktop') + }, isWinner() { // highlight best option until poll is expired and // at least one option is confirmed diff --git a/src/js/store/modules/settings.js b/src/js/store/modules/settings.js index a3dc6866e..8753c492e 100644 --- a/src/js/store/modules/settings.js +++ b/src/js/store/modules/settings.js @@ -32,6 +32,10 @@ const defaultSettings = () => { imageUrl: '', glassyNavigation: false, glassySidebar: false, + defaultView: { + textPoll: 'mobile', + datePoll: 'desktop', + }, }, } } diff --git a/src/js/views/Vote.vue b/src/js/views/Vote.vue index f8816f93d..3265043ec 100644 --- a/src/js/views/Vote.vue +++ b/src/js/views/Vote.vue @@ -67,8 +67,8 @@ -
- +
+