Extract star/unstar button
This commit is contained in:
parent
838bb6b136
commit
7e1e2c0bd3
2 changed files with 18 additions and 8 deletions
14
src/components/Application/StarToggle.vue
Normal file
14
src/components/Application/StarToggle.vue
Normal 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>
|
Reference in a new issue