forked from AkkomaGang/akkoma-fe
Add FollowRequestCard component
This commit is contained in:
parent
4b0a11acef
commit
390b2bcfee
2 changed files with 47 additions and 0 deletions
20
src/components/follow_request_card/follow_request_card.js
Normal file
20
src/components/follow_request_card/follow_request_card.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import BasicUserCard from '../basic_user_card/basic_user_card.vue'
|
||||
|
||||
const FollowRequestCard = {
|
||||
props: ['user'],
|
||||
components: {
|
||||
BasicUserCard
|
||||
},
|
||||
methods: {
|
||||
approveUser () {
|
||||
this.$store.state.api.backendInteractor.approveUser(this.user.id)
|
||||
this.$store.dispatch('removeFollowRequest', this.user)
|
||||
},
|
||||
denyUser () {
|
||||
this.$store.state.api.backendInteractor.denyUser(this.user.id)
|
||||
this.$store.dispatch('removeFollowRequest', this.user)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default FollowRequestCard
|
27
src/components/follow_request_card/follow_request_card.vue
Normal file
27
src/components/follow_request_card/follow_request_card.vue
Normal file
|
@ -0,0 +1,27 @@
|
|||
<template>
|
||||
<basic-user-card :user="user">
|
||||
<template slot="third-area">
|
||||
<div class="follow-request-card-action-buttons-container">
|
||||
<button class="btn btn-default" @click="approveUser">{{ $t('user_card.approve') }}</button>
|
||||
<button class="btn btn-default" @click="denyUser">{{ $t('user_card.deny') }}</button>
|
||||
</div>
|
||||
</template>
|
||||
</basic-user-card>
|
||||
</template>
|
||||
|
||||
<script src="./follow_request_card.js"></script>
|
||||
|
||||
<style lang="scss">
|
||||
.follow-request-card-action-buttons-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
button {
|
||||
margin-top: 0.5em;
|
||||
margin-right: 0.5em;
|
||||
flex: 1 1;
|
||||
max-width: 12em;
|
||||
min-width: 8em;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in a new issue