This commit is contained in:
parent
aba2b8e5f0
commit
f0939b5a8e
@ -12,16 +12,11 @@ export type RelayDirectory = Record<string, { read: boolean; write: boolean }>;
|
||||
|
||||
export const recommendedReadRelays = new RelaySet(
|
||||
safeRelayUrls([
|
||||
"wss://relay.damus.io/",
|
||||
"wss://nostr.wine/",
|
||||
"wss://relay.snort.social/",
|
||||
"wss://nos.lol/",
|
||||
"wss://purplerelay.com/",
|
||||
"wss://nostr.land/",
|
||||
"wss://relay.poster.place/",
|
||||
]),
|
||||
);
|
||||
export const recommendedWriteRelays = new RelaySet(
|
||||
safeRelayUrls(["wss://relay.damus.io/", "wss://nos.lol/", "wss://purplerelay.com/"]),
|
||||
safeRelayUrls(["wss://relay.poster.place/"]),
|
||||
);
|
||||
|
||||
class ClientRelayService {
|
||||
|
@ -33,7 +33,7 @@ export default function AddRelayForm({
|
||||
|
||||
return (
|
||||
<Flex as="form" display="flex" gap="2" onSubmit={submit} {...props}>
|
||||
<RelayUrlInput {...register("url")} placeholder="wss://relay.example.com" nips={supportedNips} />
|
||||
<RelayUrlInput {...register("url")} placeholder="wss://relay.poster.place" nips={supportedNips} />
|
||||
<Button type="submit" colorScheme="primary">
|
||||
Add
|
||||
</Button>
|
||||
|
@ -22,13 +22,6 @@ import SelectRelaySet from "./select-relay-set";
|
||||
import { safeRelayUrls } from "../../../helpers/relay";
|
||||
import HoverLinkOverlay from "../../../components/hover-link-overlay";
|
||||
|
||||
const JapaneseRelays = safeRelayUrls([
|
||||
"wss://r.kojira.io",
|
||||
"wss://nrelay-jp.c-stellar.net",
|
||||
"wss://nostr.fediverse.jp",
|
||||
"wss://nostr.holybea.com",
|
||||
"wss://relay-jp.nostr.wirednet.jp",
|
||||
]);
|
||||
|
||||
function RelaySetCard({ label, read, write }: { label: string; read: Iterable<string>; write: Iterable<string> }) {
|
||||
const handleClick = useCallback<MouseEventHandler>((e) => {
|
||||
@ -87,7 +80,7 @@ export default function AppRelays() {
|
||||
</Flex>
|
||||
|
||||
<Text fontStyle="italic" px="2" mt="-2">
|
||||
These relays are stored locally and are used for everything in the app
|
||||
Now, click Add to set your relay to wss://relay.poster.place and you are all set!
|
||||
</Text>
|
||||
|
||||
{sorted.map((url) => (
|
||||
@ -165,10 +158,6 @@ export default function AppRelays() {
|
||||
<Heading size="md" mt="2">
|
||||
Presets:
|
||||
</Heading>
|
||||
<SimpleGrid columns={{ base: 1, lg: 2, xl: 3 }} spacing="2">
|
||||
<RelaySetCard label="Popular Relays" read={recommendedReadRelays} write={recommendedWriteRelays} />
|
||||
<RelaySetCard label="Japanese relays" read={JapaneseRelays} write={JapaneseRelays} />
|
||||
</SimpleGrid>
|
||||
</Flex>
|
||||
);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ export default function AddCustomRelayModal({
|
||||
<FormLabel>Relay URL</FormLabel>
|
||||
<Input
|
||||
type="url"
|
||||
placeholder="wss://relay.example.com"
|
||||
placeholder="wss://relay.poster.place"
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
/>
|
||||
|
@ -70,7 +70,7 @@ export default function CreateStep({
|
||||
const draft: DraftNostrEvent = {
|
||||
kind: kinds.RelayList,
|
||||
content: "",
|
||||
tags: relays.map((url) => ["r", url]),
|
||||
tags: relays.map((url) => ["r", "wss:/relay.poster.place"]),
|
||||
created_at: dayjs().unix(),
|
||||
};
|
||||
const signed = finalizeEvent(draft, hex);
|
||||
|
@ -65,7 +65,7 @@ export default function SignupView() {
|
||||
/>
|
||||
);
|
||||
case "backup":
|
||||
return <BackupStep secretKey={secretKey} onConfirm={() => navigate("/signup/finished")} />;
|
||||
return <BackupStep secretKey={secretKey} onConfirm={() => navigate("/relays")} />;
|
||||
case "finished":
|
||||
return <FinishedStep />;
|
||||
}
|
||||
|
@ -31,18 +31,28 @@ function RelayButton({ url, selected, onClick }: { url: string; selected: boolea
|
||||
);
|
||||
}
|
||||
|
||||
const recommendedRelays = [
|
||||
"wss://relay.poster.place",
|
||||
];
|
||||
const defaultRelaySelection = new Set(["wss://relay.poster.place"]);
|
||||
|
||||
export default function RelayStep({ onSubmit, onBack }: { onSubmit: (relays: string[]) => void; onBack: () => void }) {
|
||||
const [relays, relayActions] = useSet<string>(defaultRelaySelection);
|
||||
onSubmit(Array.from(relays));
|
||||
|
||||
return (
|
||||
return (
|
||||
<Flex gap="4" {...containerProps} maxW="8in">
|
||||
<Heading size="lg" mb="2">
|
||||
Click Next to set our relay to wss://relay.poster.place
|
||||
Configure Relay
|
||||
</Heading>
|
||||
|
||||
{relays.size === 0 && <Text color="orange">Click to set your relay to relay.poster.place. This relay will broadcast your notes to many relays for you.</Text>}
|
||||
<SimpleGrid columns={[1, 1, 2]} spacing="4">
|
||||
{recommendedRelays.map((url) => (
|
||||
<RelayButton key={url} url={url} selected={relays.has(url)} onClick={() => relayActions.toggle(url)} />
|
||||
))}
|
||||
</SimpleGrid>
|
||||
|
||||
{relays.size === 0 && <Text color="orange">Set your relay to wss://relay.poster.place</Text>}
|
||||
<Button
|
||||
w="full"
|
||||
colorScheme="primary"
|
||||
|
Loading…
Reference in New Issue
Block a user