Skip to content

Commit

Permalink
feat: add loading spinner in show more + minor style enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILLIPS71 committed May 13, 2024
1 parent 8ec6277 commit 614942c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
import type { EncodeQueueRefetchQuery } from '@/__generated__/EncodeQueueRefetchQuery.graphql'

import { Button, Link, Table } from '@giantnodes/react'
import { IconProgressX } from '@tabler/icons-react'
import { IconCircleX } from '@tabler/icons-react'
import React from 'react'
import { graphql, useMutation, usePaginationFragment } from 'react-relay'

Expand Down Expand Up @@ -64,10 +64,10 @@ type EncodeQueueProps = {
}

const EncodeQueue: React.FC<EncodeQueueProps> = ({ $key }) => {
const { data, hasNext, loadNext } = usePaginationFragment<EncodeQueueRefetchQuery, EncodeQueueFragment_query$key>(
FRAGMENT,
$key
)
const { data, hasNext, isLoadingNext, loadNext } = usePaginationFragment<
EncodeQueueRefetchQuery,
EncodeQueueFragment_query$key
>(FRAGMENT, $key)

const [commit] = useMutation<EncodeQueueCancelMutation>(MUTATION)

Expand All @@ -86,7 +86,7 @@ const EncodeQueue: React.FC<EncodeQueueProps> = ({ $key }) => {

return (
<>
<Table headingless aria-label="encode table">
<Table headingless aria-label="encode queue" size="sm">
<Table.Head>
<Table.Column key="name" isRowHeader>
name
Expand Down Expand Up @@ -121,7 +121,7 @@ const EncodeQueue: React.FC<EncodeQueueProps> = ({ $key }) => {
item.node.status !== 'FAILED' && (
<div className="flex flex-row justify-end gap-2">
<Button color="neutral" size="xs" onPress={() => cancel(item.node)}>
<IconProgressX size={16} />
<IconCircleX size={16} />
</Button>
</div>
)}
Expand All @@ -134,7 +134,7 @@ const EncodeQueue: React.FC<EncodeQueueProps> = ({ $key }) => {

{hasNext && (
<div className="flex flex-row items-center justify-center p-2">
<Button size="xs" onPress={() => loadNext(8)}>
<Button isLoading={isLoadingNext} size="xs" onPress={() => loadNext(8)}>
Show more
</Button>
</div>
Expand Down
4 changes: 3 additions & 1 deletion app/src/components/interfaces/explore/table/ExploreTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const ExploreTable: React.FC<ExploreTableProps> = ({ $key }) => {
</Table.Cell>

<Table.Cell>
<Typography.Paragraph className="text-right">{filesize(item.size, { base: 2 })}</Typography.Paragraph>
<Typography.Paragraph className="text-sm text-right" variant="subtitle">
{filesize(item.size, { base: 2 })}
</Typography.Paragraph>
</Table.Cell>
</Table.Row>
)}
Expand Down

0 comments on commit 614942c

Please sign in to comment.