+4
-21
atproto-notifications/src/components/SecretPassword.jsx
+4
-21
atproto-notifications/src/components/SecretPassword.jsx
···
2
import { PostJson } from './Fetch';
3
4
export function SecretPassword({ did, role }) {
5
-
const [begun, setBegun] = useState(false);
6
-
const [pw, setPw] = useState('');
7
const [submission, setSubmission] = useState(0);
8
const [submitting, setSubmitting] = useState(false);
9
···
15
16
return (
17
<form method="post" onSubmit={handleSubmit}>
18
-
<h2>Secret password required</h2>
19
-
<p>This demo is not ready for public yet, but you can get early access as a <a href="https://github.com/sponsors/uniphil/" target="_blank">github sponsor</a> or <a href="https://ko-fi.com/bad_example" target="_blank">ko-fi supporter</a>.</p>
20
21
{submitting ? (
22
<PostJson
23
key={submission}
24
endpoint="/super-top-secret-access"
25
-
data={{ secret_password: pw }}
26
credentials
27
loading={() => (<>Checking…</>)}
28
error={e => {
···
50
/>
51
) : (
52
<p>
53
-
<label>
54
-
Password:
55
-
{' '}
56
-
<input
57
-
type="text"
58
-
value={pw}
59
-
onFocus={() => setBegun(true)}
60
-
onChange={e => setPw(e.target.value)}
61
-
/>
62
-
</label>
63
-
{' '}
64
-
{begun && (
65
-
<button type="submit" className="subtle">
66
-
unlock
67
-
</button>
68
-
)}
69
</p>
70
)}
71
</form>
···
2
import { PostJson } from './Fetch';
3
4
export function SecretPassword({ did, role }) {
5
const [submission, setSubmission] = useState(0);
6
const [submitting, setSubmitting] = useState(false);
7
···
13
14
return (
15
<form method="post" onSubmit={handleSubmit}>
16
+
<h2>Secret early access</h2>
17
+
<p>This demo is still in development! Your support helps keep it going: <a href="https://github.com/sponsors/uniphil/" target="_blank">github sponsors</a>, <a href="https://ko-fi.com/bad_example" target="_blank">ko-fi</a>.</p>
18
19
{submitting ? (
20
<PostJson
21
key={submission}
22
endpoint="/super-top-secret-access"
23
+
data={{ secret_password: "letmein" }}
24
credentials
25
loading={() => (<>Checking…</>)}
26
error={e => {
···
48
/>
49
) : (
50
<p>
51
+
<button type="submit">Let me in</button>
52
</p>
53
)}
54
</form>