feat: implement template component
This commit is contained in:
parent
788f848b0d
commit
0711a884a2
27
plopfile.js
Normal file
27
plopfile.js
Normal file
@ -0,0 +1,27 @@
|
||||
module.exports = (
|
||||
/** @type {import('plop').NodePlopAPI} */
|
||||
plop
|
||||
) => {
|
||||
plop.setGenerator('component', {
|
||||
description: 'Generate a component',
|
||||
prompts: [
|
||||
{
|
||||
type: 'input',
|
||||
name: 'name',
|
||||
message: 'Component name'
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
type: 'add',
|
||||
path: 'components/{{properCase name}}/{{properCase name}}.tsx',
|
||||
templateFile: 'templates/Component/Component.tsx.hbs'
|
||||
},
|
||||
{
|
||||
type: 'add',
|
||||
path: 'components/{{properCase name}}/{{properCase name}}.module.scss',
|
||||
templateFile: 'templates/Component/component.module.scss.hbs'
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
13
templates/Component/Component.tsx.hbs
Normal file
13
templates/Component/Component.tsx.hbs
Normal file
@ -0,0 +1,13 @@
|
||||
import classNames from 'classNames'
|
||||
|
||||
import styles from './walidoux.module.scss'
|
||||
|
||||
interface WalidouxProps {
|
||||
className?: string
|
||||
}
|
||||
|
||||
export const Walidoux: React.FC<WalidouxProps> = (props) => {
|
||||
const { className } = props
|
||||
|
||||
return <div className={classNames(className, styles.container)}></div>
|
||||
}
|
9
templates/Component/component.module.scss.hbs
Normal file
9
templates/Component/component.module.scss.hbs
Normal file
@ -0,0 +1,9 @@
|
||||
@import 'mixins';
|
||||
@import 'helpers';
|
||||
|
||||
.container {
|
||||
@include display-flex(center, center, row);
|
||||
@extend %container;
|
||||
|
||||
position: relative;
|
||||
}
|
Loading…
Reference in New Issue
Block a user