Skip to content

Commit

Permalink
fix: tweaking preview and data field creation
Browse files Browse the repository at this point in the history
  • Loading branch information
asartalo committed Jun 15, 2022
1 parent ce2d770 commit ada735b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/generatePage/createPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ export default [NAME]Page;
`;

function createDefaults(fields) {
return fields.map(({ fieldName, fieldDefault }) => ` ${fieldName}: ${JSON.stringify(fieldDefault)},`)
return fields
.map(({ fieldName, fieldDefault, fieldType }) => {
const defultValue = fieldType === 'boolean'
? fieldDefault
: JSON.stringify(fieldDefault);
return ` ${fieldName}: ${defultValue},`;
})
.join('\n');
}

Expand Down
1 change: 1 addition & 0 deletions scripts/generatePage/createPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const styles = makeStyles((theme) => ({
textAlign: 'center',
display: 'flex',
flexFlow: 'column',
width: '100%',
},
}));
Expand Down

0 comments on commit ada735b

Please sign in to comment.