Skip to content

Commit

Permalink
fix: hide sidebar count
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 23, 2024
1 parent 9d906d1 commit 81fc943
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 14 additions & 8 deletions src/renderer/src/modules/feed-column/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { setAppSearchOpen } from "@renderer/atoms/app"
import { getReadonlyRoute } from "@renderer/atoms/route"
import { useGeneralSettingKey } from "@renderer/atoms/settings/general"
import { useUISettingKey } from "@renderer/atoms/settings/ui"
import { useSidebarActiveView } from "@renderer/atoms/sidebar"
import { Logo } from "@renderer/components/icons/logo"
import { ActionButton } from "@renderer/components/ui/button"
Expand Down Expand Up @@ -161,6 +162,8 @@ export function FeedColumn({ children }: PropsWithChildren) {

const unreadByView = useUnreadByView()

const showSidebarUnreadCount = useUISettingKey("sidebarShowUnreadCount")

return (
<Vibrancy
className="relative flex h-full flex-col gap-3 pt-2.5"
Expand Down Expand Up @@ -211,22 +214,25 @@ export function FeedColumn({ children }: PropsWithChildren) {
shortcut={`${index + 1}`}
className={cn(
active === index && item.className,
"flex h-11 flex-col items-center gap-1 text-xl",
"flex flex-col items-center gap-1 text-xl",
"hover:!bg-theme-vibrancyBg",
showSidebarUnreadCount && "h-11",
)}
onClick={(e) => {
setActive(index)
e.stopPropagation()
}}
>
{item.icon}
<div className="text-[0.625rem] font-medium leading-none">
{unreadByView[index] > 99 ? (
<span className="-mr-0.5">99+</span>
) : (
unreadByView[index]
)}
</div>
{showSidebarUnreadCount && (
<div className="text-[0.625rem] font-medium leading-none">
{unreadByView[index] > 99 ? (
<span className="-mr-0.5">99+</span>
) : (
unreadByView[index]
)}
</div>
)}
</ActionButton>
))}
</div>
Expand Down
4 changes: 0 additions & 4 deletions src/renderer/src/modules/settings/tabs/general.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ export const SettingGeneral = () => {
"Automatically mark feed entries with only one level of content(e.g. Social Media, Picture, Video views) as read when the item is in the viewport.",
onChange: (value) => setGeneralSetting("renderMarkUnread", value),
},
{
type: "title",
value: "User Experience",
},

{
type: "title",
Expand Down

0 comments on commit 81fc943

Please sign in to comment.