feat: implement template component

This commit is contained in:
Walid 2022-04-11 16:28:07 +00:00
parent 788f848b0d
commit 0711a884a2
No known key found for this signature in database
GPG Key ID: 4BDA1ABD227F9279
3 changed files with 49 additions and 0 deletions

27
plopfile.js Normal file
View 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'
}
]
})
}

View 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>
}

View File

@ -0,0 +1,9 @@
@import 'mixins';
@import 'helpers';
.container {
@include display-flex(center, center, row);
@extend %container;
position: relative;
}