-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcomponent.ejs.t
More file actions
37 lines (32 loc) · 828 Bytes
/
component.ejs.t
File metadata and controls
37 lines (32 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
to: src/<%= h.changeCase.paramCase(folder) %>/<%= h.changeCase.pascalCase(componentName) %>.tsx
---
<%
ComponentName = h.changeCase.pascalCase(componentName);
%>
import React from "react";
import styled from "@emotion/styled";
const defaultProps = {
Wrapper: styled("div")`
display: flex;
width: 100%;
`,
Group: styled("div")`
display: flex;
`,
};
type Props = Readonly<typeof defaultProps & {}>;
type Children = (props: Props) => JSX.Element;
export const <%= ComponentName %> = ({children, ...props}: {children: Children} & Props) =>
children(props);
<%= ComponentName %>.defaultProps = {
...defaultProps,
children: ({Wrapper, Group}: Props) => (
<Wrapper>
<Group>A</Group>
<Group>B</Group>
<Group>C</Group>
</Wrapper>
),
};
export default <%= ComponentName %>;