-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using @usewaypoint/email-builder base exports
- Loading branch information
Showing
4 changed files
with
8 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 2 additions & 15 deletions
17
packages/editor-sample/src/App/TemplatePanel/HtmlPanel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,13 @@ | ||
import React, { useMemo } from 'react'; | ||
import { renderToStaticMarkup } from 'react-dom/server'; | ||
|
||
import Reader from '@usewaypoint/email-builder/dist/Reader/core'; | ||
import { renderToStaticMarkup } from '@usewaypoint/email-builder'; | ||
|
||
import { useDocument } from '../../documents/editor/EditorContext'; | ||
|
||
import HighlightedCodePanel from './helper/HighlightedCodePanel'; | ||
|
||
export default function HtmlPanel() { | ||
const document = useDocument(); | ||
const code = useMemo(() => { | ||
return ( | ||
'<!DOCTYPE html>' + | ||
renderToStaticMarkup( | ||
<html> | ||
<body> | ||
<Reader document={document} rootBlockId="root" /> | ||
</body> | ||
</html> | ||
) | ||
); | ||
}, [document]); | ||
|
||
const code = useMemo(() => renderToStaticMarkup(document, { rootBlockId: 'root' }), [document]); | ||
return <HighlightedCodePanel type="html" value={code} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters