Merge pull request #15659 from JoVictorNunes/issue-15658

fix(whiteboard toolbar): reduce distance from the bottom
This commit is contained in:
Ramón Souza 2022-09-08 09:37:20 -03:00 committed by GitHub
commit 406c215add
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,7 @@ const SMALL_HEIGHT = 435;
const SMALLEST_HEIGHT = 363; const SMALLEST_HEIGHT = 363;
const TOOLBAR_SMALL = 28; const TOOLBAR_SMALL = 28;
const TOOLBAR_LARGE = 38; const TOOLBAR_LARGE = 38;
const TOOLBAR_OFFSET = 0;
const TldrawGlobalStyle = createGlobalStyle` const TldrawGlobalStyle = createGlobalStyle`
${({ hideContextMenu }) => hideContextMenu && ` ${({ hideContextMenu }) => hideContextMenu && `
@ -270,7 +271,7 @@ export default function Whiteboard(props) {
} }
if (props.height < SMALLEST_HEIGHT && tdTools) { if (props.height < SMALLEST_HEIGHT && tdTools) {
tldrawAPI?.setSetting('dockPosition', 'bottom'); tldrawAPI?.setSetting('dockPosition', 'bottom');
tdTools.parentElement.style.bottom = `${TOOLBAR_SMALL}px`; tdTools.parentElement.style.bottom = `${TOOLBAR_OFFSET}px`;
} }
// removes tldraw native help menu button // removes tldraw native help menu button
tdTools?.parentElement?.nextSibling?.remove(); tdTools?.parentElement?.nextSibling?.remove();