demos for spacedust
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

less annoying early page after first visit

+7 -4
+1 -1
atproto-notifications/src/components/SecretPassword.jsx
··· 41 <p style={{ color: "#9f0" }}>Secret password accepted.</p> 42 <p> 43 {/* an <a> tag, not a <Link>, on purpose so we relaod for our role */} 44 - <a className="button" href="/early"> 45 Continue 46 </a> 47 </p>
··· 41 <p style={{ color: "#9f0" }}>Secret password accepted.</p> 42 <p> 43 {/* an <a> tag, not a <Link>, on purpose so we relaod for our role */} 44 + <a className="button" href="/early?hello"> 45 Continue 46 </a> 47 </p>
+6 -3
atproto-notifications/src/pages/Early.tsx
··· 1 import { useCallback, useState } from 'react'; 2 - import { Link } from 'react-router'; 3 import { postJson } from '../components/Fetch'; 4 import './Early.css'; 5 6 export function Early({ }) { 7 const [notified, setNotified] = useState(false); 8 const [pushStatus, setPushStatus] = useState(null); 9 const [pushed, setPushed] = useState(false); 10 11 const localTest = useCallback(() => { 12 try { ··· 49 <p> 50 To see a test notification, <button onClick={localTest}>click on this</button>. This is a local-only test. 51 </p> 52 - {notified && ( 53 <> 54 <p> 55 Then ··· 66 {pushStatus === 'failed' && <p>uh oh, something went wrong requesting a web push</p>} 67 </> 68 )} 69 - {(pushed && pushStatus !== 'failed') && ( 70 <> 71 <h3>Great!</h3> 72 <p>
··· 1 import { useCallback, useState } from 'react'; 2 + import { Link, useSearchParams } from 'react-router'; 3 import { postJson } from '../components/Fetch'; 4 import './Early.css'; 5 6 export function Early({ }) { 7 + const [searchParams, _] = useSearchParams(); 8 const [notified, setNotified] = useState(false); 9 const [pushStatus, setPushStatus] = useState(null); 10 const [pushed, setPushed] = useState(false); 11 + 12 + const returning = !searchParams.has('hello'); 13 14 const localTest = useCallback(() => { 15 try { ··· 52 <p> 53 To see a test notification, <button onClick={localTest}>click on this</button>. This is a local-only test. 54 </p> 55 + {(returning || notified) && ( 56 <> 57 <p> 58 Then ··· 69 {pushStatus === 'failed' && <p>uh oh, something went wrong requesting a web push</p>} 70 </> 71 )} 72 + {(returning || (pushed && pushStatus !== 'failed')) && ( 73 <> 74 <h3>Great!</h3> 75 <p>