mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe.git
synced 2025-02-24 14:13:04 +01:00
38 lines
814 B
JavaScript
38 lines
814 B
JavaScript
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
import { faRetweet } from '@fortawesome/free-solid-svg-icons'
|
|
|
|
library.add(faRetweet)
|
|
|
|
const RetweetButton = {
|
|
props: ['status', 'loggedIn', 'visibility'],
|
|
data () {
|
|
return {
|
|
animated: false
|
|
}
|
|
},
|
|
methods: {
|
|
retweet () {
|
|
if (!this.status.repeated) {
|
|
this.$store.dispatch('retweet', { id: this.status.id })
|
|
} else {
|
|
this.$store.dispatch('unretweet', { id: this.status.id })
|
|
}
|
|
this.animated = true
|
|
setTimeout(() => {
|
|
this.animated = false
|
|
}, 500)
|
|
}
|
|
},
|
|
computed: {
|
|
classes () {
|
|
return {
|
|
'-repeated': this.status.repeated
|
|
}
|
|
},
|
|
mergedConfig () {
|
|
return this.$store.getters.mergedConfig
|
|
}
|
|
}
|
|
}
|
|
|
|
export default RetweetButton
|