Files
habitica/website/client/components/social/guilds/discovery/publicGuildItem.vue
T
Matteo Pagliazzi d9d7c69432 Client: async resources, make store reusable, move plugins and add getTaskFor getter (#8575)
Add library to manage async resource
Make Store reusable for easier testing
Move plugin to libs
Add getTaskFor getter with tests
2017-03-18 18:33:08 +01:00

31 lines
739 B
Vue

<template lang="pug">
.card
.card-block
.clearfix
router-link.float-left(:to="{ name: 'guild', params: { guildId: guild._id } }")
h3 {{ guild.name }}
button.btn.float-right(:class="[isMember ? 'btn-danger' : 'btn-success']") {{ isMember ? $t('leave') : $t('join') }}
p {{ guild.description }}
</template>
<style lang="scss" scoped>
.card {
margin-bottom: 1rem;
}
</style>
<script>
import { mapState } from 'client/libs/store';
import groupUtilities from 'client/mixins/groupsUtilities';
export default {
mixins: [groupUtilities],
props: ['guild'],
computed: {
...mapState({user: 'user.data'}),
isMember () {
return this.isMemberOfGroup(this.user, this.guild);
},
},
};
</script>