Skip to content

Commit

Permalink
feat: add is refreshing indicator
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 29, 2024
1 parent 9db3ef5 commit 0686ebe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/renderer/src/components/ui/media.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const MediaImpl: FC<MediaProps> = ({
className={cn(
hidden && "hidden",
!(props.width || props.height) && "size-full",
"bg-stone-100 object-cover dark:bg-neutral-800",
"bg-gray-200 object-cover dark:bg-neutral-800",
popper && "cursor-zoom-in",
mediaContainerClassName,
)}
Expand Down
12 changes: 11 additions & 1 deletion src/renderer/src/modules/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
import { useMe } from "@renderer/atoms/user"
import { m } from "@renderer/components/common/Motion"
import { EmptyIcon } from "@renderer/components/icons/empty"
import { AutoResizeHeight } from "@renderer/components/ui/auto-resize-height"
import { ActionButton, StyledButton } from "@renderer/components/ui/button"
import { DividerVertical } from "@renderer/components/ui/divider"
import { LoadingCircle } from "@renderer/components/ui/loading"
Expand Down Expand Up @@ -137,6 +138,7 @@ export function EntryColumn() {
} satisfies VirtuosoProps<string, unknown>

const navigate = useNavigateEntry()
const isRefreshing = entries.isFetching && !entries.isFetchingNextPage
return (
<div
className="relative flex h-full flex-1 flex-col"
Expand All @@ -148,10 +150,18 @@ export function EntryColumn() {
>
<ListHeader
refetch={entries.refetch}
isRefreshing={entries.isFetching && !entries.isFetchingNextPage}
isRefreshing={isRefreshing}
totalCount={virtuosoOptions.totalCount}
hasUpdate={entries.hasUpdate}
/>
<AutoResizeHeight spring>
{isRefreshing && (
<div className="center h-7 gap-2 bg-theme-accent text-xs text-white">
<LoadingCircle size="small" />
Refreshing new entries...
</div>
)}
</AutoResizeHeight>
<m.div
key={`${routeFeedId}-${view}`}
className="h-full"
Expand Down

0 comments on commit 0686ebe

Please sign in to comment.