replace eslint/prettier with rome
This commit is contained in:
@@ -1,22 +1,31 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atomWithReset } from 'jotai/utils';
|
||||
import { atom } from "jotai";
|
||||
import { atomWithReset } from "jotai/utils";
|
||||
|
||||
// channel reply id
|
||||
export const channelReplyAtom = atomWithReset({ id: null, pubkey: null, content: null });
|
||||
export const channelReplyAtom = atomWithReset({
|
||||
id: null,
|
||||
pubkey: null,
|
||||
content: null,
|
||||
});
|
||||
|
||||
// channel messages
|
||||
export const channelMessagesAtom = atomWithReset([]);
|
||||
export const sortedChannelMessagesAtom = atom((get) => {
|
||||
const messages = get(channelMessagesAtom);
|
||||
return messages.sort((x: { created_at: number }, y: { created_at: number }) => x.created_at - y.created_at);
|
||||
const messages = get(channelMessagesAtom);
|
||||
return messages.sort(
|
||||
(x: { created_at: number }, y: { created_at: number }) =>
|
||||
x.created_at - y.created_at,
|
||||
);
|
||||
});
|
||||
|
||||
// channel user list
|
||||
export const channelMembersAtom = atom((get) => {
|
||||
const messages = get(channelMessagesAtom);
|
||||
const uniqueMembers = new Set(messages.map((m: { pubkey: string }) => m.pubkey));
|
||||
return uniqueMembers;
|
||||
const messages = get(channelMessagesAtom);
|
||||
const uniqueMembers = new Set(
|
||||
messages.map((m: { pubkey: string }) => m.pubkey),
|
||||
);
|
||||
return uniqueMembers;
|
||||
});
|
||||
|
||||
// channel message content
|
||||
export const channelContentAtom = atomWithReset('');
|
||||
export const channelContentAtom = atomWithReset("");
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atomWithReset } from 'jotai/utils';
|
||||
import { atom } from "jotai";
|
||||
import { atomWithReset } from "jotai/utils";
|
||||
|
||||
export const chatMessagesAtom = atomWithReset([]);
|
||||
export const sortedChatMessagesAtom = atom((get) => {
|
||||
const messages = get(chatMessagesAtom);
|
||||
return messages.sort((x: { created_at: number }, y: { created_at: number }) => x.created_at - y.created_at);
|
||||
const messages = get(chatMessagesAtom);
|
||||
return messages.sort(
|
||||
(x: { created_at: number }, y: { created_at: number }) =>
|
||||
x.created_at - y.created_at,
|
||||
);
|
||||
});
|
||||
|
||||
// chat content
|
||||
export const chatContentAtom = atomWithReset('');
|
||||
export const chatContentAtom = atomWithReset("");
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atom } from "jotai";
|
||||
|
||||
export const composerAtom = atom({ type: 'post' });
|
||||
export const composerAtom = atom({ type: "post" });
|
||||
|
||||
@@ -1,26 +1,34 @@
|
||||
export const APP_VERSION = '1.0.0';
|
||||
export const APP_VERSION = "1.0.0";
|
||||
|
||||
export const DEFAULT_AVATAR = 'https://void.cat/d/KmypFh2fBdYCEvyJrPiN89.webp';
|
||||
export const DEFAULT_AVATAR = "https://void.cat/d/KmypFh2fBdYCEvyJrPiN89.webp";
|
||||
|
||||
export const DEFAULT_CHANNEL_BANNER =
|
||||
'https://bafybeiacwit7hjmdefqggxqtgh6ht5dhth7ndptwn2msl5kpkodudsr7py.ipfs.w3s.link/banner-1.jpg';
|
||||
"https://bafybeiacwit7hjmdefqggxqtgh6ht5dhth7ndptwn2msl5kpkodudsr7py.ipfs.w3s.link/banner-1.jpg";
|
||||
|
||||
// img proxy
|
||||
export const IMGPROXY_URL = 'https://imgproxy.iris.to/insecure';
|
||||
export const IMGPROXY_URL = "https://imgproxy.iris.to/insecure";
|
||||
|
||||
// metadata service
|
||||
export const METADATA_SERVICE = 'https://us.rbr.bio';
|
||||
export const METADATA_SERVICE = "https://us.rbr.bio";
|
||||
|
||||
// read-only relay list
|
||||
export const READONLY_RELAYS = ['wss://welcome.nostr.wine', 'wss://relay.nostr.band/all', 'wss://relay.damus.io'];
|
||||
export const READONLY_RELAYS = [
|
||||
"wss://welcome.nostr.wine",
|
||||
"wss://relay.nostr.band/all",
|
||||
"wss://relay.damus.io",
|
||||
];
|
||||
|
||||
// write-only relay list
|
||||
export const WRITEONLY_RELAYS = ['wss://nostr.mutinywallet.com', 'wss://relay.nostr.band', 'wss://relay.damus.io'];
|
||||
export const WRITEONLY_RELAYS = [
|
||||
"wss://nostr.mutinywallet.com",
|
||||
"wss://relay.nostr.band",
|
||||
"wss://relay.damus.io",
|
||||
];
|
||||
|
||||
// full-relay list
|
||||
export const FULL_RELAYS = [
|
||||
'wss://welcome.nostr.wine',
|
||||
'wss://relay.nostr.band/all',
|
||||
'wss://nostr.mutinywallet.com',
|
||||
'wss://relay.damus.io',
|
||||
"wss://welcome.nostr.wine",
|
||||
"wss://relay.nostr.band/all",
|
||||
"wss://nostr.mutinywallet.com",
|
||||
"wss://relay.damus.io",
|
||||
];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atomWithReset } from 'jotai/utils';
|
||||
import { atom } from "jotai";
|
||||
import { atomWithReset } from "jotai/utils";
|
||||
|
||||
// note content
|
||||
export const noteContentAtom = atomWithReset('');
|
||||
export const noteContentAtom = atomWithReset("");
|
||||
|
||||
// notify user that connector has receive newer note
|
||||
export const hasNewerNoteAtom = atom(false);
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
import { atom } from 'jotai';
|
||||
import { atom } from "jotai";
|
||||
|
||||
export const onboardingAtom = atom({ pubkey: null, privkey: null, metadata: null, follows: null });
|
||||
export const onboardingAtom = atom({
|
||||
pubkey: null,
|
||||
privkey: null,
|
||||
metadata: null,
|
||||
follows: null,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user