Skip to content

Commit

Permalink
feat: move hideExtraBadge
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Oct 29, 2024
1 parent 73d2c30 commit 2f14c30
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export const GridItemFooter = ({
<div className="flex items-center gap-1 truncate text-[13px]">
<FeedIcon fallback className="mr-0.5 flex" feed={feeds!} entry={entry.entries} size={18} />
<span className={cn("min-w-0 truncate", descriptionClassName)}>
<FeedTitle feed={feeds!} />
<FeedTitle feed={feeds} />
</span>
<span className={cn("text-zinc-500", timeClassName)}>·</span>
<span className={cn("text-zinc-500", timeClassName)}>
Expand Down
2 changes: 0 additions & 2 deletions apps/renderer/src/modules/feed-column/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { memo, useCallback, useState } from "react"
import { useTranslation } from "react-i18next"

import { getMainContainerElement } from "~/atoms/dom"
import { useUISettingKey } from "~/atoms/settings/ui"
import { useFeedActions, useInboxActions, useListActions } from "~/hooks/biz/useFeedActions"
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
Expand Down Expand Up @@ -94,7 +93,6 @@ const FeedItemImpl = ({ view, feedId, className }: FeedItemProps) => {
useAnyPointDown(() => {
isContextMenuOpen && setIsContextMenuOpen(false)
})
const hideExtraBadge = useUISettingKey("hideExtraBadge")
if (!feed) return null

const isFeed = feed.type === "feed" || !feed.type
Expand Down
15 changes: 12 additions & 3 deletions apps/renderer/src/modules/feed/feed-title.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { FeedOrListRespModel } from "@follow/models/types"
import { cn } from "@follow/utils/utils"

import { useUISettingKey } from "~/atoms/settings/ui"
import { BoostCertification } from "~/modules/boost/boost-certification"
import { FeedCertification } from "~/modules/feed/feed-certification"
import { getPreferredTitle } from "~/store/feed/store"
Expand All @@ -10,15 +11,23 @@ export const FeedTitle = ({
className,
title,
}: {
feed: FeedOrListRespModel
feed: FeedOrListRespModel | null
className?: string
title?: string | null
}) => {
const hideExtraBadge = useUISettingKey("hideExtraBadge")

if (!feed) return null

return (
<div className={cn("flex items-center truncate", className)}>
<div className="truncate">{title || getPreferredTitle(feed)}</div>
<FeedCertification feed={feed} />
<BoostCertification feed={feed} />
{!hideExtraBadge && (
<>
<FeedCertification feed={feed} />
<BoostCertification feed={feed} />
</>
)}
</div>
)
}

0 comments on commit 2f14c30

Please sign in to comment.