diff --git a/src/components/App.tsx b/src/components/App.tsx index 33901a7b4..472081bea 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -452,6 +452,7 @@ class App extends React.Component { const { onCollabButtonClick, onExportToBackend, + renderTopRight, renderFooter, renderCustomStats, } = this.props; @@ -492,6 +493,7 @@ class App extends React.Component { langCode={getLanguage().code} isCollaborating={this.props.isCollaborating || false} onExportToBackend={onExportToBackend} + renderTopRight={renderTopRight} renderCustomFooter={renderFooter} viewModeEnabled={viewModeEnabled} showExitZenModeBtn={ diff --git a/src/components/FixedSideContainer.scss b/src/components/FixedSideContainer.scss index c28037855..62b9869fd 100644 --- a/src/components/FixedSideContainer.scss +++ b/src/components/FixedSideContainer.scss @@ -1,6 +1,5 @@ .excalidraw { .FixedSideContainer { - --margin: 0.25rem; position: absolute; pointer-events: none; } @@ -10,9 +9,9 @@ } .FixedSideContainer_side_top { - left: var(--margin); - top: var(--margin); - right: var(--margin); + left: var(--space-factor); + top: var(--space-factor); + right: var(--space-factor); z-index: 2; } @@ -23,16 +22,16 @@ /* TODO: if these are used, make sure to implement RTL support .FixedSideContainer_side_left { - left: var(--margin); - top: var(--margin); - bottom: var(--margin); + left: var(--space-factor); + top: var(--space-factor); + bottom: var(--space-factor); z-index: 1; } .FixedSideContainer_side_right { - right: var(--margin); - top: var(--margin); - bottom: var(--margin); + right: var(--space-factor); + top: var(--space-factor); + bottom: var(--space-factor); z-index: 3; } */ diff --git a/src/components/LayerUI.scss b/src/components/LayerUI.scss index 60fba5acb..62d7a6b8e 100644 --- a/src/components/LayerUI.scss +++ b/src/components/LayerUI.scss @@ -55,19 +55,8 @@ } } - &__github-corner { - top: 0; - - :root[dir="ltr"] & { - right: 0; - } - - :root[dir="rtl"] & { - left: 0; - } - - position: absolute; - width: 40px; + &__top-right { + display: flex; } &__footer { diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index ebd6a6f79..8f8e92def 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -30,7 +30,6 @@ import CollabButton from "./CollabButton"; import { ErrorDialog } from "./ErrorDialog"; import { ExportCB, ExportDialog } from "./ExportDialog"; import { FixedSideContainer } from "./FixedSideContainer"; -import { GitHubCorner } from "./GitHubCorner"; import { HintViewer } from "./HintViewer"; import { exportFile, load, shield, trash } from "./icons"; import { Island } from "./Island"; @@ -68,6 +67,7 @@ interface LayerUIProps { appState: AppState, canvas: HTMLCanvasElement | null, ) => void; + renderTopRight?: (isMobile: boolean, appState: AppState) => JSX.Element; renderCustomFooter?: (isMobile: boolean) => JSX.Element; viewModeEnabled: boolean; libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"]; @@ -371,6 +371,7 @@ const LayerUI = ({ toggleZenMode, isCollaborating, onExportToBackend, + renderTopRight, renderCustomFooter, viewModeEnabled, libraryReturnUrl, @@ -604,24 +605,30 @@ const LayerUI = ({ )} )} - - {appState.collaborators.size > 0 && - Array.from(appState.collaborators) - // Collaborator is either not initialized or is actually the current user. - .filter(([_, client]) => Object.keys(client).length !== 0) - .map(([clientId, client]) => ( - - {actionManager.renderAction("goToCollaborator", clientId)} - - ))} - + + {appState.collaborators.size > 0 && + Array.from(appState.collaborators) + // Collaborator is either not initialized or is actually the current user. + .filter(([_, client]) => Object.keys(client).length !== 0) + .map(([clientId, client]) => ( + + {actionManager.renderAction("goToCollaborator", clientId)} + + ))} + + {renderTopRight?.(isMobile, appState)} + ); @@ -649,20 +656,6 @@ const LayerUI = ({ ); }; - const renderGitHubCorner = () => { - return ( - - ); - }; const renderFooter = () => (