update chat

This commit is contained in:
Ren Amamiya
2023-04-28 15:20:10 +07:00
parent 87e8ee8954
commit f751c1f18f
20 changed files with 183 additions and 438 deletions

View File

@@ -1,9 +1,11 @@
import { METADATA_SERVICE } from '@lume/stores/constants';
import useSWR from 'swr';
const fetcher = (url: string) => fetch(url).then((r: any) => r.json());
export const useProfile = (pubkey: string) => {
const { data, error, isLoading } = useSWR(`https://us.rbr.bio/${pubkey}/metadata.json`, fetcher);
const { data, error, isLoading } = useSWR(`${METADATA_SERVICE}/${pubkey}/metadata.json`, fetcher);
return {
user: data ? JSON.parse(data.content ? data.content : null) : null,