1
0
Fork 0

feat(markdown): Handle final tutorial view with inline Example

This commit is contained in:
Joost De Cock 2022-10-12 14:54:35 +02:00
parent 8993b158f8
commit 82abdf2901
2 changed files with 214 additions and 7 deletions

View file

@ -96,7 +96,16 @@ const buildExample = (children, settings = { margin: 5 }, tutorial = false, pape
}
// Wrapper component dealing with the tabs and code view
const TabbedExample = ({ app, children, caption, tutorial, withHead, paperless, settings }) => {
const TabbedExample = ({
app,
children,
caption,
tutorial,
previewFirst,
withHead,
paperless,
settings,
}) => {
if (settings)
settings = {
margin: 5,
@ -105,7 +114,7 @@ const TabbedExample = ({ app, children, caption, tutorial, withHead, paperless,
else settings = { margin: 5 }
if (withHead) settings.measurements = { head: 300 }
const draft = buildExample(children, settings, tutorial, paperless)
if (tutorial)
if (tutorial && !previewFirst)
return (
<div className="my-8">
<Tabs tabs="Code, Preview, X-Ray">