@redzone/taunt-logins-ui-react 0.0.4 → 0.0.6
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.
- package/dist/App.d.ts +2 -0
- package/dist/lib/index.d.ts +4 -0
- package/dist/lib/magic.d.ts +3 -0
- package/dist/lib/metamask.d.ts +3 -0
- package/dist/lib/tauntContext.d.ts +12 -0
- package/dist/lib/tauntProvider.d.ts +5 -0
- package/dist/main.d.ts +1 -0
- package/dist/taunt-logins-ui-react.d.ts +2 -0
- package/dist/taunt-logins-ui-react.js +3089 -0
- package/dist/taunt-logins-ui-react.js.map +1 -0
- package/dist/taunt-logins-ui-react.umd.cjs +7 -0
- package/dist/taunt-logins-ui-react.umd.cjs.map +1 -0
- package/package.json +25 -16
- package/.history/index_20251002141038.html +0 -13
- package/.history/index_20251002141344.html +0 -13
- package/.history/package_20251002154235.json +0 -32
- package/.history/package_20251002160110.json +0 -33
- package/.history/package_20251002161109.json +0 -33
- package/.history/package_20251002161124.json +0 -32
- package/.history/package_20251002161826.json +0 -32
- package/.history/package_20251002162139.json +0 -32
- package/.history/package_20251002162605.json +0 -35
- package/.history/package_20251002162619.json +0 -35
- package/.history/package_20251002162631.json +0 -35
- package/.history/package_20251002162639.json +0 -35
- package/.history/package_20251002162659.json +0 -35
- package/.history/package_20251002162811.json +0 -39
- package/.history/package_20251002162820.json +0 -39
- package/.history/src/App_20251002141038.tsx +0 -35
- package/.history/src/App_20251002142848.tsx +0 -15
- package/.history/src/App_20251002152540.tsx +0 -15
- package/.history/src/App_20251002152831.tsx +0 -17
- package/.history/src/App_20251002153145.tsx +0 -18
- package/.history/src/App_20251002153323.tsx +0 -25
- package/.history/src/App_20251002153420.tsx +0 -32
- package/.history/src/App_20251002153429.tsx +0 -33
- package/.history/src/App_20251002153457.tsx +0 -39
- package/.history/src/App_20251002153516.tsx +0 -39
- package/.history/src/App_20251002153520.tsx +0 -39
- package/.history/src/App_20251002153546.tsx +0 -41
- package/.history/src/App_20251002154625.tsx +0 -41
- package/.history/src/App_20251002154740.tsx +0 -47
- package/.history/src/App_20251002154812.tsx +0 -47
- package/.history/src/App_20251002154841.tsx +0 -47
- package/.history/src/App_20251002154915.tsx +0 -54
- package/.history/src/App_20251002160347.tsx +0 -54
- package/.history/src/lib/exports_20251002160004.ts +0 -0
- package/.history/src/lib/exports_20251002160045.ts +0 -3
- package/.history/src/lib/index_20251002162704.ts +0 -0
- package/.history/src/lib/index_20251002162712.ts +0 -1
- package/.history/src/lib/magic_20251002142829.tsx +0 -0
- package/.history/src/lib/magic_20251002142848.tsx +0 -44
- package/.history/src/lib/magic_20251002152540.tsx +0 -28
- package/.history/src/lib/magic_20251002152543.tsx +0 -28
- package/.history/src/lib/magic_20251002152546.tsx +0 -28
- package/.history/src/lib/magic_20251002152802.tsx +0 -47
- package/.history/src/lib/magic_20251002154740.tsx +0 -47
- package/.history/src/lib/magic_20251002155035.tsx +0 -47
- package/.history/src/lib/magic_20251002160411.tsx +0 -49
- package/.history/src/lib/magic_20251002160428.tsx +0 -49
- package/.history/src/lib/magic_20251002161028.tsx +0 -50
- package/.history/src/lib/magic_20251002162134.tsx +0 -50
- package/.history/src/lib/metamask_20251002141612.tsx +0 -0
- package/.history/src/lib/metamask_20251002142622.tsx +0 -38
- package/.history/src/lib/metamask_20251002142654.tsx +0 -41
- package/.history/src/lib/metamask_20251002142726.tsx +0 -44
- package/.history/src/lib/metamask_20251002142848.tsx +0 -0
- package/.history/src/lib/metamask_20251002152802.tsx +0 -28
- package/.history/src/lib/metamask_20251002153516.tsx +0 -27
- package/.history/src/lib/metamask_20251002154228.tsx +0 -27
- package/.history/src/lib/metamask_20251002154523.tsx +0 -27
- package/.history/src/lib/metamask_20251002162122.tsx +0 -27
- package/.history/src/lib/styling_20251002154448.css +0 -0
- package/.history/src/lib/styling_20251002154523.css +0 -19
- package/.history/src/lib/styling_20251002154531.css +0 -19
- package/.history/src/lib/styling_20251002154544.css +0 -20
- package/.history/src/lib/styling_20251002154548.css +0 -19
- package/.history/src/lib/styling_20251002160446.css +0 -20
- package/.history/src/lib/styling_20251002160511.css +0 -23
- package/.history/src/lib/styling_20251002160515.css +0 -24
- package/.history/src/lib/styling_20251002160815.css +0 -24
- package/.history/src/lib/styling_20251002160910.css +0 -24
- package/.history/src/lib/styling_20251002160915.css +0 -24
- package/.history/src/lib/styling_20251002160952.css +0 -24
- package/.history/src/lib/styling_20251002161001.css +0 -24
- package/.history/src/lib/styling_20251002161011.css +0 -24
- package/.history/src/lib/styling_20251002161016.css +0 -24
- package/.history/src/lib/styling_20251002161036.css +0 -25
- package/.history/src/lib/tauntContext_20251002142359.ts +0 -0
- package/.history/src/lib/tauntContext_20251002142622.ts +0 -17
- package/.history/src/lib/tauntContext_20251002152540.ts +0 -22
- package/.history/src/lib/tauntContext_20251002152802.ts +0 -22
- package/.history/src/lib/tauntProvider_20251002142503.tsx +0 -0
- package/.history/src/lib/tauntProvider_20251002142622.tsx +0 -15
- package/.history/src/lib/tauntProvider_20251002143158.tsx +0 -19
- package/.history/src/lib/tauntProvider_20251002144018.tsx +0 -19
- package/.history/src/lib/tauntProvider_20251002152234.tsx +0 -40
- package/.history/src/lib/tauntProvider_20251002152802.tsx +0 -40
- package/.history/src/lib/tauntProvider_20251002153101.tsx +0 -49
- package/.history/src/lib/taunt_20251002160026.ts +0 -0
- package/.history/src/lib/taunt_20251002160045.ts +0 -2
- package/.history/src/main_20251002141038.tsx +0 -10
- package/.history/src/main_20251002141444.tsx +0 -12
- package/.history/src/main_20251002160347.tsx +0 -12
- package/.history/vite.config_20251002141038.ts +0 -7
- package/.history/vite.config_20251002141323.ts +0 -10
- package/.prettierrc.mjs +0 -22
- package/eslint.config.js +0 -23
- package/index.html +0 -13
- package/public/vite.svg +0 -1
- package/src/App.css +0 -42
- package/src/App.tsx +0 -54
- package/src/index.css +0 -68
- package/src/lib/magic.tsx +0 -50
- package/src/lib/metamask.tsx +0 -27
- package/src/lib/styling.css +0 -25
- package/src/lib/tauntContext.ts +0 -22
- package/src/lib/tauntProvider.tsx +0 -49
- package/src/main.tsx +0 -12
- package/tsconfig.app.json +0 -28
- package/tsconfig.json +0 -7
- package/tsconfig.node.json +0 -26
- package/vite.config.ts +0 -10
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MetaMaskButton = ({
|
|
6
|
-
openMetamask
|
|
7
|
-
}: {
|
|
8
|
-
openMetamask?: () => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { metamaskLogin } = useTaunt()
|
|
11
|
-
|
|
12
|
-
const runMetamask = useCallback(() => {
|
|
13
|
-
if (openMetamask) {
|
|
14
|
-
openMetamask()
|
|
15
|
-
} else {
|
|
16
|
-
metamaskLogin()
|
|
17
|
-
}
|
|
18
|
-
}, [metamaskLogin, openMetamask])
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
className="ml-2 p-2 bg-blue-500 text-white rounded-md"
|
|
23
|
-
onClick={runMetamask}
|
|
24
|
-
type="button">
|
|
25
|
-
Login with Metamask
|
|
26
|
-
</button>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MagicEmailInput = ({
|
|
6
|
-
onEmail
|
|
7
|
-
}: {
|
|
8
|
-
onEmail?: (email: string) => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { otpMagicLogin } = useTaunt()
|
|
11
|
-
const [email, setEmail] = useState<string>()
|
|
12
|
-
|
|
13
|
-
const initialised = useMemo(() => email !== undefined, [email])
|
|
14
|
-
|
|
15
|
-
const validEmail = useMemo(() => {
|
|
16
|
-
const validRegex =
|
|
17
|
-
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
18
|
-
return email?.match(validRegex) ? email : undefined
|
|
19
|
-
}, [email])
|
|
20
|
-
|
|
21
|
-
const runMagic = useCallback(() => {
|
|
22
|
-
if (!validEmail) return
|
|
23
|
-
|
|
24
|
-
if (onEmail) {
|
|
25
|
-
onEmail(email!)
|
|
26
|
-
} else {
|
|
27
|
-
otpMagicLogin(email!)
|
|
28
|
-
}
|
|
29
|
-
}, [validEmail, onEmail])
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div>
|
|
33
|
-
{initialised && !validEmail && (
|
|
34
|
-
<div style={{ color: "red" }}>Please enter a valid email</div>
|
|
35
|
-
)}
|
|
36
|
-
<input
|
|
37
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
38
|
-
placeholder="Enter your email"
|
|
39
|
-
type="email"
|
|
40
|
-
value={email}
|
|
41
|
-
/>
|
|
42
|
-
<button onClick={runMagic} type="button">
|
|
43
|
-
Send Magic Link
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MagicEmailInput = ({
|
|
6
|
-
onEmail
|
|
7
|
-
}: {
|
|
8
|
-
onEmail?: (email: string) => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { otpMagicLogin } = useTaunt()
|
|
11
|
-
const [email, setEmail] = useState<string>()
|
|
12
|
-
|
|
13
|
-
const initialised = useMemo(() => email !== undefined, [email])
|
|
14
|
-
|
|
15
|
-
const validEmail = useMemo(() => {
|
|
16
|
-
const validRegex =
|
|
17
|
-
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
18
|
-
return email?.match(validRegex) ? email : undefined
|
|
19
|
-
}, [email])
|
|
20
|
-
|
|
21
|
-
const runMagic = useCallback(() => {
|
|
22
|
-
if (!validEmail) return
|
|
23
|
-
|
|
24
|
-
if (onEmail) {
|
|
25
|
-
onEmail(email!)
|
|
26
|
-
} else {
|
|
27
|
-
otpMagicLogin(email!)
|
|
28
|
-
}
|
|
29
|
-
}, [validEmail, onEmail])
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
|
|
33
|
-
{initialised && !validEmail && (
|
|
34
|
-
<div style={{ color: "red" }}>Please enter a valid email</div>
|
|
35
|
-
)}
|
|
36
|
-
<input
|
|
37
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
38
|
-
placeholder="Enter your email"
|
|
39
|
-
type="email"
|
|
40
|
-
value={email}
|
|
41
|
-
/>
|
|
42
|
-
<button onClick={runMagic} type="button">
|
|
43
|
-
Send Magic Link
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo, useState } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MagicEmailInput = ({
|
|
6
|
-
onEmail
|
|
7
|
-
}: {
|
|
8
|
-
onEmail?: (email: string) => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { otpMagicLogin } = useTaunt()
|
|
11
|
-
const [email, setEmail] = useState<string>()
|
|
12
|
-
|
|
13
|
-
const initialised = useMemo(() => email !== undefined, [email])
|
|
14
|
-
|
|
15
|
-
const validEmail = useMemo(() => {
|
|
16
|
-
const validRegex =
|
|
17
|
-
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
18
|
-
return email?.match(validRegex) ? email : undefined
|
|
19
|
-
}, [email])
|
|
20
|
-
|
|
21
|
-
const runMagic = useCallback(() => {
|
|
22
|
-
if (!validEmail) return
|
|
23
|
-
|
|
24
|
-
if (onEmail) {
|
|
25
|
-
onEmail(email!)
|
|
26
|
-
} else {
|
|
27
|
-
otpMagicLogin(email!)
|
|
28
|
-
}
|
|
29
|
-
}, [validEmail, onEmail])
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
|
|
33
|
-
{initialised && !validEmail && (
|
|
34
|
-
<div style={{ color: "red" }}>Please enter a valid email</div>
|
|
35
|
-
)}
|
|
36
|
-
<input
|
|
37
|
-
onChange={(e) => setEmail(e.target.value ? e.target.value : undefined)}
|
|
38
|
-
placeholder="Enter your email"
|
|
39
|
-
type="email"
|
|
40
|
-
value={email}
|
|
41
|
-
/>
|
|
42
|
-
<button onClick={runMagic} type="button">
|
|
43
|
-
Send Magic Link
|
|
44
|
-
</button>
|
|
45
|
-
</div>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
onChange={(e) => setEmail(e.target.value ? e.target.value : undefined)}
|
|
40
|
-
placeholder="Enter your email"
|
|
41
|
-
type="email"
|
|
42
|
-
value={email}
|
|
43
|
-
/>
|
|
44
|
-
<button onClick={runMagic} type="button">
|
|
45
|
-
Send Magic Link
|
|
46
|
-
</button>
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
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
|
-
onChange={(e) => setEmail(e.target.value ? e.target.value : undefined)}
|
|
40
|
-
placeholder="Enter your email"
|
|
41
|
-
type="email"
|
|
42
|
-
value={email}
|
|
43
|
-
/>
|
|
44
|
-
<button className="rdz-button" onClick={runMagic} type="button">
|
|
45
|
-
Send Magic Link
|
|
46
|
-
</button>
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
class="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 class="rdz-button" onClick={runMagic} type="button">
|
|
46
|
-
Send Magic Link
|
|
47
|
-
</button>
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
File without changes
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { tauntMagicDidLogin } from "@redzone/taunt-logins"
|
|
2
|
-
import { useCallback, useMemo, useState } from "react"
|
|
3
|
-
|
|
4
|
-
export const Emailer = ({ onEmail }: { onEmail?: (email: string) => void }) => {
|
|
5
|
-
const [email, setEmail] = useState<string>()
|
|
6
|
-
|
|
7
|
-
const initialised = useMemo(() => email !== undefined, [email])
|
|
8
|
-
|
|
9
|
-
const validEmail = useMemo(() => {
|
|
10
|
-
const validRegex =
|
|
11
|
-
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
12
|
-
return email?.match(validRegex) ? email : undefined
|
|
13
|
-
}, [email])
|
|
14
|
-
|
|
15
|
-
const runMagic = useCallback(() => {
|
|
16
|
-
if (!validEmail) return
|
|
17
|
-
|
|
18
|
-
if (onEmail) {
|
|
19
|
-
onEmail(email!)
|
|
20
|
-
} else {
|
|
21
|
-
tauntMagicDidLogin(email!)
|
|
22
|
-
}
|
|
23
|
-
}, [validEmail, onEmail])
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div>
|
|
27
|
-
<input
|
|
28
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
29
|
-
placeholder="Enter your email"
|
|
30
|
-
type="email"
|
|
31
|
-
value={email}
|
|
32
|
-
/>
|
|
33
|
-
<button onClick={runMagic} type="button">
|
|
34
|
-
Send Magic Link
|
|
35
|
-
</button>
|
|
36
|
-
</div>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { tauntMagicDidLogin } from "@redzone/taunt-logins"
|
|
2
|
-
import { useCallback, useMemo, useState } from "react"
|
|
3
|
-
|
|
4
|
-
import { useTaunt } from "./tauntContext"
|
|
5
|
-
|
|
6
|
-
export const Emailer = ({ onEmail }: { onEmail?: (email: string) => void }) => {
|
|
7
|
-
const { tauntServiceEndpoint } = useTaunt()
|
|
8
|
-
const [email, setEmail] = useState<string>()
|
|
9
|
-
|
|
10
|
-
const initialised = useMemo(() => email !== undefined, [email])
|
|
11
|
-
|
|
12
|
-
const validEmail = useMemo(() => {
|
|
13
|
-
const validRegex =
|
|
14
|
-
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
15
|
-
return email?.match(validRegex) ? email : undefined
|
|
16
|
-
}, [email])
|
|
17
|
-
|
|
18
|
-
const runMagic = useCallback(() => {
|
|
19
|
-
if (!validEmail) return
|
|
20
|
-
|
|
21
|
-
if (onEmail) {
|
|
22
|
-
onEmail(email!)
|
|
23
|
-
} else {
|
|
24
|
-
tauntMagicDidLogin(tauntServiceEndpoint, email!)
|
|
25
|
-
}
|
|
26
|
-
}, [validEmail, onEmail])
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div>
|
|
30
|
-
<input
|
|
31
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
32
|
-
placeholder="Enter your email"
|
|
33
|
-
type="email"
|
|
34
|
-
value={email}
|
|
35
|
-
/>
|
|
36
|
-
<button onClick={runMagic} type="button">
|
|
37
|
-
Send Magic Link
|
|
38
|
-
</button>
|
|
39
|
-
</div>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { tauntMagicDidLogin } from "@redzone/taunt-logins"
|
|
2
|
-
import { useCallback, useMemo, useState } from "react"
|
|
3
|
-
|
|
4
|
-
import { useTaunt } from "./tauntContext"
|
|
5
|
-
|
|
6
|
-
export const Emailer = ({ onEmail }: { onEmail?: (email: string) => void }) => {
|
|
7
|
-
const { tauntServiceEndpoint } = useTaunt()
|
|
8
|
-
const [email, setEmail] = useState<string>()
|
|
9
|
-
|
|
10
|
-
const initialised = useMemo(() => email !== undefined, [email])
|
|
11
|
-
|
|
12
|
-
const validEmail = useMemo(() => {
|
|
13
|
-
const validRegex =
|
|
14
|
-
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
|
|
15
|
-
return email?.match(validRegex) ? email : undefined
|
|
16
|
-
}, [email])
|
|
17
|
-
|
|
18
|
-
const runMagic = useCallback(() => {
|
|
19
|
-
if (!validEmail) return
|
|
20
|
-
|
|
21
|
-
if (onEmail) {
|
|
22
|
-
onEmail(email!)
|
|
23
|
-
} else {
|
|
24
|
-
tauntMagicDidLogin(tauntServiceEndpoint, email!)
|
|
25
|
-
}
|
|
26
|
-
}, [validEmail, onEmail])
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<div>
|
|
30
|
-
{initialised && !validEmail && (
|
|
31
|
-
<div style={{ color: "red" }}>Please enter a valid email</div>
|
|
32
|
-
)}
|
|
33
|
-
<input
|
|
34
|
-
onChange={(e) => setEmail(e.target.value)}
|
|
35
|
-
placeholder="Enter your email"
|
|
36
|
-
type="email"
|
|
37
|
-
value={email}
|
|
38
|
-
/>
|
|
39
|
-
<button onClick={runMagic} type="button">
|
|
40
|
-
Send Magic Link
|
|
41
|
-
</button>
|
|
42
|
-
</div>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MetaMaskButton = ({
|
|
6
|
-
openMetamask
|
|
7
|
-
}: {
|
|
8
|
-
openMetamask?: () => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { metamaskLogin } = useTaunt()
|
|
11
|
-
|
|
12
|
-
const runMetamask = useCallback(() => {
|
|
13
|
-
if (openMetamask) {
|
|
14
|
-
openMetamask()
|
|
15
|
-
} else {
|
|
16
|
-
metamaskLogin()
|
|
17
|
-
}
|
|
18
|
-
}, [metamaskLogin, openMetamask])
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
className="ml-2 p-2 bg-blue-500 text-white rounded-md"
|
|
23
|
-
onClick={runMetamask}
|
|
24
|
-
type="button">
|
|
25
|
-
Login with Metamask
|
|
26
|
-
</button>
|
|
27
|
-
)
|
|
28
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MetaMaskButton = ({
|
|
6
|
-
openMetamask
|
|
7
|
-
}: {
|
|
8
|
-
openMetamask?: () => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { metamaskLogin } = useTaunt()
|
|
11
|
-
|
|
12
|
-
const runMetamask = useCallback(() => {
|
|
13
|
-
if (openMetamask) {
|
|
14
|
-
openMetamask()
|
|
15
|
-
} else {
|
|
16
|
-
metamaskLogin()
|
|
17
|
-
}
|
|
18
|
-
}, [metamaskLogin, openMetamask])
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
className="ml-2 p-2 bg-blue-500 text-white rounded-md"
|
|
23
|
-
onClick={runMetamask}>
|
|
24
|
-
Login with Metamask
|
|
25
|
-
</button>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react"
|
|
2
|
-
|
|
3
|
-
import { useTaunt } from "./tauntContext"
|
|
4
|
-
|
|
5
|
-
export const MetaMaskButton = ({
|
|
6
|
-
openMetamask
|
|
7
|
-
}: {
|
|
8
|
-
openMetamask?: () => void
|
|
9
|
-
}) => {
|
|
10
|
-
const { metamaskLogin } = useTaunt()
|
|
11
|
-
|
|
12
|
-
const runMetamask = useCallback(() => {
|
|
13
|
-
if (openMetamask) {
|
|
14
|
-
openMetamask()
|
|
15
|
-
} else {
|
|
16
|
-
metamaskLogin()
|
|
17
|
-
}
|
|
18
|
-
}, [metamaskLogin, openMetamask])
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<button
|
|
22
|
-
className="ml-2 p-2 bg-blue-500 text-white rounded-md"
|
|
23
|
-
onClick={runMetamask}>
|
|
24
|
-
Login with Metamask
|
|
25
|
-
</button>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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 class="rdz-button" onClick={runMetamask}>
|
|
24
|
-
Login with Metamask
|
|
25
|
-
</button>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
File without changes
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
button.rdz-button {
|
|
2
|
-
border-radius: 8px;
|
|
3
|
-
border: 1px solid transparent;
|
|
4
|
-
padding: 0.6em 1.2em;
|
|
5
|
-
font-size: 1em;
|
|
6
|
-
font-weight: 500;
|
|
7
|
-
font-family: inherit;
|
|
8
|
-
background-color: #1a1a1a;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
transition: border-color 0.25s;
|
|
11
|
-
|
|
12
|
-
&:hover {
|
|
13
|
-
border-color: #646cff;
|
|
14
|
-
}
|
|
15
|
-
&:focus,
|
|
16
|
-
&:focus-visible {
|
|
17
|
-
outline: 4px auto -webkit-focus-ring-color;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
button.rdz-button {
|
|
2
|
-
border-radius: 80px;
|
|
3
|
-
border: 1px solid transparent;
|
|
4
|
-
padding: 0.6em 1.2em;
|
|
5
|
-
font-size: 1em;
|
|
6
|
-
font-weight: 500;
|
|
7
|
-
font-family: inherit;
|
|
8
|
-
background-color: #1a1a1a;
|
|
9
|
-
cursor: pointer;
|
|
10
|
-
transition: border-color 0.25s;
|
|
11
|
-
|
|
12
|
-
&:hover {
|
|
13
|
-
border-color: #646cff;
|
|
14
|
-
}
|
|
15
|
-
&:focus,
|
|
16
|
-
&:focus-visible {
|
|
17
|
-
outline: 4px auto -webkit-focus-ring-color;
|
|
18
|
-
}
|
|
19
|
-
}
|