Skip to content

Commit

Permalink
fix: text color and dot background color
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jun 29, 2024
1 parent b3ea59e commit 9b80525
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
6 changes: 5 additions & 1 deletion src/renderer/src/hooks/biz/useAsRead.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { FEED_COLLECTION_LIST } from "@renderer/lib/constants"
import type { CombinedEntryModel } from "@renderer/models"

import { useRouteParamsSelector } from "./useRouteParams"

export function useAsRead(entry?: CombinedEntryModel) {
return useRouteParamsSelector(() => {
return useRouteParamsSelector((params) => {
if (params.feedId === FEED_COLLECTION_LIST) {
return false
}
if (!entry) return false
return entry.read
}, [entry?.read])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function GridItem({
return (
<div>
{children}
<div className={cn("relative flex-1 px-2 pb-3 pt-1 text-sm", !asRead && "before:absolute before:-left-1 before:top-[13.5px] before:block before:size-2 before:rounded-full before:bg-blue-500")}>
<div className={cn("relative flex-1 px-2 pb-3 pt-1 text-sm", !asRead && "before:absolute before:-left-1 before:top-[13.5px] before:block before:size-2 before:rounded-full before:bg-theme-accent")}>
<div
className={cn(
"relative mb-1 mt-1.5 truncate font-medium leading-none",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/entry-column/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function EntryItemImpl({ entry, view }: { entry: CombinedEntryModel, view?: numb
"rounded-md bg-theme-background transition-colors",
isActive &&
"bg-theme-item-active",
asRead ? "text-zinc-700" : "text-zinc-900 dark:text-white/90",
asRead ? "text-zinc-700 dark:text-neutral-400" : "text-zinc-900 dark:text-neutral-300",
)}
onClick={handleClick}
onDoubleClick={handleDoubleClick}
Expand Down
8 changes: 2 additions & 6 deletions src/renderer/src/modules/entry-column/list-item-template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function ListItem({
"relative flex py-3 pl-3 pr-2",
!asRead &&
"before:absolute before:-left-0.5 before:top-[18px] before:block before:size-2 before:rounded-full before:bg-theme-accent",

)}
>
<FeedIcon feed={entry.feeds} entry={entry.entries} />
Expand All @@ -41,7 +40,7 @@ export function ListItem({
className={cn(
"flex gap-1 text-[10px] font-bold",
asRead ? "text-zinc-400" : "text-zinc-500",
entry.collections && "text-zinc-600 dark:text-zinc-400",
entry.collections && "text-zinc-600 dark:text-zinc-500",
)}
>
<span className="truncate">{entry.feeds.title}</span>
Expand All @@ -60,8 +59,6 @@ export function ListItem({
"relative my-0.5 break-words",
!!entry.collections && "pr-4",
entry.entries.title ? withDetails && "font-medium" : "text-[13px]",
asRead ? "text-zinc-400 dark:text-neutral-500" : "text-zinc-500",
entry.collections && "text-neutral-700 dark:text-zinc-300",
)}
>
{entry.entries.title ? (
Expand All @@ -83,8 +80,7 @@ export function ListItem({
<div
className={cn(
"text-[13px]",
asRead ? "text-zinc-400 dark:text-neutral-500" : "text-zinc-500",
entry.collections && "text-neutral-700 dark:text-zinc-300",
asRead ? "text-zinc-400 dark:text-neutral-500" : "text-zinc-500 dark:text-neutral-400",
)}
>
<EntryTranslation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function SocialMediaItem({ entryId, entryPreview, translation }: Universa
// NOTE: prevent 0 height element, react virtuoso will not stop render any more
if (!entry) return <ReactVirtuosoItemPlaceholder />
return (
<div className={cn("relative flex w-full py-3 pl-3 pr-2", !asRead && "before:absolute before:-left-0.5 before:top-[22px] before:block before:size-2 before:rounded-full before:bg-blue-500")}>
<div className={cn("relative flex w-full py-3 pl-3 pr-2", !asRead && "before:absolute before:-left-0.5 before:top-[22px] before:block before:size-2 before:rounded-full before:bg-theme-accent")}>
<FeedIcon feed={entry.feeds} entry={entry.entries} size={28} />
<div className="min-w-0 flex-1">
<div className="-mt-0.5 line-clamp-5 flex-1 text-sm">
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/feed-column/category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function FeedCategoryImpl({
</span>
</div>
{!!unread && showUnreadCount && (
<div className="ml-2 text-xs text-zinc-500">{unread}</div>
<div className="ml-2 text-xs text-zinc-500 dark:text-neutral-400">{unread}</div>
)}
</div>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/modules/feed-column/item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ const FeedItemImpl = ({
)}
</div>
{showUnreadCount && !!feedUnread && (
<div className="ml-2 text-xs text-zinc-500">{feedUnread}</div>
<div className="ml-2 text-xs text-zinc-500 dark:text-neutral-400">{feedUnread}</div>
)}
</div>
)
Expand Down

0 comments on commit 9b80525

Please sign in to comment.