Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: get channel view count in channels #695

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions src/lib/components/Browse/Sections/ItemCarousel.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script lang="ts">
import IconViews from '$lib/assets/icons/IconViews.svelte'
import IconViewers from '$lib/assets/icons/IconViewers.svelte'
import IconDrawerVerification from '$lib/assets/icons/drawer/IconDrawerVerification.svelte'
// import IconBrowseItemPlay from '$lib/assets/icons/browse/IconBrowseItemPlay.svelte'
import { category_list } from '$lib/stores/channelStore'
import { getNumberInThousands } from '$lib/utils'

export let channel: any = {}

Expand All @@ -22,14 +23,19 @@
LIVE
</span>
{/if}
<div class="dropdown dropdown-bottom">
<label
for=""
class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none"
tabindex="-1">
<div
class="tooltip"
data-tip="{getNumberInThousands(channel.viewDetails?.count || 0)} views">
<span class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none">
<IconViews />
{getNumberInThousands(channel.viewDetails.count || 0)}
</span>
</div>
<div class="tooltip" data-tip="{getNumberInThousands(channel.memberCount || 0)} watching">
<span class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none">
<IconViewers />
{channel.memberCount || '0'}
</label>
{getNumberInThousands(channel.memberCount || 0)}
</span>
</div>
</div>
<div class="flex flex-wrap">
Expand All @@ -42,9 +48,6 @@
{/if}
</div>
</div>
<!-- <div class="flex justify-center w-full">
<IconBrowseItemPlay />
</div> -->
<div class="space-y-2">
<p class="text-2xl truncate text-white font-semibold">{channel.title || ''}</p>
<div class="flex flex-row items-center gap-2">
Expand Down
21 changes: 14 additions & 7 deletions src/lib/components/Browse/Sections/ItemChannel.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<script lang="ts">
import IconViews from '$lib/assets/icons/IconViews.svelte'
import IconViewers from '$lib/assets/icons/IconViewers.svelte'
import IconDrawerVerification from '$lib/assets/icons/drawer/IconDrawerVerification.svelte'
import { category_list } from '$lib/stores/channelStore'
import { getNumberInThousands } from '$lib/utils'

export let channel: any = {}
</script>
Expand All @@ -18,14 +20,19 @@
LIVE
</span>
{/if}
<div class="dropdown dropdown-bottom">
<label
for=""
class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none"
tabindex="-1">
<div
class="tooltip"
data-tip="{getNumberInThousands(channel.viewDetails?.count || 0)} views">
<span class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none">
<IconViews />
{getNumberInThousands(channel.viewDetails?.count || 0)}
</span>
</div>
<div class="tooltip" data-tip="{getNumberInThousands(channel.memberCount || 0)} watching">
<span class="btn btn-sm rounded-md font-medium gap-2 btn-neutral text-white border-none">
<IconViewers />
{channel.memberCount || '0'}
</label>
{getNumberInThousands(channel.memberCount || 0)}
</span>
</div>
</div>
<div class="flex flex-wrap">
Expand Down
10 changes: 7 additions & 3 deletions src/lib/components/Browse/Sections/ItemTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@
</td>
<td>
<div class="flex gap-4">
<!-- <div class="flex gap-2 my-3">
<div
class="flex gap-2 my-3 tooltip"
data-tip="{getNumberInThousands(channel.viewDetails?.count || 0)} views">
<IconViews />
<span>{getNumberInThousands(channel.viewDetails?.count || 0)}</span>
</div> -->
<div class="flex gap-2 my-3">
</div>
<div
class="flex gap-2 my-3 tooltip"
data-tip="{getNumberInThousands(channel.memberCount || 0)} watching">
<IconViewers />
<span>{getNumberInThousands(channel?.memberCount || 0)}</span>
</div>
Expand Down