@redzone/taunt-logins-ui-react 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/.history/babel.config_20251002171845.json +0 -0
  2. package/.history/babel.config_20251002171847.json +3 -0
  3. package/.history/babel.config_20251002172145.json +3 -0
  4. package/.history/babel.config_20251002172313.json +3 -0
  5. package/.history/babel.config_20251002172415.json +8 -0
  6. package/.history/package_20251002162605.json +35 -0
  7. package/.history/package_20251002162619.json +35 -0
  8. package/.history/package_20251002162631.json +35 -0
  9. package/.history/package_20251002162639.json +35 -0
  10. package/.history/package_20251002162659.json +35 -0
  11. package/.history/package_20251002162811.json +39 -0
  12. package/.history/package_20251002162820.json +39 -0
  13. package/.history/package_20251002171613.json +40 -0
  14. package/.history/package_20251002171644.json +40 -0
  15. package/.history/package_20251002171740.json +43 -0
  16. package/.history/package_20251002172017.json +43 -0
  17. package/.history/package_20251002172634.json +53 -0
  18. package/.history/package_20251002182812.json +52 -0
  19. package/.history/package_20251002183227.json +34 -0
  20. package/.history/package_20251002183258.json +42 -0
  21. package/.history/package_20251002202514.json +46 -0
  22. package/.history/package_20251002202542.json +46 -0
  23. package/.history/package_20251002202550.json +45 -0
  24. package/.history/package_20251002203503.json +46 -0
  25. package/.history/package_20251002204314.json +45 -0
  26. package/.history/package_20251002213111.json +45 -0
  27. package/.history/package_20251002222438.json +47 -0
  28. package/.history/package_20251002222511.json +45 -0
  29. package/.history/package_20251002222541.json +45 -0
  30. package/.history/src/App_20251002205122.tsx +54 -0
  31. package/.history/src/lib/index_20251002162704.ts +0 -0
  32. package/.history/src/lib/index_20251002162712.ts +1 -0
  33. package/{src/lib/taunt.ts → .history/src/lib/index_20251002182429.ts} +2 -0
  34. package/.history/src/lib/magic_20251002171038.tsx +50 -0
  35. package/.history/src/lib/metamask_20251002171636.tsx +27 -0
  36. package/.history/tsconfig.app_20251002172720.json +28 -0
  37. package/.history/vite.config_20251002182237.ts +19 -0
  38. package/.history/vite.config_20251002182326.ts +19 -0
  39. package/.history/vite.config_20251002182358.ts +19 -0
  40. package/.history/vite.config_20251002182434.ts +19 -0
  41. package/.history/vite.config_20251002182749.ts +26 -0
  42. package/.history/vite.config_20251002182810.ts +26 -0
  43. package/.history/vite.config_20251002184535.ts +36 -0
  44. package/.history/vite.config_20251002184720.ts +41 -0
  45. package/.history/vite.config_20251002184748.ts +37 -0
  46. package/.history/vite.config_20251002184844.ts +37 -0
  47. package/.history/vite.config_20251002201901.ts +45 -0
  48. package/.history/vite.config_20251002202019.ts +47 -0
  49. package/.history/vite.config_20251002202043.ts +47 -0
  50. package/.history/vite.config_20251002202502.ts +47 -0
  51. package/.history/vite.config_20251002203503.ts +43 -0
  52. package/asdf/tsconfig.app.json +28 -0
  53. package/asdf/tsconfig.json +7 -0
  54. package/asdf/tsconfig.node.json +26 -0
  55. package/package.json +21 -8
  56. package/src/App.tsx +2 -2
  57. package/src/lib/index.ts +4 -0
  58. package/src/lib/magic.tsx +2 -2
  59. package/src/lib/metamask.tsx +1 -1
  60. package/tsconfig.json +23 -5
  61. package/tsconfig.node.json +3 -19
  62. package/vite.config.ts +40 -7
  63. package/public/vite.svg +0 -1
  64. package/src/lib/exports.ts +0 -3
  65. /package/{tsconfig.app.json → .history/tsconfig.app_20251002141038.json} +0 -0
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc -b && vite build",
8
+ "prebabel-build": "npm run clean",
9
+ "prebuild": "npm run clean",
10
+ "clean": "rm -rf dist",
11
+ "lint": "eslint .",
12
+ "preview": "vite preview"
13
+ },
14
+ "main": "./dist/taunt-logins-ui-react.umd.js",
15
+ "module": "./dist/taunt-logins-ui-react.js",
16
+ "types": "./dist/taunt-logins-ui-react.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/taunt-logins-ui-react.js",
20
+ "require": "./dist/taunt-logins-ui-react.umd.js"
21
+ }
22
+ },
23
+ "dependencies": {
24
+ "@redzone/taunt-logins": "^0.0.3",
25
+ "react": "^19.1.1",
26
+ "react-dom": "^19.1.1"
27
+ },
28
+ "devDependencies": {
29
+ "@eslint/js": "^9.36.0",
30
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
31
+ "@types/node": "^24.6.0",
32
+ "@types/react": "^19.1.16",
33
+ "@types/react-dom": "^19.1.9",
34
+ "@vitejs/plugin-react": "^5.0.4",
35
+ "@vitejs/plugin-react-swc": "^4.1.0",
36
+ "eslint": "^9.36.0",
37
+ "eslint-plugin-react-hooks": "^5.2.0",
38
+ "eslint-plugin-react-refresh": "^0.4.22",
39
+ "globals": "^16.4.0",
40
+ "typescript": "~5.9.3",
41
+ "typescript-eslint": "^8.45.0",
42
+ "vite": "^7.1.7",
43
+ "vite-plugin-css-injected-by-js": "^3.5.2",
44
+ "vite-plugin-dts": "^4.5.4"
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebabel-build": "npm run clean",
9
+ "prebuild": "npm run clean",
10
+ "clean": "rm -rf dist",
11
+ "lint": "eslint .",
12
+ "preview": "vite preview"
13
+ },
14
+ "main": "./dist/taunt-logins-ui-react.umd.js",
15
+ "module": "./dist/taunt-logins-ui-react.js",
16
+ "types": "./dist/taunt-logins-ui-react.d.ts",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/taunt-logins-ui-react.js",
20
+ "require": "./dist/taunt-logins-ui-react.umd.js"
21
+ }
22
+ },
23
+ "dependencies": {
24
+ "@redzone/taunt-logins": "^0.0.3",
25
+ "react": "^19.1.1",
26
+ "react-dom": "^19.1.1"
27
+ },
28
+ "devDependencies": {
29
+ "@eslint/js": "^9.36.0",
30
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
31
+ "@types/node": "^24.6.0",
32
+ "@types/react": "^19.1.16",
33
+ "@types/react-dom": "^19.1.9",
34
+ "@vitejs/plugin-react": "^5.0.4",
35
+ "@vitejs/plugin-react-swc": "^4.1.0",
36
+ "eslint": "^9.36.0",
37
+ "eslint-plugin-react-hooks": "^5.2.0",
38
+ "eslint-plugin-react-refresh": "^0.4.22",
39
+ "globals": "^16.4.0",
40
+ "typescript": "~5.9.3",
41
+ "typescript-eslint": "^8.45.0",
42
+ "vite": "^7.1.7",
43
+ "vite-plugin-css-injected-by-js": "^3.5.2",
44
+ "vite-plugin-dts": "^4.5.4"
45
+ }
46
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@redzone/taunt-logins": "^0.0.3",
24
+ "react": "^19.1.1",
25
+ "react-dom": "^19.1.1"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@redzone/taunt-logins": "^0.0.3",
24
+ "react": "^19.1.1",
25
+ "react-dom": "^19.1.1"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite-plugin-css-injected-by-js": "^3.5.2",
42
+ "vite": ">=4.5.3",
43
+ "vite-plugin-dts": "^4.5.3",
44
+ "vitest": "^3.1.1"
45
+ }
46
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@redzone/taunt-logins": "^0.0.3",
24
+ "react": "^19.1.1",
25
+ "react-dom": "^19.1.1"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@redzone/taunt-logins": "^0.0.3",
24
+ "react": "^18.3.1",
25
+ "react-dom": "^18.3.1"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@redzone/taunt-logins": "^0.0.3"
24
+ },
25
+ "peerDependencies": {
26
+ "react": "^18.2.0",
27
+ "react-dom": "^18.2.0"
28
+ },
29
+ "devDependencies": {
30
+ "@eslint/js": "^9.36.0",
31
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
32
+ "@types/node": "^24.6.0",
33
+ "@types/react": "^19.1.16",
34
+ "@types/react-dom": "^19.1.9",
35
+ "@vitejs/plugin-react": "^5.0.4",
36
+ "@vitejs/plugin-react-swc": "^4.1.0",
37
+ "eslint": "^9.36.0",
38
+ "eslint-plugin-react-hooks": "^5.2.0",
39
+ "eslint-plugin-react-refresh": "^0.4.22",
40
+ "globals": "^16.4.0",
41
+ "typescript": "~5.9.3",
42
+ "typescript-eslint": "^8.45.0",
43
+ "vite": "^7.1.7",
44
+ "vite-plugin-css-injected-by-js": "^3.5.2",
45
+ "vite-plugin-dts": "^4.5.4"
46
+ }
47
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^18.2.0",
24
+ "react-dom": "^18.2.0",
25
+ "@redzone/taunt-logins": "^0.0.3"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@redzone/taunt-logins-ui-react",
3
+ "version": "0.0.5",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite",
7
+ "build": "tsc && vite build",
8
+ "prebuild": "npm run clean",
9
+ "clean": "rm -rf dist",
10
+ "lint": "eslint .",
11
+ "preview": "vite preview"
12
+ },
13
+ "main": "./dist/taunt-logins-ui-react.umd.js",
14
+ "module": "./dist/taunt-logins-ui-react.js",
15
+ "types": "./dist/taunt-logins-ui-react.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/taunt-logins-ui-react.js",
19
+ "require": "./dist/taunt-logins-ui-react.umd.js"
20
+ }
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^18.2.0",
24
+ "react-dom": "^18.2.0",
25
+ "@redzone/taunt-logins": "^0.0.3"
26
+ },
27
+ "devDependencies": {
28
+ "@eslint/js": "^9.36.0",
29
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
30
+ "@types/node": "^24.6.0",
31
+ "@types/react": "^19.1.16",
32
+ "@types/react-dom": "^19.1.9",
33
+ "@vitejs/plugin-react": "^5.0.4",
34
+ "@vitejs/plugin-react-swc": "^4.1.0",
35
+ "eslint": "^9.36.0",
36
+ "eslint-plugin-react-hooks": "^5.2.0",
37
+ "eslint-plugin-react-refresh": "^0.4.22",
38
+ "globals": "^16.4.0",
39
+ "typescript": "~5.9.3",
40
+ "typescript-eslint": "^8.45.0",
41
+ "vite": "^7.1.7",
42
+ "vite-plugin-css-injected-by-js": "^3.5.2",
43
+ "vite-plugin-dts": "^4.5.4"
44
+ }
45
+ }
@@ -0,0 +1,54 @@
1
+ // import "./App.css"
2
+
3
+ import { MagicEmailInput } from "./lib/magic"
4
+ import { MetaMaskButton } from "./lib/metamask"
5
+ import { useTaunt } from "./lib/tauntContext"
6
+ import { TauntProvider } from "./lib/tauntProvider"
7
+
8
+ function App() {
9
+ return (
10
+ <TauntProvider
11
+ tauntServiceEndpoint={process.env.VITE_TAUNT_SERVICE_ENDPOINT}
12
+ magicKey={process.env.VITE_MAGIC_KEY}>
13
+ <div
14
+ style={{
15
+ display: "flex",
16
+ flexDirection: "column",
17
+ gap: 8,
18
+ alignItems: "center"
19
+ }}>
20
+ <MagicEmailInput />
21
+ <MetaMaskButton />
22
+ <LogoutButton />
23
+ <TauntDeets />
24
+ </div>
25
+ </TauntProvider>
26
+ )
27
+ }
28
+
29
+ function LogoutButton() {
30
+ const { deets } = useTaunt()
31
+ if (!deets) return null
32
+
33
+ return (
34
+ <button
35
+ className="ml-2 p-2 bg-blue-500 text-white rounded-md"
36
+ type="button">
37
+ Logout
38
+ </button>
39
+ )
40
+ }
41
+
42
+ function TauntDeets() {
43
+ const { deets } = useTaunt()
44
+ return (
45
+ <textarea
46
+ rows={5}
47
+ cols={50}
48
+ value={JSON.stringify(deets, null, 2)}
49
+ readOnly
50
+ />
51
+ )
52
+ }
53
+
54
+ export default App
File without changes
@@ -0,0 +1 @@
1
+ export * from "./exports"
@@ -1,2 +1,4 @@
1
+ export * from "./magic"
2
+ export * from "./metamask"
1
3
  export * from "./tauntContext"
2
4
  export * from "./tauntProvider"
@@ -0,0 +1,50 @@
1
+ import { useCallback, useMemo, useState } from "react"
2
+
3
+ import "./styling.css"
4
+
5
+ import { useTaunt } from "./tauntContext"
6
+
7
+ export const MagicEmailInput = ({
8
+ onEmail
9
+ }: {
10
+ onEmail?: (email: string) => void
11
+ }) => {
12
+ const { otpMagicLogin } = useTaunt()
13
+ const [email, setEmail] = useState<string>()
14
+
15
+ const initialised = useMemo(() => email !== undefined, [email])
16
+
17
+ const validEmail = useMemo(() => {
18
+ const validRegex =
19
+ /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
20
+ return email?.match(validRegex) ? email : undefined
21
+ }, [email])
22
+
23
+ const runMagic = useCallback(() => {
24
+ if (!validEmail) return
25
+
26
+ if (onEmail) {
27
+ onEmail(email!)
28
+ } else {
29
+ otpMagicLogin(email!)
30
+ }
31
+ }, [validEmail, onEmail])
32
+
33
+ return (
34
+ <div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
35
+ {initialised && !validEmail && (
36
+ <div style={{ color: "red" }}>Please enter a valid email</div>
37
+ )}
38
+ <input
39
+ className="rdz-input"
40
+ onChange={(e) => setEmail(e.target.value ? e.target.value : undefined)}
41
+ placeholder="Enter your email"
42
+ type="email"
43
+ value={email}
44
+ />
45
+ <button className="rdz-button" onClick={runMagic} type="button">
46
+ Send Magic Link
47
+ </button>
48
+ </div>
49
+ )
50
+ }
@@ -0,0 +1,27 @@
1
+ import { useCallback } from "react"
2
+
3
+ import "./styling.css"
4
+
5
+ import { useTaunt } from "./tauntContext"
6
+
7
+ export const MetaMaskButton = ({
8
+ openMetamask
9
+ }: {
10
+ openMetamask?: () => void
11
+ }) => {
12
+ const { metamaskLogin } = useTaunt()
13
+
14
+ const runMetamask = useCallback(() => {
15
+ if (openMetamask) {
16
+ openMetamask()
17
+ } else {
18
+ metamaskLogin()
19
+ }
20
+ }, [metamaskLogin, openMetamask])
21
+
22
+ return (
23
+ <button className="rdz-button" onClick={runMetamask}>
24
+ Login with Metamask
25
+ </button>
26
+ )
27
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "types": ["vite/client"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+ "erasableSyntaxOnly": false,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noUncheckedSideEffectImports": true
26
+ },
27
+ "include": ["src"]
28
+ }
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.tsx"),
11
+ // name,
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.tsx"),
11
+ name,
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/index.tsx"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import path from "path"
2
+ import react from "@vitejs/plugin-react-swc"
3
+ import { defineConfig } from "vite"
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ build: {
9
+ lib: {
10
+ entry: path.resolve(__dirname, "src/lib/index.ts"),
11
+ name: "@redzone/taunt-logins-ui-react",
12
+ formats: ["es", "umd"],
13
+ fileName: (format) => `your-component.${format}.js`
14
+ }
15
+ },
16
+ server: {
17
+ open: true
18
+ }
19
+ })