Skip to content

Commit

Permalink
馃悰 Fixed the issue with accepting spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
atapas committed Apr 11, 2022
1 parent 5fd571f commit 2a7cc5c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions plop-templates/component.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getPlayById } from 'meta/play-meta';

import PlayHeader from 'common/playlists/PlayHeader';

function {{component}}() {
function {{trim component}}() {
// Do not remove the below lines.
// The following code is to fetch the current play from the URL
const location = useLocation();
Expand All @@ -20,7 +20,7 @@ function {{component}}() {
<div className="play-details-body">
{/* Your Code Starts Here */}
<div>
<h1>Play Details - {{name}}</h1>
<h1>Play Details - {{titleCase name}}</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Pellentesque euismod, urna eu tincidunt consectetur,
Expand Down
2 changes: 1 addition & 1 deletion plop-templates/exportPlay.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as {{component}} } from 'plays/{{folder}}/{{component}}';
export { default as {{trim component}} } from 'plays/{{trim folder}}/{{trim component}}';
//add export here
2 changes: 1 addition & 1 deletion plop-templates/importToMeta.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{component}},
{{trim component}},
//import play here
6 changes: 3 additions & 3 deletions plop-templates/play.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
id: '{{dashCase id}}',
name: '{{name}}',
name: '{{titleCase name}}',
description: '{{description}}',
component: () => {return <{{component}} />},
path: '/plays/{{folder}}',
component: () => {return <{{trim component}} />},
path: '/plays/{{trim folder}}',
level: '{{level}}',
tags: '{{tags}}',
github: '{{github}}',
Expand Down
4 changes: 3 additions & 1 deletion plopfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = plop => {
plop.setHelper('trim', str => str.trim());

// demo generator
plop.setGenerator('play', {
description: 'Steps to add a new play',
Expand Down Expand Up @@ -65,7 +67,7 @@ module.exports = plop => {
actions: [
{
type: 'add',
path: 'src/plays/{{folder}}/{{component}}.js',
path: 'src/plays/{{trim folder}}/{{trim component}}.js',
templateFile: 'plop-templates/component.hbs',
},
{
Expand Down

0 comments on commit 2a7cc5c

Please sign in to comment.