Skip to content

Commit

Permalink
fix(page-editor-preview): hide editor toolbar artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsTheGlidingSquirrel committed Nov 29, 2024
1 parent 35d91de commit dd693dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/pages/___editor_preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function Content() {
value={{ editorVariant: 'serlo-org', userId: 'serlo-preview-user' }}
>
<main id="content" className="flex">
<section className="min-h-screen w-[50vw] border-4 border-r-0 border-editor-primary">
<section className="min-h-screen w-1/2 border-4 border-r-0 border-editor-primary">
<header className="mx-side flex justify-between align-middle font-bold">
<h2 className="mb-12 text-editor-primary">Edit</h2>
<div>
Expand Down Expand Up @@ -153,7 +153,7 @@ function Content() {
</header>
<div className="px-2">{editor}</div>
</section>
<section className="min-h-screen w-[50vw] border-4 border-editor-primary">
<section className="min-h-screen w-1/2 border-4 border-editor-primary">
<h2 className="mx-side mb-12 font-bold text-editor-primary">
Preview
</h2>
Expand Down
6 changes: 5 additions & 1 deletion packages/editor/src/core/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ export function Editor(props: EditorProps) {
// New store for every editor instance
const store = useMemo(() => createStore(), [])

const isSerloEditorPreviewPage =
window?.location?.href &&
window?.location?.href.includes('___editor_preview')

return (
<Provider store={store}>
<DndWrapper>
<HotkeysProvider initiallyActiveScopes={['global']}>
{/* only on serlo for now */}
{isSerlo ? (
<>
<EditorToolbar />
{isSerloEditorPreviewPage ? null : <EditorToolbar />}
<LocalStorageNotice
useStored={useStored}
setUseStored={setUseStored}
Expand Down

0 comments on commit dd693dd

Please sign in to comment.