Extract star/unstar button

This commit is contained in:
Oliver Davies 2018-12-26 13:37:23 +00:00
parent 838bb6b136
commit 7e1e2c0bd3
2 changed files with 18 additions and 8 deletions

View file

@ -0,0 +1,14 @@
<template>
<button type="button" @click="starred = !starred" class="focus:outline-none" :class="[starred ? 'text-orange hover:text-orange-light focus:text-orange-light' : 'text-grey focus:text-orange hover:text-orange']">
<span class="visuallyhidden">{{ !starred ? 'Star' : 'Unstar' }} {{ application.name }}</span>
<svg class="h-6 w-6 fill-current" role="presentation"><use :xlink:href="`/img/icons.symbol.svg#state__${starred ? 'starred' : 'unstarred'}`"></use></svg>
</button>
</template>
<script>
export default {
props: {
application: Object,
},
}
</script>