forked from AkkomaGang/akkoma-fe
Merge branch 'develop' of ssh.gitgud.io:lambadalambda/pleroma-fe into develop
This commit is contained in:
commit
bfbbb52767
5 changed files with 22 additions and 29 deletions
|
@ -2,25 +2,12 @@ import Timeline from '../timeline/timeline.vue'
|
||||||
|
|
||||||
const Mentions = {
|
const Mentions = {
|
||||||
computed: {
|
computed: {
|
||||||
username () {
|
|
||||||
return this.$route.params.username
|
|
||||||
},
|
|
||||||
timeline () {
|
timeline () {
|
||||||
return this.$store.state.statuses.timelines.mentions
|
return this.$store.state.statuses.timelines.mentions
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Timeline
|
Timeline
|
||||||
},
|
|
||||||
created () {
|
|
||||||
this.$store.state.api.backendInteractor.fetchMentions({username: this.username})
|
|
||||||
.then((mentions) => {
|
|
||||||
this.$store.dispatch('addNewStatuses', {
|
|
||||||
statuses: mentions,
|
|
||||||
timeline: 'mentions',
|
|
||||||
showImmediately: true
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border: none
|
border-bottom: none;
|
||||||
|
border-radius: 0 0 10px 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,18 +73,20 @@
|
||||||
<div class='status-actions'>
|
<div class='status-actions'>
|
||||||
<div>
|
<div>
|
||||||
<a href="#" v-on:click.prevent="toggleReplying">
|
<a href="#" v-on:click.prevent="toggleReplying">
|
||||||
<i class='fa icon-reply'></i>
|
<i class="fa icon-reply" :class="{'icon-reply-active': replying}"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<retweet-button :status=status></retweet-button>
|
<retweet-button :status=status></retweet-button>
|
||||||
<favorite-button :status=status></favorite-button>
|
<favorite-button :status=status></favorite-button>
|
||||||
<delete-button :status=status></delete-button>
|
<delete-button :status=status></delete-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<post-status-form v-if="replying" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying"></post-status-form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="status base00-background container" v-if="replying">
|
||||||
|
<div class="reply-left"/>
|
||||||
|
<post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying"/>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -141,6 +143,10 @@
|
||||||
color: $blue;
|
color: $blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icon-reply-active {
|
||||||
|
color: $blue;
|
||||||
|
}
|
||||||
|
|
||||||
.status .avatar {
|
.status .avatar {
|
||||||
width: 48px;
|
width: 48px;
|
||||||
}
|
}
|
||||||
|
@ -172,4 +178,14 @@
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
margin-top: 0.2em;
|
margin-top: 0.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reply-left {
|
||||||
|
flex: 0;
|
||||||
|
min-width: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.reply-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -62,12 +62,6 @@ const fetchAllFollowing = ({username, credentials}) => {
|
||||||
.then((data) => data.json())
|
.then((data) => data.json())
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchMentions = ({username, sinceId = 0, credentials}) => {
|
|
||||||
let url = `${MENTIONS_URL}?since_id=${sinceId}&screen_name=${username}`
|
|
||||||
return fetch(url, { headers: authHeaders(credentials) })
|
|
||||||
.then((data) => data.json())
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchConversation = ({id, credentials}) => {
|
const fetchConversation = ({id, credentials}) => {
|
||||||
let url = `${CONVERSATION_URL}/${id}.json?count=100`
|
let url = `${CONVERSATION_URL}/${id}.json?count=100`
|
||||||
return fetch(url, { headers: authHeaders(credentials) })
|
return fetch(url, { headers: authHeaders(credentials) })
|
||||||
|
@ -100,6 +94,7 @@ const fetchTimeline = ({timeline, credentials, since = false, until = false}) =>
|
||||||
const timelineUrls = {
|
const timelineUrls = {
|
||||||
public: PUBLIC_TIMELINE_URL,
|
public: PUBLIC_TIMELINE_URL,
|
||||||
friends: FRIENDS_TIMELINE_URL,
|
friends: FRIENDS_TIMELINE_URL,
|
||||||
|
mentions: MENTIONS_URL,
|
||||||
'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL
|
'publicAndExternal': PUBLIC_AND_EXTERNAL_TIMELINE_URL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +187,6 @@ const apiService = {
|
||||||
fetchTimeline,
|
fetchTimeline,
|
||||||
fetchConversation,
|
fetchConversation,
|
||||||
fetchStatus,
|
fetchStatus,
|
||||||
fetchMentions,
|
|
||||||
fetchFriends,
|
fetchFriends,
|
||||||
followUser,
|
followUser,
|
||||||
unfollowUser,
|
unfollowUser,
|
||||||
|
|
|
@ -10,10 +10,6 @@ const backendInteractorService = (credentials) => {
|
||||||
return apiService.fetchConversation({id, credentials})
|
return apiService.fetchConversation({id, credentials})
|
||||||
}
|
}
|
||||||
|
|
||||||
const fetchMentions = ({sinceId, username}) => {
|
|
||||||
return apiService.fetchMentions({sinceId, username, credentials})
|
|
||||||
}
|
|
||||||
|
|
||||||
const fetchFriends = () => {
|
const fetchFriends = () => {
|
||||||
return apiService.fetchFriends({credentials})
|
return apiService.fetchFriends({credentials})
|
||||||
}
|
}
|
||||||
|
@ -43,7 +39,6 @@ const backendInteractorService = (credentials) => {
|
||||||
const backendInteractorServiceInstance = {
|
const backendInteractorServiceInstance = {
|
||||||
fetchStatus,
|
fetchStatus,
|
||||||
fetchConversation,
|
fetchConversation,
|
||||||
fetchMentions,
|
|
||||||
fetchFriends,
|
fetchFriends,
|
||||||
followUser,
|
followUser,
|
||||||
unfollowUser,
|
unfollowUser,
|
||||||
|
|
Loading…
Reference in a new issue