Skip to content

Commit

Permalink
fix(ux): mark all read anim RSSNext#958 (RSSNext#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
yusixian authored Oct 16, 2024
1 parent 2c53ecb commit a079d85
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useOnClickOutside } from "usehooks-ts"
import { ActionButton, Button, IconButton } from "~/components/ui/button"
import { Kbd, KbdCombined } from "~/components/ui/kbd/Kbd"
import { RootPortal } from "~/components/ui/portal"
import { ElECTRON_CUSTOM_TITLEBAR_HEIGHT, HotKeyScopeMap, isElectronBuild } from "~/constants"
import { HotKeyScopeMap, isElectronBuild } from "~/constants"
import { shortcuts } from "~/constants/shortcuts"
import { useI18n } from "~/hooks/common"
import { cn, getOS } from "~/lib/utils"
Expand Down Expand Up @@ -46,15 +46,21 @@ export const MarkAllReadWithOverlay = forwardRef<
const $parent = containerRef.current!
const rect = $parent.getBoundingClientRect()
const paddingLeft = $parent.offsetLeft
// electron window has pt-[calc(var(--fo-window-padding-top)_-10px)]
const isElectronWindows = isElectronBuild && getOS() === "Windows"
return (
<RootPortal to={$parent}>
<m.div
ref={setPopoverRef}
initial={{ y: -70 }}
initial={{
y: isElectronWindows ? -95 : -70,
}}
animate={{
y: isElectronBuild && getOS() === "Windows" ? -ElECTRON_CUSTOM_TITLEBAR_HEIGHT : 0,
y: isElectronWindows ? -10 : 0,
}}
exit={{
y: isElectronWindows ? -95 : -70,
}}
exit={{ y: -70 }}
transition={{ type: "spring", damping: 20, stiffness: 300 }}
className="shadow-modal absolute z-50 bg-theme-modal-background-opaque shadow"
style={{
Expand Down

0 comments on commit a079d85

Please sign in to comment.