-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Innei <i@innei.in>
- Loading branch information
Showing
8 changed files
with
116 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { createContextState } from "foxact/context-state" | ||
import { useContext } from "react" | ||
|
||
export const [ | ||
CollapseStateProvider, | ||
useCurrentCollapseId, | ||
useSetCurrentCollapseId, | ||
____CollapseStateContext, | ||
] = createContextState<string | null>(null) | ||
|
||
export const [ | ||
CollapseGroupItemStateProvider, | ||
useCollapseGroupItemState, | ||
useSetCollapseGroupItemState, | ||
____CollapseGroupItemStateContext, | ||
] = createContextState<Record<string, boolean>>({}) | ||
export const useCollapseId = () => useContext(____CollapseStateContext) | ||
export const useCollapseGroupItem = () => | ||
useContext(____CollapseGroupItemStateContext) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/renderer/src/modules/entry-content/entry-placeholder.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Logo } from "@renderer/components/icons/logo" | ||
import { stopPropagation } from "@renderer/lib/dom" | ||
import { cn } from "@renderer/lib/utils" | ||
import { useFeedHeaderTitle } from "@renderer/store/feed" | ||
|
||
import { useEntryContentPlaceholderLogoShow } from "./atoms" | ||
|
||
export const EntryPlaceholderLogo = () => { | ||
const title = useFeedHeaderTitle() | ||
|
||
const logoShow = useEntryContentPlaceholderLogoShow() | ||
|
||
return ( | ||
<div | ||
onContextMenu={stopPropagation} | ||
className={cn( | ||
"flex w-full min-w-0 flex-col items-center justify-center gap-1 text-balance px-12 pb-6 text-center text-lg font-medium text-zinc-400 duration-500", | ||
!logoShow && "translate-y-[-50px] opacity-0", | ||
)} | ||
> | ||
<Logo className="size-16 opacity-40 grayscale" /> | ||
<span className="max-w-[60ch]">{title}</span> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters