Skip to content

Commit

Permalink
fix: header layout action button initial flash
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Sep 9, 2024
1 parent a765cd2 commit 6758793
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 6 additions & 8 deletions src/renderer/src/modules/feed-column/corner-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,12 @@ const ActionIcon = ({
children?: React.ReactNode
}) => (
<Tooltip delayDuration={labelDelayDuration}>
<TooltipTrigger>
<button
type="button"
className="center size-6 rounded-md text-zinc-500 hover:bg-theme-button-hover"
onClick={onClick}
>
{children || <i className={className} />}
</button>
<TooltipTrigger
className="center size-6 rounded-md text-zinc-500 hover:bg-theme-button-hover"
onClick={onClick}
asChild
>
<button type="button">{children || <i className={className} />}</button>
</TooltipTrigger>
<TooltipContent align={tooltipAlign}>{label}</TooltipContent>
</Tooltip>
Expand Down
6 changes: 5 additions & 1 deletion src/renderer/src/modules/feed-column/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@ export const FeedColumnHeader = () => {
const LayoutActionButton = () => {
const feedColumnShow = useFeedColumnShow()

const [animation] = useState({
width: !feedColumnShow ? "auto" : 0,
})

return (
<m.div animate={{ width: !feedColumnShow ? "auto" : 0 }} className="overflow-hidden">
<m.div initial={animation} animate={animation} className="overflow-hidden">
<ActionButton
tooltip="Toggle Sidebar"
icon={
Expand Down

0 comments on commit 6758793

Please sign in to comment.