Skip to content

Commit 5f7082e

Browse files
authored
Update description, name of snippets, and update GitPod (#15)
* feat: add more snippets, updated names, update GitPod * chore: update snippet description to match name
1 parent f17f08f commit 5f7082e

File tree

6 files changed

+107
-71
lines changed

6 files changed

+107
-71
lines changed

.gitpod.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
# This configuration file was automatically generated by Gitpod.
2-
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
3-
# and commit this file to your remote git repository to share the goodness with others.
4-
51
tasks:
62
- init: yarn install
73

4+
github:
5+
prebuilds:
6+
master: true
7+
branches: true
8+
pullRequests: true
9+
pullRequestsFromForks: true
10+
addCheck: true
11+
addComment: false
12+
addBadge: true

README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -18,93 +18,93 @@ NextJS and React Snippets with TypeScript support as well!🚀
1818

1919
```jsx
2020
const Component = () => {
21-
return <div></div>
22-
}
23-
export default Component
21+
return <div></div>;
22+
};
23+
export default Component;
2424
```
2525

2626
### TypeScript
2727

2828
2. `rafect` (React Functional Component with Types)
2929

3030
```tsx
31-
import { FC } from 'react'
31+
import { FC } from "react";
3232
interface Props {}
3333
const Component: FC<Props> = () => {
34-
return <div></div>
35-
}
36-
export default Component
34+
return <div></div>;
35+
};
36+
export default Component;
3737
```
3838

3939
## NextJS
4040

4141
### JavaScript
4242

43-
1. `nextssr` (Get Server Side Props Next.js)
43+
1. `nssr` (Next.js Get Server Side Props Typescript)
4444

4545
```jsx
4646
export const getServerSideProps = async (context) => {
4747
return {
4848
props: {},
49-
}
50-
}
49+
};
50+
};
5151
```
5252

53-
2. `nextssg` (Get Static Props Next.js)
53+
2. `nssg` (Next.js Get Static Props Typescript)
5454

5555
```jsx
5656
export const getStaticProps = async (context) => {
5757
return {
5858
props: {},
59-
}
60-
}
59+
};
60+
};
6161
```
6262

6363
### TypeScript
6464

65-
1. `nextssrt` (Get Server Side Props Next.js)
65+
1. `nssrt` (Next.js Get Server Side Props Typescript)
6666

6767
```tsx
6868
export const getServerSideProps: GetServerSideProps = async (context) => {
69-
return { props: {} }
70-
}
69+
return { props: {} };
70+
};
7171
```
7272

73-
2. `nextssgt` (Get Static Props Next.js)
73+
2. `nssgt` (Next.js Get Static Props Typescript)
7474

7575
```tsx
7676
export const getStaticProps: getStaticProps = async (context) => {
77-
return { props: {} }
78-
}
77+
return { props: {} };
78+
};
7979
```
8080

81-
3. `nextgip` (Get Initial Props in Next.js)
81+
3. `ngip` (Get Initial Props in Next.js)
8282

8383
```tsx
8484
Page.getInitialProps = async (context) => {
85-
return { props: {} }
86-
}
85+
return { props: {} };
86+
};
8787
```
8888

89-
3) `taytay` (NextPage component with NextPage type)
89+
3) `npt` (Next.js Page Typescript)
9090

9191
```tsx
92-
import type { NextPage } from 'next'
92+
import type { NextPage } from "next";
9393
const Page: NextPage = () => {
94-
return <></>
95-
}
96-
export default Page
94+
return <></>;
95+
};
96+
export default Page;
9797
```
9898

99-
4) `nextct` (Next JS Component with NextComponentType and Props)
99+
4) `nct` (Next.js Component Typescript)
100100

101101
```tsx
102-
import type { NextComponentType, NextPageContext } from 'next'
102+
import type { NextComponentType, NextPageContext } from "next";
103103
interface Props {}
104104
const Component: NextComponentType<NextPageContext, {}, Props> = (
105-
props: Props,
105+
props: Props
106106
) => {
107-
return <div></div>
108-
}
109-
export default Component
107+
return <div></div>;
108+
};
109+
export default Component;
110110
```
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"ssr": {
3-
"prefix": "nextssr",
3+
"prefix": "nssr",
44
"body": [
55
"export const getServerSideProps = async context => {",
66
" return {",
@@ -9,10 +9,10 @@
99
"};",
1010
""
1111
],
12-
"description": "Get Server Side Props Next.js"
12+
"description": "Next.js Get Server Side Props Typescript"
1313
},
1414
"ssg": {
15-
"prefix": "nextssg",
15+
"prefix": "nssg",
1616
"body": [
1717
"export const getStaticProps = async context => {",
1818
" return {",
@@ -21,6 +21,6 @@
2121
"};",
2222
""
2323
],
24-
"description": "Get Static Props Next.js"
24+
"description": "Next.js Get Static Props Typescript"
2525
}
26-
}
26+
}
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"ssrt": {
3-
"prefix": "nextssrt",
2+
"nssrt": {
3+
"prefix": "nssrt",
44
"body": [
55
"export const getServerSideProps: GetServerSideProps = async context => {",
66
" return {",
@@ -9,10 +9,10 @@
99
"};",
1010
""
1111
],
12-
"description": "Get Server Side Props Next.js"
12+
"description": "Next.js Get Server Side Props Typescript"
1313
},
14-
"ssgt": {
15-
"prefix": "nextssgt",
14+
"nssgt": {
15+
"prefix": "nssgt",
1616
"body": [
1717
"export const getStaticProps: getStaticProps = async context => {",
1818
" return {",
@@ -21,10 +21,10 @@
2121
"};",
2222
""
2323
],
24-
"description": "Get Static Props Next.js"
24+
"description": "Next.js Get Static Props Typescript"
2525
},
26-
"taytay": {
27-
"prefix": "taytay",
26+
"npt": {
27+
"prefix": "npt",
2828
"body": [
2929
"import type { NextPage } from \"next\";",
3030
"",
@@ -37,35 +37,35 @@
3737
"",
3838
"export default ${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}"
3939
],
40-
"description": "NextPage component with NextPage type"
41-
},
42-
"nextgip": {
43-
"prefix": "nextgip",
40+
"description": "Next.js Page Typescript"
41+
},
42+
"ngip": {
43+
"prefix": "ngip",
4444
"body": [
4545
"${1:${TM_FILENAME_BASE/(.*)/${1:/capitalize}/}}.getInitialProps = async context => {",
4646
" return {",
4747
" ",
4848
" };",
4949
"};",
50-
""
50+
""
5151
],
52-
"description": "Get Initial Props in Next.js"
53-
},
54-
"nct": {
55-
"prefix": "nextct",
56-
"body": [
57-
"import type { NextComponentType, NextPageContext } from \"next\";",
58-
"interface Props {}",
59-
"const ${1:${TM_FILENAME_BASE}}: NextComponentType<NextPageContext, {}, Props> = (",
52+
"description": "Next.js Get Initial Props"
53+
},
54+
"nct": {
55+
"prefix": "nct",
56+
"body": [
57+
"import type { NextComponentType, NextPageContext } from \"next\";",
58+
"interface Props {}",
59+
"const ${1:${TM_FILENAME_BASE}}: NextComponentType<NextPageContext, {}, Props> = (",
6060
" props: Props,",
6161
") => {",
62-
" return (",
62+
" return (",
6363
" <div></div>",
6464
" )",
65-
"}",
65+
"}",
6666
"",
6767
"export default ${1:${TM_FILENAME_BASE}}"
68-
],
69-
"description": "Next JS Component with NextComponentType and Props"
70-
}
71-
}
68+
],
69+
"description": "Next.js Component Typescript"
70+
}
71+
}

snippets/react-javascript.code-snippets

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
{
2+
"rfce": {
3+
"prefix": "rfce",
4+
"body": [
5+
"import React from 'react'",
6+
"",
7+
"function ${1:${TM_FILENAME_BASE}}() {",
8+
" return (",
9+
" <div></div>",
10+
" )",
11+
"}",
12+
"",
13+
"export default ${1:${TM_FILENAME_BASE}}"
14+
],
15+
"description": ""
16+
},
217
"rafce": {
318
"prefix": "rafce",
419
"body": [
@@ -11,4 +26,4 @@
1126
],
1227
"description": "React Functional Component"
1328
}
14-
}
29+
}

snippets/react-typescript.code-snippets

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
{
2+
"rfcet": {
3+
"prefix": "rfcet",
4+
"body": [
5+
"import React from \"react\";",
6+
"",
7+
"interface Props {}",
8+
"",
9+
"function ${1:${TM_FILENAME_BASE}}({}: Props) {",
10+
" return <div></div>;",
11+
"}",
12+
"",
13+
"export default ${1:${TM_FILENAME_BASE}};",
14+
""
15+
],
16+
"description": ""
17+
},
218
"rafcet": {
319
"prefix": "rafcet",
420
"body": [
@@ -13,4 +29,4 @@
1329
],
1430
"description": "React Functional Component with Types"
1531
}
16-
}
32+
}

0 commit comments

Comments
 (0)