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 Mar 5, 2025
1 parent 26d03b9 commit 2b03900
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ 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)
);

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

0 comments on commit 2b03900

Please sign in to comment.