mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
add context menu to navigate to feed if a category is displayed
This commit is contained in:
@@ -2,13 +2,14 @@ import { t, Trans } from "@lingui/macro"
|
||||
import { createStyles, Group } from "@mantine/core"
|
||||
import { Constants } from "app/constants"
|
||||
import { markEntriesUpToEntry, markEntry, starEntry } from "app/slices/entries"
|
||||
import { useAppDispatch } from "app/store"
|
||||
import { redirectToFeed } from "app/slices/redirect"
|
||||
import { useAppDispatch, useAppSelector } from "app/store"
|
||||
import { Entry } from "app/types"
|
||||
import { openLinkInBackgroundTab } from "app/utils"
|
||||
import { throttle } from "lodash"
|
||||
import { throttle, truncate } from "lodash"
|
||||
import { useEffect } from "react"
|
||||
import { Item, Menu, Separator, useContextMenu } from "react-contexify"
|
||||
import { TbArrowBarToDown, TbExternalLink, TbEyeCheck, TbEyeOff, TbStar, TbStarOff } from "react-icons/tb"
|
||||
import { TbArrowBarToDown, TbExternalLink, TbEyeCheck, TbEyeOff, TbRss, TbStar, TbStarOff } from "react-icons/tb"
|
||||
|
||||
interface FeedEntryContextMenuProps {
|
||||
entry: Entry
|
||||
@@ -30,6 +31,7 @@ const useStyles = createStyles(theme => ({
|
||||
const menuId = (entry: Entry) => entry.id
|
||||
export function FeedEntryContextMenu(props: FeedEntryContextMenuProps) {
|
||||
const { classes, theme } = useStyles()
|
||||
const sourceType = useAppSelector(state => state.entries.source.type)
|
||||
const dispatch = useAppDispatch()
|
||||
|
||||
return (
|
||||
@@ -59,27 +61,41 @@ export function FeedEntryContextMenu(props: FeedEntryContextMenuProps) {
|
||||
|
||||
<Separator />
|
||||
|
||||
<Item onClick={() => dispatch(markEntry({ entry: props.entry, read: !props.entry.read }))}>
|
||||
<Group>
|
||||
{props.entry.read ? <TbEyeOff size={iconSize} /> : <TbEyeCheck size={iconSize} />}
|
||||
{props.entry.read ? t`Keep unread` : t`Mark as read`}
|
||||
</Group>
|
||||
</Item>
|
||||
<Item onClick={() => dispatch(starEntry({ entry: props.entry, starred: !props.entry.starred }))}>
|
||||
<Group>
|
||||
{props.entry.starred ? <TbStarOff size={iconSize} /> : <TbStar size={iconSize} />}
|
||||
{props.entry.starred ? t`Unstar` : t`Star`}
|
||||
</Group>
|
||||
</Item>
|
||||
|
||||
<Separator />
|
||||
|
||||
<Item onClick={() => dispatch(markEntry({ entry: props.entry, read: !props.entry.read }))}>
|
||||
<Group>
|
||||
{props.entry.read ? <TbEyeOff size={iconSize} /> : <TbEyeCheck size={iconSize} />}
|
||||
{props.entry.read ? t`Keep unread` : t`Mark as read`}
|
||||
</Group>
|
||||
</Item>
|
||||
<Item onClick={() => dispatch(markEntriesUpToEntry(props.entry))}>
|
||||
<Group>
|
||||
<TbArrowBarToDown size={iconSize} />
|
||||
<Trans>Mark as read up to here</Trans>
|
||||
</Group>
|
||||
</Item>
|
||||
|
||||
{sourceType === "category" && (
|
||||
<>
|
||||
<Separator />
|
||||
|
||||
<Item
|
||||
onClick={() => {
|
||||
dispatch(redirectToFeed(props.entry.feedId))
|
||||
}}
|
||||
>
|
||||
<Group>
|
||||
<TbRss size={iconSize} />
|
||||
<Trans>Go to {truncate(props.entry.feedName)}</Trans>
|
||||
</Group>
|
||||
</Item>
|
||||
</>
|
||||
)}
|
||||
</Menu>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "انتقل إلى وثائق API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "اذهب إلى طريقة العرض \"الكل\""
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "الأشياء الجيدة"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Vés a la documentació de l'API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Vés a la vista Tot"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Bones"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Přejděte na dokumentaci API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Přejděte do zobrazení Vše"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Dobroty"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Ewch i'r ddogfennaeth API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Ewch i'r golwg Pawb"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "nwyddau"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Gå til API-dokumentationen."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Gå til visningen Alle"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Godbidder"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Gehen Sie zur API-Dokumentation."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Zur Ansicht Alle wechseln"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Gutes"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Go to the API documentation."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Go to the All view"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr "Go to {0}"
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Goodies"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Ir a la documentación de la API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Ir a la vista Todo"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "golosinas"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "به مستندات API بروید."
|
||||
msgid "Go to the All view"
|
||||
msgstr "به نمای All بروید"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "خوبی ها"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Siirry API-dokumentaatioon."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Siirry Kaikki-näkymään"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Hyvää"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Aller à la documentation de l'API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Aller à la catégorie Tout"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Extensions"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Ir á documentación da API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Ir á vista Todos"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "agasallos"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Nyissa meg az API dokumentációját."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Lépjen az Összes nézetre"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Jók"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Buka dokumentasi API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Pergi ke tampilan Semua"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Pernak-pernik"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Vai alla documentazione dell'API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Vai alla vista Tutto"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Chicche"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "API ドキュメントに移動します。"
|
||||
msgid "Go to the All view"
|
||||
msgstr "すべてのビューに移動"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "グッディーズ"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "API 문서로 이동합니다."
|
||||
msgid "Go to the All view"
|
||||
msgstr "전체 보기로 이동"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "굿즈"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Pergi ke dokumentasi API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Pergi ke paparan Semua"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr ""
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Gå til API-dokumentasjonen."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Gå til visningen Alle"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Godbiter"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Ga naar de API-documentatie."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Ga naar de weergave Alles"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Goederen"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Gå til API-dokumentasjonen."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Gå til visningen Alle"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Godbiter"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Przejdź do dokumentacji API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Przejdź do widoku Wszystkie"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Gadżety"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Vá para a documentação da API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Ir para a visualização Tudo"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Brindes"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Перейдите к документации по API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Перейти к представлению «Все»"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Сладости"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Prejdite na dokumentáciu API."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Prejdite na zobrazenie Všetky"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Dobrôtky"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "Gå till API-dokumentationen."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Gå till vyn Alla"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "Godsaker"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "API belgelerine gidin."
|
||||
msgid "Go to the All view"
|
||||
msgstr "Tümü görünümüne git"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "İyilikler"
|
||||
|
||||
@@ -324,6 +324,10 @@ msgstr "转到 API 文档。"
|
||||
msgid "Go to the All view"
|
||||
msgstr "转到全部视图"
|
||||
|
||||
#: src/components/content/FeedEntryContextMenu.tsx
|
||||
msgid "Go to {0}"
|
||||
msgstr ""
|
||||
|
||||
#: src/pages/app/AboutPage.tsx
|
||||
msgid "Goodies"
|
||||
msgstr "好东西"
|
||||
|
||||
Reference in New Issue
Block a user