@@ -153,10 +153,12 @@ export const useEntryActions = ({
|
||||
view,
|
||||
entry,
|
||||
type,
|
||||
inList,
|
||||
}: {
|
||||
view?: number
|
||||
entry?: FlatEntryModel | null
|
||||
type?: "toolbar" | "entryList"
|
||||
inList?: boolean
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
@@ -624,7 +626,7 @@ export const useEntryActions = ({
|
||||
name: t("entry_actions.mark_as_read"),
|
||||
shortcut: shortcuts.entry.toggleRead.key,
|
||||
className: "i-mgc-round-cute-fi",
|
||||
hide: !!(!!populatedEntry.read || populatedEntry.collections),
|
||||
hide: !!(!!populatedEntry.read || populatedEntry.collections) || inList,
|
||||
onClick: () => {
|
||||
read.mutate(populatedEntry)
|
||||
},
|
||||
@@ -634,7 +636,7 @@ export const useEntryActions = ({
|
||||
name: t("entry_actions.mark_as_unread"),
|
||||
shortcut: shortcuts.entry.toggleRead.key,
|
||||
className: "i-mgc-round-cute-re",
|
||||
hide: !!(!populatedEntry.read || populatedEntry.collections),
|
||||
hide: !!(!populatedEntry.read || populatedEntry.collections) || inList,
|
||||
onClick: () => {
|
||||
unread.mutate(populatedEntry)
|
||||
},
|
||||
@@ -662,6 +664,7 @@ export const useEntryActions = ({
|
||||
feed?.ownerUserId,
|
||||
type,
|
||||
showSourceContent,
|
||||
inList,
|
||||
saveToObsidian,
|
||||
obsidianVaultPath,
|
||||
openTipModal,
|
||||
|
||||
@@ -36,7 +36,7 @@ export const BoostProgress = ({
|
||||
<i className="i-mgc-train-cute-fi mr-2 shrink-0" />
|
||||
{numberFormater.format(boostCount)}
|
||||
</span>
|
||||
<div className="relative flex h-3 w-full overflow-hidden rounded-3xl bg-gray-200 dark:bg-gray-800">
|
||||
<div className="relative flex h-3 w-full overflow-hidden rounded-3xl bg-gray-200 dark:bg-zinc-800">
|
||||
<div
|
||||
role="progressbar"
|
||||
aria-valuenow={boostCount}
|
||||
|
||||
@@ -9,7 +9,10 @@ import { useCurrentModal } from "~/components/ui/modal/stacked/hooks"
|
||||
import { useI18n } from "~/hooks/common"
|
||||
import { useBoostFeedMutation, useBoostStatusQuery } from "~/modules/boost/query"
|
||||
import { useWallet } from "~/queries/wallet"
|
||||
import { useFeedById } from "~/store/feed"
|
||||
import { feedIconSelector } from "~/store/feed/selector"
|
||||
|
||||
import { FeedIcon } from "../feed/feed-icon"
|
||||
import { BoostProgress } from "./boost-progress"
|
||||
import { BoostingContributors } from "./boosting-contributors"
|
||||
import { LevelBenefits } from "./level-benefits"
|
||||
@@ -36,6 +39,8 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => {
|
||||
boostFeedMutation.mutate({ feedId, amount: amountBigInt.toString() })
|
||||
}, [amountBigInt, boostFeedMutation, feedId])
|
||||
|
||||
const feed = useFeedById(feedId, feedIconSelector)
|
||||
|
||||
if (isLoading || !boostStatus) {
|
||||
return (
|
||||
<div className="center pointer-events-none grow -translate-y-16">
|
||||
@@ -46,12 +51,18 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => {
|
||||
|
||||
return (
|
||||
<div className="flex w-[80vw] max-w-[350px] flex-col gap-3">
|
||||
<div className="relative flex w-full grow flex-col items-center gap-3">
|
||||
<div className="center mt-4 flex text-xl font-bold">
|
||||
<i className="i-mgc-rocket-cute-fi mr-1.5 text-lg" />
|
||||
{t("boost.boost_feed")}
|
||||
</div>
|
||||
<div className="center flex flex-col gap-2">
|
||||
<FeedIcon className="mr-0" feed={feed} size={50} />
|
||||
|
||||
<h1 className="center mt-2 flex text-lg font-bold">
|
||||
<div className="center flex">
|
||||
<i className="i-mgc-rocket-cute-fi mr-1.5 text-lg" />
|
||||
{t("boost.boost_feed")}
|
||||
</div>
|
||||
<span>「{feed?.title}」</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div className="relative flex w-full grow flex-col items-center gap-3">
|
||||
<small className="center -mt-1 mb-2 gap-1 text-theme-vibrancyFg">
|
||||
{t("boost.boost_feed_description")}
|
||||
</small>
|
||||
|
||||
@@ -25,10 +25,12 @@ export const EntryItemWrapper: FC<
|
||||
style?: React.CSSProperties
|
||||
} & PropsWithChildren
|
||||
> = ({ entry, view, children, itemClassName, style }) => {
|
||||
const listId = useRouteParamsSelector((s) => s.listId)
|
||||
const { items } = useEntryActions({
|
||||
view,
|
||||
entry,
|
||||
type: "entryList",
|
||||
inList: !!listId,
|
||||
})
|
||||
|
||||
const { items: feedItems } = useFeedActions({
|
||||
|
||||
@@ -15,7 +15,7 @@ import { setGeneralSetting, useGeneralSettingKey } from "~/atoms/settings/genera
|
||||
import { setUISetting, useUISettingKey } from "~/atoms/settings/ui"
|
||||
import { useWhoami } from "~/atoms/user"
|
||||
import { ImpressionView } from "~/components/common/ImpressionTracker"
|
||||
import { FEED_COLLECTION_LIST, ROUTE_ENTRY_PENDING } from "~/constants"
|
||||
import { FEED_COLLECTION_LIST, ROUTE_ENTRY_PENDING, ROUTE_FEED_IN_LIST } from "~/constants"
|
||||
import { shortcuts } from "~/constants/shortcuts"
|
||||
import { useRouteParams } from "~/hooks/biz/useRouteParams"
|
||||
import { useAIDailyReportModal } from "~/modules/ai/ai-daily/useAIDailyReportModal"
|
||||
@@ -42,7 +42,8 @@ export const EntryListHeader: FC<{
|
||||
const os = getOS()
|
||||
|
||||
const titleAtBottom = IN_ELECTRON && os === "macOS"
|
||||
const isInCollectionList = feedId === FEED_COLLECTION_LIST
|
||||
const isInCollectionList =
|
||||
feedId === FEED_COLLECTION_LIST || feedId?.startsWith(ROUTE_FEED_IN_LIST)
|
||||
|
||||
const titleInfo = !!headerTitle && (
|
||||
<div className={!titleAtBottom ? "min-w-0 translate-y-1" : void 0}>
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
import { useUISettingKey } from "~/atoms/settings/ui"
|
||||
import { shortcuts } from "~/constants/shortcuts"
|
||||
import { useEntryActions, useEntryReadabilityToggle } from "~/hooks/biz/useEntryActions"
|
||||
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
|
||||
import { tipcClient } from "~/lib/client"
|
||||
import { parseHtml } from "~/lib/parse-html"
|
||||
import type { FlatEntryModel } from "~/store/entry"
|
||||
@@ -41,10 +42,12 @@ function EntryHeaderImpl({
|
||||
}) {
|
||||
const entry = useEntry(entryId)
|
||||
|
||||
const listId = useRouteParamsSelector((s) => s.listId)
|
||||
const { items } = useEntryActions({
|
||||
view,
|
||||
entry,
|
||||
type: "toolbar",
|
||||
inList: !!listId,
|
||||
})
|
||||
|
||||
const entryTitleMeta = useEntryTitleMeta()
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { FeedModel } from "@follow/models"
|
||||
|
||||
export const feedIconSelector = (feed: FeedModel) => {
|
||||
return {
|
||||
type: feed.type,
|
||||
ownerUserId: feed.ownerUserId,
|
||||
id: feed.id,
|
||||
title: feed.title,
|
||||
url: (feed as any).url || "",
|
||||
image: feed.image,
|
||||
siteUrl: feed.siteUrl,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user