an independent Bluesky client using Constellation, PDS Queries, and other services
reddwarf.app
frontend
spa
bluesky
reddwarf
microcosm
client
app
1import type Agent from "@atproto/api";
2import { atom, createStore } from "jotai";
3import { atomWithStorage } from 'jotai/utils';
4
5export const store = createStore();
6
7export const selectedFeedUriAtom = atomWithStorage<string | null>(
8 'selectedFeedUri',
9 null
10);
11
12//export const feedScrollPositionsAtom = atom<Record<string, number>>({});
13
14export const feedScrollPositionsAtom = atomWithStorage<Record<string, number>>(
15 'feedscrollpositions',
16 {}
17);
18
19export const likedPostsAtom = atomWithStorage<Record<string, string>>(
20 'likedPosts',
21 {}
22);
23
24export const defaultconstellationURL = 'constellation.microcosm.blue'
25export const constellationURLAtom = atomWithStorage<string>(
26 'constellationURL',
27 defaultconstellationURL
28)
29export const defaultslingshotURL = 'slingshot.microcosm.blue'
30export const slingshotURLAtom = atomWithStorage<string>(
31 'slingshotURL',
32 defaultslingshotURL
33)
34
35export const isAtTopAtom = atom<boolean>(true);
36
37type ComposerState =
38 | { kind: 'closed' }
39 | { kind: 'root' }
40 | { kind: 'reply'; parent: string }
41 | { kind: 'quote'; subject: string };
42export const composerAtom = atom<ComposerState>({ kind: 'closed' });
43
44export const agentAtom = atom<Agent|null>(null);
45export const authedAtom = atom<boolean>(false);