feat: add friend count to buttons on friend page
This commit is contained in:
parent
f5457f9965
commit
b731228fb8
1 changed files with 7 additions and 3 deletions
|
@ -3,9 +3,9 @@
|
||||||
<DirectMessagesSidebar />
|
<DirectMessagesSidebar />
|
||||||
<div :id="$style['page-content']">
|
<div :id="$style['page-content']">
|
||||||
<div :id="$style['navigation-bar']">
|
<div :id="$style['navigation-bar']">
|
||||||
<Button text="All Friends" variant="neutral" :callback="() => updateFilter('all')" />
|
<Button :text="`All Friends – ${friends?.length}`" variant="neutral" :callback="() => updateFilter('all')" />
|
||||||
<Button text="Online" variant="neutral" :callback="() => updateFilter('online')" />
|
<Button :text="`Online – ${0}`" variant="neutral" :callback="() => updateFilter('online')" />
|
||||||
<Button text="Pending" variant="neutral" :callback="() => updateFilter('pending')" />
|
<Button :text="`Pending – ${0}`" variant="neutral" :callback="() => updateFilter('pending')" />
|
||||||
<Button text="Add Friend" variant="normal" :callback="() => updateFilter('add')" />
|
<Button text="Add Friend" variant="normal" :callback="() => updateFilter('add')" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -24,8 +24,12 @@ import Button from '~/components/UserInterface/Button.vue';
|
||||||
import AddFriend from '~/components/Me/AddFriend.vue';
|
import AddFriend from '~/components/Me/AddFriend.vue';
|
||||||
import FriendsList from '~/components/Me/FriendsList.vue';
|
import FriendsList from '~/components/Me/FriendsList.vue';
|
||||||
|
|
||||||
|
const { fetchFriends } = useApi();
|
||||||
|
|
||||||
let filter = ref("all");
|
let filter = ref("all");
|
||||||
|
|
||||||
|
const friends = await fetchFriends()
|
||||||
|
|
||||||
function updateFilter(newFilter: string) {
|
function updateFilter(newFilter: string) {
|
||||||
filter.value = newFilter;
|
filter.value = newFilter;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue