Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zaknesler committed Dec 3, 2024
1 parent d7ea909 commit ca349e8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/feed/feed-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const FeedInfo: Component<FeedInfoProps> = props => {
tooltip="Mark feed as read"
class="size-8 rounded-lg text-gray-500 md:size-6 md:rounded-md"
iconClass="size-5 md:size-4"
onClick={() => markFeedAsRead(feed.data!.uuid)}
onSelect={() => markFeedAsRead(feed.data!.uuid)}
/>

<FeedMenu
Expand Down
8 changes: 4 additions & 4 deletions ui/src/components/feed/feed-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@ export const FeedItem: Component<FeedItemProps> = props => {
<ContextMenu.Item
label="Mark feed as read"
icon={HiOutlineCheck}
onClick={() => markFeedAsRead(props.feed.uuid)}
onSelect={() => markFeedAsRead(props.feed.uuid)}
/>
<ContextMenu.Item
label="Refresh feed"
icon={HiOutlineArrowPath}
onClick={() => refreshFeed(props.feed.uuid)}
onSelect={() => refreshFeed(props.feed.uuid)}
iconClass={isRefreshing() && 'animate-spin'}
disabled={isRefreshing()}
/>
<ContextMenu.Separator />
<ContextMenu.Item
label="Move"
disabled={isRefreshing()}
onClick={() => openModal('moveFeed', { feed_uuid: props.feed.uuid })}
onSelect={() => openModal('moveFeed', { feed_uuid: props.feed.uuid })}
icon={HiOutlineFolder}
/>
<ContextMenu.Item label="Rename" disabled icon={HiOutlinePencilSquare} />
Expand Down Expand Up @@ -117,7 +117,7 @@ export const AllFeedsItem = () => {
<ContextMenu.Item label="Mark all as read" disabled icon={HiOutlineCheck} />
<ContextMenu.Item
label="Refresh all feeds"
onClick={() => refreshFeeds()}
onSelect={() => refreshFeeds()}
icon={HiOutlineArrowPath}
iconClass={!!notifications.feedsRefreshing().length && 'animate-spin'}
disabled={!!notifications.feedsRefreshing().length}
Expand Down
13 changes: 11 additions & 2 deletions ui/src/components/menus/menu-feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { HiOutlineArrowPath, HiOutlineFolder, HiOutlinePencilSquare, HiOutlineTr
import { type Component, mergeProps } from 'solid-js';
import { useNotifications } from '~/contexts/notification-context';
import { useRefreshFeed } from '~/hooks/queries/use-refresh-feed';
import { openModal } from '~/stores/modal';
import { Menu, type MenuProps } from './menu';

type FeedMenuProps = MenuProps & {
Expand All @@ -25,13 +26,21 @@ export const FeedMenu: Component<FeedMenuProps> = props => {
<Menu {...local} size="sm">
<Menu.Item
label="Refresh"
onClick={() => refreshFeed(props.uuid)}
onSelect={() => refreshFeed(props.uuid)}
icon={HiOutlineArrowPath}
iconClass={isRefreshing() && 'animate-spin'}
disabled={isRefreshing()}
/>

<Menu.Item label="Move" disabled icon={HiOutlineFolder} />
<Menu.Item
label="Move"
onSelect={() => {
console.log('clicky');
openModal('moveFeed', { feed_uuid: props.uuid });
}}
icon={HiOutlineFolder}
disabled={isRefreshing()}
/>
<Menu.Item label="Rename" disabled icon={HiOutlinePencilSquare} />
<Menu.Item label="Delete" disabled icon={HiOutlineTrash} />
</Menu>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/nav/nav-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const NavRow: Component<NavRowProps> = props => {
<div class="flex flex-1 items-center justify-end">
<Show when={props.showFeedSwitch}>
<ActionButton
onClick={() => props.setOpen(val => !val)}
onSelect={() => props.setOpen(val => !val)}
class="-m-1"
tooltip={props.open ? 'Hide feeds' : 'Show feeds'}
icon={props.open ? HiOutlineXMark : HiOutlineQueueList}
Expand All @@ -36,7 +36,7 @@ export const NavRow: Component<NavRowProps> = props => {

<Show when={props.showCloseButton}>
<ActionButton
onClick={() => navigate(state.getFeedUrl())}
onSelect={() => navigate(state.getFeedUrl())}
class="-m-1 ml-auto"
tooltip="Back to entries"
icon={HiOutlineXMark}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/panels/list-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const ListPanel = () => {
/>

<IconButton
onClick={() => refreshFeeds()}
onSelect={() => refreshFeeds()}
icon={HiOutlineArrowPath}
tooltip="Refresh all feeds"
class="z-10 size-8 rounded-lg text-gray-500 md:size-6 md:rounded-md"
Expand All @@ -138,7 +138,7 @@ export const ListPanel = () => {
/>

<IconButton
onClick={() => refreshFeeds()}
onSelect={() => refreshFeeds()}
icon={HiOutlineArrowPath}
tooltip="Refresh all feeds"
class="z-10 size-8 rounded-lg text-gray-500 md:size-6 md:rounded-md"
Expand Down

0 comments on commit ca349e8

Please sign in to comment.