Skip to content

Commit 660b1ca

Browse files
committed
feat: Improve create Emotion component snippets
1 parent 20ddb43 commit 660b1ca

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

snippets/js.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
2-
"Create Emotion Component": {
2+
"Create Emotion component": {
33
"prefix": "cec",
44
"body": [
5-
"/** @jsx jsx **/",
6-
"import { jsx } from '@emotion/core'\n",
7-
"function ${1:Component}(props) {\n\t$2\n}\n"
5+
"/** @jsx jsx */",
6+
"import { jsx } from '@emotion/core';",
7+
"",
8+
"function ${TM_FILENAME_BASE/(^|-)([A-z0-9])/${2:/upcase}/g}({ $1 }) {",
9+
" return (",
10+
" $0",
11+
" )",
12+
"}"
813
],
914
"description": "Create Emotion component"
1015
}

snippets/ts.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
{
2-
"Create Emotion Component": {
2+
"Create Emotion component": {
33
"prefix": "cec",
44
"body": [
5-
"/** @jsx jsx **/",
6-
"import { jsx } from '@emotion/core';\n",
7-
"interface Props {\n\n}\n",
8-
"function ${1:Component}({}: Props) {\n\t$2\n}\n"
5+
"/** @jsx jsx */",
6+
"import { jsx } from '@emotion/core';",
7+
"",
8+
"type Props = {",
9+
" ",
10+
"}",
11+
"",
12+
"function ${TM_FILENAME_BASE/(^|-)([A-z0-9])/${2:/upcase}/g}({ $1 }: Props) {",
13+
" return (",
14+
" $0",
15+
" )",
16+
"}"
917
],
1018
"description": "Create Emotion component"
1119
}

0 commit comments

Comments
 (0)