Skip to content

Commit

Permalink
Marathon location icon component
Browse files Browse the repository at this point in the history
Related to Issue #44
  • Loading branch information
BobChao87 committed Nov 28, 2021
1 parent 5223627 commit 1eac1f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
3 changes: 1 addition & 2 deletions components/homepage/Marathons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
</ElementLink>
</ElementTableCell>
<ElementTableCell :key="marathonsList.key + 'location' + index" class="location" :class="getRowParity(index)">
<span v-if="marathon.onsite && marathon.country" class="icon flag-icon" :class="`flag-icon-${marathon.country.toLowerCase()}`" />
<FontAwesomeIcon v-else :icon="[ 'fas', 'desktop' ]" class="icon" />
<MarathonLocation :marathon="marathon" />
</ElementTableCell>
<ElementTableCell :key="marathonsList.key + 'language' + index" class="language" :class="getRowParity(index)">
{{ marathon.language.toLocaleUpperCase() }}
Expand Down
25 changes: 25 additions & 0 deletions components/marathon/Location.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<template>
<span v-if="marathon.onsite && marathon.country" class="icon flag-icon" :class="`flag-icon-${marathon.country.toLowerCase()}`" />
<FontAwesomeIcon v-else :icon="[ 'fas', 'desktop' ]" class="icon" />
</template>

<script lang="ts">
import Vue from 'vue';
import { FullMarathon, Marathon } from '~/types/api/marathon';
export default Vue.extend({
props: {
marathon: {
type: Object as () => Marathon|FullMarathon,
default: undefined,
},
},
});
</script>

<style lang="scss" scoped>
.icon {
display: flex;
justify-content: center;
}
</style>

0 comments on commit 1eac1f7

Please sign in to comment.