Skip to content

Commit

Permalink
fix: floating panel respect namespace margin
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Feb 27, 2025
1 parent 8e41005 commit 11ffb29
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export const FloatingToolsPanel = ({ width }: Props) => {
const languageTag = useTranslationsSelector((c) => c.cursor?.language);
const languages = useTranslationsSelector((c) => c.languages);
const [fixedTopDistance, setFixedTopDistance] = useState(0);
const firstTranslationHasNamespace = useTranslationsSelector((c) =>
Boolean(c.translations?.[0].keyNamespace)
const needsNamespaceMargin = useTranslationsSelector(
(c) => Boolean(c.translations?.[0].keyNamespace) && c.view === 'LIST'
);

useEffect(() => {
Expand Down Expand Up @@ -75,7 +75,7 @@ export const FloatingToolsPanel = ({ width }: Props) => {
floatingBannerHeight
)}px + 100vh)`,
width,
marginTop: firstTranslationHasNamespace ? 7 : 0,
marginTop: needsNamespaceMargin ? 7 : 0,
}}
ref={containerRef}
>
Expand Down

0 comments on commit 11ffb29

Please sign in to comment.