-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from aabanaag/develop
v0.5.0
- Loading branch information
Showing
13 changed files
with
345 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ deploy: | |
github_token: $GITHUB_TOKEN | ||
local_dir: dist | ||
on: | ||
branch: master | ||
branch: master | ||
tags: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
<template> | ||
<v-container> | ||
<div class="d-flex align-md-center"> | ||
<v-img :src="flag" max-width="30" max-height="20"></v-img> | ||
<h3>{{ country.country }}</h3> | ||
</div> | ||
<v-spacer /> | ||
<v-container fluid> | ||
<v-row> | ||
<v-col cols="12" md="4"> | ||
<v-text-field | ||
label="Total Cases" | ||
:value="cases" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="Total Recoveries" | ||
:value="recoveries" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="Total Deaths" | ||
:value="deaths" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
</v-row> | ||
<v-row> | ||
<v-col> | ||
<v-text-field | ||
label="New Cases" | ||
:value="newCases" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="New Deaths" | ||
:value="newDeaths" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="Critical" | ||
:value="critical" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="Active" | ||
:value="active" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
</v-row> | ||
<v-row> | ||
<v-col> | ||
<v-text-field | ||
label="Cases per Million" | ||
:value="casesPerMillion" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="Deaths per Million" | ||
:value="deathsPerMillion" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
</v-row> | ||
<v-row> | ||
<v-col> | ||
<v-text-field | ||
label="Tests" | ||
:value="tests" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
<v-col> | ||
<v-text-field | ||
label="Tests per Million" | ||
v-model="testPerMillion" | ||
disabled | ||
outlined | ||
></v-text-field> | ||
</v-col> | ||
</v-row> | ||
</v-container> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import { formatNumber } from '@/common/helper.js' | ||
export default { | ||
props: { | ||
country: { | ||
type: Object, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
cases() { | ||
return formatNumber(this.country.cases) | ||
}, | ||
recoveries() { | ||
return formatNumber(this.country.recovered) | ||
}, | ||
deaths() { | ||
return formatNumber(this.country.deaths) | ||
}, | ||
newCases() { | ||
return formatNumber(this.country.todayCases) | ||
}, | ||
newDeaths() { | ||
return formatNumber(this.country.todayDeaths) | ||
}, | ||
critical() { | ||
return formatNumber(this.country.critical) | ||
}, | ||
active() { | ||
return formatNumber(this.country.active) | ||
}, | ||
tests() { | ||
return formatNumber(this.country.tests) | ||
}, | ||
casesPerMillion() { | ||
return formatNumber(this.country.casesPerMillion) | ||
}, | ||
deathsPerMillion() { | ||
return formatNumber(this.country.deathsPerMillion) | ||
}, | ||
testPerMillion() { | ||
return formatNumber(this.country.testPerMillion) | ||
}, | ||
flag() { | ||
return this.country.countryInfo.flag ?? '' | ||
} | ||
}, | ||
mounted() { | ||
console.log(this.country) | ||
} | ||
} | ||
</script> | ||
<style lang="scss" scoped> | ||
h3 { | ||
margin-left: 10px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<template> | ||
<v-app-bar dark> | ||
<v-toolbar-title>COVIDvue</v-toolbar-title> | ||
<v-spacer /> | ||
<v-btn icon to="/"> | ||
<v-icon small>fas fa-home</v-icon> | ||
</v-btn> | ||
<v-btn icon to="/countries"> | ||
<v-icon small>fas fa-flag</v-icon> | ||
</v-btn> | ||
</v-app-bar> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import '@fortawesome/fontawesome-free/css/all.css' | ||
import Vue from 'vue' | ||
import Vuetify from 'vuetify/lib' | ||
|
||
Vue.use(Vuetify) | ||
|
||
export default new Vuetify({}) | ||
export default new Vuetify({ | ||
icons: { | ||
iconfont: 'fa' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,13 @@ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex' | ||
import CovidService from '@/services/covid.services' | ||
import * as countries from './modules/countries' | ||
import * as stats from './modules/stats' | ||
|
||
Vue.use(Vuex) | ||
|
||
export default new Vuex.Store({ | ||
state: { | ||
countries: [], | ||
overviewStats: {} | ||
}, | ||
mutations: { | ||
SET_COUNTRIES(state, data) { | ||
state.countries = data | ||
}, | ||
SET_OVERVIEW_STATS(state, data) { | ||
state.overviewStats = data | ||
} | ||
}, | ||
actions: { | ||
async fetchCountries({ commit }, filter) { | ||
const { data } = await CovidService.fetchCountries(filter) | ||
|
||
if (data != null) { | ||
commit('SET_COUNTRIES', data) | ||
} | ||
}, | ||
async fetchOverviewStats({ commit }) { | ||
const { data } = await CovidService.fetchWorldWide() | ||
|
||
if (data != null) { | ||
commit('SET_OVERVIEW_STATS', data) | ||
} | ||
} | ||
}, | ||
modules: {} | ||
modules: { | ||
countries, | ||
stats | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import CovidService from '@/services/covid.services' | ||
|
||
export const namespaced = true | ||
|
||
export const state = { | ||
countries: [], | ||
selected: null | ||
} | ||
|
||
export const mutations = { | ||
SET_COUNTRIES(state, data) { | ||
state.countries = data | ||
}, | ||
SET_SELECTED_COUNTRY(state, data) { | ||
state.selected = data | ||
} | ||
} | ||
|
||
export const actions = { | ||
async fetchCountries({ commit }, filter) { | ||
const { data } = await CovidService.fetchCountries(filter) | ||
|
||
if (data != null) { | ||
commit('SET_COUNTRIES', data) | ||
} | ||
}, | ||
async fetchByCountry({ commit }, code) { | ||
const { data } = await CovidService.fetchByCountry(code) | ||
|
||
if (data != null) { | ||
commit('SET_SELECTED_COUNTRY', data) | ||
} | ||
}, | ||
setSelectedCountry({ commit }, country) { | ||
commit('SET_SELECTED_COUNTRY', country) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import CovidService from '@/services/covid.services' | ||
|
||
export const namespaced = true | ||
|
||
export const state = { | ||
overview: {} | ||
} | ||
|
||
export const mutations = { | ||
SET_OVERVIEW_STATS(state, data) { | ||
state.overview = data | ||
} | ||
} | ||
|
||
export const actions = { | ||
async fetchOverviewStats({ commit }) { | ||
const { data } = await CovidService.fetchWorldWide() | ||
|
||
if (data != null) { | ||
commit('SET_OVERVIEW_STATS', data) | ||
} | ||
} | ||
} |
Oops, something went wrong.