Skip to content

Commit 280c6f1

Browse files
committed
feat: add docs
1 parent 1fbdbe7 commit 280c6f1

26 files changed

+3728
-78
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
dist/
2+
docs/
23
node_modules/

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"argsIgnorePattern": "^_"
3636
}
3737
],
38+
"@typescript-eslint/no-var-requires": "off",
3839
// `eslint-plugin-import`
3940
// https://github.com/benmosher/eslint-plugin-import
4041
"import/order": [

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.DS_Store
22
.eslintcache
33
dist/
4+
docs/.next/*
45
node_modules/
56
yarn-debug.log*
67
yarn-error.log*

README.md

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
`react-supabase` is a React Hooks library for [Supabase](https://supabase.io).
44

5-
With `react-supabase`, components can request and access data declaratively without needing to handle state updates on their own.
6-
75
<br/>
86

97
## Installation
@@ -57,82 +55,6 @@ const Todos = () => {
5755

5856
<br/>
5957

60-
### API
61-
62-
#### Auth
63-
64-
```js
65-
useAuthStateChange((event, session) => {
66-
console.log(`Supbase auth event: ${event}`, session)
67-
})
68-
```
69-
70-
```js
71-
const [{ error, fetching }, resetPassword] = useResetPassword({
72-
options: {
73-
redirectTo: 'https://example.com/welcome',
74-
},
75-
})
76-
77-
const { error } = await resetPassword('user@example.com', {
78-
redirectTo: 'https://example.com/reset',
79-
})
80-
```
81-
82-
```js
83-
const [{ error, fetching, user, session }, signIn] = useSignIn({
84-
// provider: 'github',
85-
options: {
86-
redirectTo: 'https://example.com/dashboard',
87-
// scopes: 'repo gist notifications',
88-
},
89-
})
90-
91-
const { error, session, user } = await signIn(
92-
{
93-
email: 'user@example.com',
94-
password: 'foobarbaz', // omit for magic link
95-
// provider: 'github',
96-
},
97-
{
98-
redirectTo: 'https://example.com/dashboard',
99-
// scopes: 'repo gist notifications',
100-
},
101-
)
102-
```
103-
104-
```js
105-
const [{ error, fetching }, signOut] = useSignOut()
106-
107-
const { error } = await signOut()
108-
```
109-
110-
```js
111-
const [{ error, fetching, user, session }, signUp] = useSignUp({
112-
options: {
113-
redirectTo: 'https://example.com/dashboard',
114-
},
115-
})
116-
117-
const { error, session, user } = await signUp(
118-
{
119-
email: 'user@example.com',
120-
password: 'foobarbaz',
121-
},
122-
{
123-
redirectTo: 'https://example.com/dashboard',
124-
},
125-
)
126-
```
127-
128-
#### Data
129-
130-
#### Realtime
131-
132-
#### Storage
133-
134-
<br/>
135-
13658
## License
13759

13860
The MIT License.

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `react-supabase` website
2+
3+
```
4+
yarn
5+
yarn dev
6+
```

docs/next-env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />

docs/next.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
const withNextra = require('nextra')('nextra-theme-docs', './theme.config.js')
2+
module.exports = withNextra()

docs/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "docs",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"dev": "next dev",
8+
"build": "next build"
9+
},
10+
"dependencies": {
11+
"next": "^10.2.0",
12+
"nextra": "^0.4.4",
13+
"nextra-theme-docs": "^1.1.6",
14+
"react": "^17.0.2",
15+
"react-dom": "^17.0.2"
16+
},
17+
"devDependencies": {
18+
"@types/react": "^17.0.4",
19+
"@types/react-dom": "^17.0.3",
20+
"typescript": "^4.2.4"
21+
}
22+
}

docs/pages/_app.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import 'nextra-theme-docs/style.css'
2+
3+
export default function Nextra({ Component, pageProps }) {
4+
return <Component {...pageProps} />
5+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"use-auth-state-change": "useAuthStateChange",
3+
"use-reset-password": "useResetPassword",
4+
"use-signin": "useSignIn",
5+
"use-signout": "useSignOut",
6+
"use-signup": "useSignUp"
7+
}

0 commit comments

Comments
 (0)