Skip to content

Commit

Permalink
Fixed spacing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
njetsy committed Mar 20, 2023
1 parent 0ac2f14 commit 743c6be
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion component.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports.handlers = {
doclet.component.type = 'react'
}
doclet.kind = 'class'
doclet.type = 'component'
doclet.type = 'component'
} else {
if (path.extname(filePath) === '.vue') {
const docGen = vueDocs.parse(filePath)
Expand Down
2 changes: 1 addition & 1 deletion lib/load/fill-component-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const fillComponentPreview = (text, mdParser) => {
<div id="${uniqId}"></div>
<script>
ReactDOM.createRoot(document.getElementById('${uniqId}')).render(ReactWrapper({
ReactDOM.createRoot(document.getElementById('${uniqId}')).render(ReactWrapper({
example: ${JSON.stringify(group)},
uniqId: ${JSON.stringify(uniqId)},
}));
Expand Down
2 changes: 1 addition & 1 deletion lib/react-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function (_React$Component) {
var padding = 5; // buffer for any unstyled margins

if (this.iframeRef.current && this.iframeRef.current && this.iframeRef.current.contentDocument && this.iframeRef.current.contentDocument.body && this.iframeRef.current.contentDocument.body.offsetHeight !== 0 && this.iframeRef.current.contentDocument.body.offsetHeight !== height - padding) {
this.setState({
this.setState({
height: this.iframeRef.current.contentDocument.body.offsetHeight + padding
});
}
Expand Down
2 changes: 1 addition & 1 deletion publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) {
if (itemsNav !== '') {
var heading = itemHeading
if (subCategoryName) {
heading = heading === 'Globals' ? subCategoryName : heading + ' / ' + subCategoryName
heading = heading === 'Globals' ? subCategoryName : heading + ' / ' + subCategoryName
}
nav += '<h3>' + heading + '</h3><ul>' + itemsNav + '</ul>'
}
Expand Down
3 changes: 1 addition & 2 deletions src/react-wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ class Wrapper extends React.Component {
computeHeight() {
const { height } = this.state
const padding = 5 // buffer for any unstyled margins

if (
this.iframeRef.current
&& this.iframeRef.current.contentDocument
&& this.iframeRef.current.contentDocument.body
&& this.iframeRef.current.contentDocument.body
&& this.iframeRef.current.contentDocument.body.offsetHeight !== 0
&& this.iframeRef.current.contentDocument.body.offsetHeight !== (height - padding)
) {
Expand Down
2 changes: 1 addition & 1 deletion tmpl/react-component.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var uniqId = ['component', number].join('')
<div id='<?js= uniqId ?>'></div>

<script>
ReactDOM.createRoot(document.getElementById('<?js= uniqId ?>')).render(ReactWrapper({
ReactDOM.createRoot(document.getElementById('<?js= uniqId ?>')).render(ReactWrapper({
example: <?js= JSON.stringify(example.code || null) ?>,
uniqId: <?js= JSON.stringify(uniqId) ?>,
}));
Expand Down

0 comments on commit 743c6be

Please sign in to comment.