Skip to content

Commit

Permalink
fix: adjust plop files templates sintaxe
Browse files Browse the repository at this point in the history
  • Loading branch information
flamarionfagundes committed Oct 10, 2022
1 parent 315f375 commit 20c5814
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
6 changes: 2 additions & 4 deletions generators/templates/component.tsx.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import * as S from './{{pascalCase name}}.styles';

export const {{pascalCase name}} = () => {
return (
<S.Wrapper>
<div>
<h1>{{pascalCase name}}</h1>
</S.Wrapper>
</div>
);
};
14 changes: 6 additions & 8 deletions generators/templates/stories.tsx.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';
import { Story } from '@storybook/react';
import { Meta, StoryObj } from '@storybook/react';
import { {{pascalCase name}} } from './{{pascalCase name}}';

const Template: Story = (args) => <{{pascalCase name}} {...args} />;

export const Default = Template.bind({});
Default.args = {};

export default {
title: 'components/{{pascalCase name}}',
component: {{pascalCase name}},
};
} as Meta;

export const Default: StoryObj = {};


2 changes: 1 addition & 1 deletion generators/templates/test.ts.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ describe('Testing the {{pascalCase name}} component', () => {
it('should render correctly', () => {
render(<{{pascalCase name}} />);

expect(screen.getByRole('div')).toBeInTheDocument();
expect(screen.getByRole('heading', { level: 1 })).toBeInTheDocument();
});
});
4 changes: 1 addition & 3 deletions generators/templates/types.ts.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export type {{pascalCase name}}Props = {
sample: string;
};
export type {{pascalCase name}}Props = { sample: string; };

1 comment on commit 20c5814

@vercel
Copy link

@vercel vercel bot commented on 20c5814 Oct 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.