From cded690fba5b69eea069e7ea2364cee9d5a06f80 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Thu, 18 Feb 2021 21:40:40 +0100 Subject: [PATCH] Api call from component itself and linting. --- frontend/components/PersonalHighscorePage.vue | 85 +++++++++++-------- frontend/components/TodaysPage.vue | 36 +++----- 2 files changed, 59 insertions(+), 62 deletions(-) diff --git a/frontend/components/PersonalHighscorePage.vue b/frontend/components/PersonalHighscorePage.vue index d3a1a8b..31b2ad8 100644 --- a/frontend/components/PersonalHighscorePage.vue +++ b/frontend/components/PersonalHighscorePage.vue @@ -14,20 +14,25 @@

Vinnende farger:

-
+
{{ occurences }}

Flasker vunnet:

-
+
- {{ humanReadableDate(win.date) }} - {{ daysAgo(win.date) }} dager siden + {{ humanReadableDate(win.date) }} - {{ daysAgo(win.date) }} dager siden - -
- + +
+

{{ win.wine.name }}

@@ -38,6 +43,11 @@
+
+
+

Oisann! Klarte ikke finne vin.

+
+
@@ -49,67 +59,71 @@ \ No newline at end of file + diff --git a/frontend/components/TodaysPage.vue b/frontend/components/TodaysPage.vue index aece77a..13a989f 100644 --- a/frontend/components/TodaysPage.vue +++ b/frontend/components/TodaysPage.vue @@ -23,7 +23,9 @@ export default { }; }, async mounted() { - prelottery().then(wines => this.wines = wines); + fetch("/api/lottery/wines") + .then(resp => resp.json()) + .then(response => (this.wines = response.wines)); } }; @@ -42,19 +44,18 @@ h1 { } .wines-container { - display: flex; - flex-wrap: wrap; - justify-content: space-evenly; - margin: 0 2rem; + width: 90vw; + padding: 5vw; + + @include desktop { + width: 80vw; + padding: 0 10vw; + } @media (min-width: 1500px) { max-width: 1500px; margin: 0 auto; } - - @include mobile { - flex-direction: column; - } } h3 { @@ -65,23 +66,6 @@ h3 { } } -.inner-wine-container { - display: flex; - flex-direction: row; - margin: auto; - width: 500px; - font-family: Arial; - margin-bottom: 30px; - - @include desktop { - justify-content: center; - } - - @include mobile { - width: auto; - } -} - .right { display: flex; flex-direction: column;