separate reply button to its own component, add changelog entry

This commit is contained in:
Shpuld Shpuldson 2020-09-07 10:35:49 +03:00
parent 40ca0b394e
commit f9ac23b9a9
5 changed files with 48 additions and 27 deletions

View file

@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
## [Unreleased patch]
### Added
- Proper handling of deletes when using websocket streaming
### Changed
- Polls will be hidden with status content if "Collapse posts with subjects" is enabled and the post is collapsed.

View file

@ -0,0 +1,12 @@
const ReplyButton = {
name: 'ReplyButton',
props: ['status', 'replying'],
computed: {
loggedIn () {
return !!this.$store.state.users.currentUser
}
}
}
export default ReplyButton

View file

@ -0,0 +1,21 @@
<template>
<div>
<i
v-if="loggedIn"
class="button-icon button-reply icon-reply"
:title="$t('tool_tip.reply')"
:class="{'-active': replying}"
@click.prevent="$emit('toggle')"
/>
<i
v-else
class="button-icon button-reply -disabled icon-reply"
:title="$t('tool_tip.reply')"
/>
<span v-if="status.replies_count > 0">
{{ status.replies_count }}
</span>
</div>
</template>
<script src="./reply_button.js"></script>

View file

@ -1,3 +1,4 @@
import ReplyButton from '../reply_button/reply_button.vue'
import FavoriteButton from '../favorite_button/favorite_button.vue'
import ReactButton from '../react_button/react_button.vue'
import RetweetButton from '../retweet_button/retweet_button.vue'
@ -20,6 +21,7 @@ import { mapGetters, mapState } from 'vuex'
const Status = {
name: 'Status',
components: {
ReplyButton,
FavoriteButton,
ReactButton,
RetweetButton,

View file

@ -321,21 +321,11 @@
v-if="!noHeading && !isPreview"
class="status-actions"
>
<div>
<i
v-if="loggedIn"
class="button-icon button-reply icon-reply"
:title="$t('tool_tip.reply')"
:class="{'-active': replying}"
@click.prevent="toggleReplying"
<reply-button
:replying="replying"
:status="status"
@toggle="toggleReplying"
/>
<i
v-else
class="button-icon button-reply -disabled icon-reply"
:title="$t('tool_tip.reply')"
/>
<span v-if="status.replies_count > 0">{{ status.replies_count }}</span>
</div>
<retweet-button
:visibility="status.visibility"
:logged-in="loggedIn"
@ -368,20 +358,13 @@
<div class="deleted-text">
{{ $t('status.status_deleted') }}
</div>
<div
v-if="replying"
class="status-actions"
>
<i
v-if="loggedIn"
class="button-icon button-reply icon-reply"
:title="$t('tool_tip.reply')"
:class="{'-active': replying}"
@click.prevent="toggleReplying"
<reply-button
:replying="replying"
:status="status"
@toggle="toggleReplying"
/>
</div>
</div>
</div>
<div
v-if="replying"
class="status-container reply-form"