Skip to content

Commit

Permalink
feat(dashboard): small improvements on emotes statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
Satont committed May 5, 2024
1 parent 96e5d55 commit 96551fa
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,12 @@ onMounted(() => {
if (!chartContainer.value) return
chart = createChart(chartContainer.value, {
height: 240,
handleScroll: {
horzTouchDrag: false,
mouseWheel: false,
pressedMouseMove: false,
vertTouchDrag: false,
},
autoSize: true,
layout: {
textColor: 'white',
fontFamily: 'Inter',
background: { type: ColorType.Solid, color: 'transparent' },
},
handleScale: {
pinch: false,
mouseWheel: false,
axisDoubleClickReset: false,
axisPressedMouseMove: false,
},
rightPriceScale: {
borderColor: '#454545',
},
Expand Down Expand Up @@ -124,7 +112,7 @@ const tableTab = ref<'top' | 'history'>('top')
</script>

<template>
<div class="flex flex-col divide-y divide-white/30">
<div class="flex flex-col divide-y divide-white/10">
<h1 class="text-4xl font-medium px-6 py-6">
{{ emoteName }}
</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script setup lang="ts">
import { InfoIcon } from 'lucide-vue-next'
import { NScrollbar } from 'naive-ui'
import { BarChart } from 'lucide-vue-next'
import { NA, NScrollbar } from 'naive-ui'
import DialogOrSheet from '@/components/dialog-or-sheet.vue'
import { Button } from '@/components/ui/button'
import {
Dialog,
DialogTrigger,
Expand All @@ -18,9 +17,10 @@ defineEmits<{
<template>
<Dialog>
<DialogTrigger as-child>
<Button variant="secondary" size="icon" @click="$emit('select')">
<InfoIcon class="size-4" />
</Button>
<NA class="flex text-xs cursor-pointer items-center" @click="$emit('select')">
<span>Usage Stats</span>
<BarChart class="size-4 ml-1" />
</NA>
</DialogTrigger>
<DialogOrSheet class="p-0">
<NScrollbar style="max-height: 85vh" trigger="none">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ const chartOptions = computed<DeepPartial<TimeChartOptions>>(() => ({
handleScale: {
axisDoubleClickReset: false,
axisPressedMouseMove: false,
mouseWheel: false,
pinch: false,
},
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import {
useCommunityEmotesDetailsName,
} from '@/features/community-emotes-statistic/composables/use-community-emotes-details'
const props = defineProps<{
emoteName: string
}>()
const props = defineProps<{ emoteName: string }>()
const nameStore = useCommunityEmotesDetailsName()
function setDetailsName() {
Expand All @@ -16,7 +14,10 @@ function setDetailsName() {
</script>

<template>
<div class="flex gap-2">
<div class="flex flex-col gap-0.5 break-words max-w-[450px]">
<h1 class="text-xl">
{{ emoteName }}
</h1>
<CommunityEmotesDetails @select="setDetailsName" />
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import CommunityEmotesTableColumn from '../components/community-emotes-table-col

import { type EmotesStatistics, useEmotesStatisticQuery } from '@/api/emotes-statistic.js'
import { usePagination } from '@/composables/use-pagination.js'
import CommunityEmotesTableColumnActions
from '@/features/community-emotes-statistic/components/community-emotes-table-column-actions.vue'
import CommunityEmotesTableColumnEmote
from '@/features/community-emotes-statistic/components/community-emotes-table-column-emote.vue'
import { EmoteStatisticRange, type EmotesStatisticsOpts } from '@/gql/graphql'
import { valueUpdater } from '@/helpers/value-updater.js'

Expand Down Expand Up @@ -64,7 +64,7 @@ export const useCommunityEmotesStatisticTable = defineStore('features/community-
size: 5,
header: () => h('div', {}, t('community.emotesStatistic.table.emote')),
cell: ({ row }) => {
return h('div', { class: 'break-words max-w-[450px]', innerHTML: row.original.emoteName })
return h(CommunityEmotesTableColumnEmote, { emoteName: row.original.emoteName })
},
},
{
Expand All @@ -91,14 +91,6 @@ export const useCommunityEmotesStatisticTable = defineStore('features/community-
})
},
},
{
accessorKey: 'actions',
size: 10,
header: () => '',
cell: ({ row }) => {
return h(CommunityEmotesTableColumnActions, { emoteName: row.original.emoteName })
},
},
])

const table = useVueTable({
Expand Down

0 comments on commit 96551fa

Please sign in to comment.