@snort/system-react package

This commit is contained in:
2023-06-16 20:31:33 +01:00
parent 28052e98b9
commit 939084167a
47 changed files with 334 additions and 122 deletions

View File

@ -1,11 +1,12 @@
import "./ProfilePreview.css";
import { ReactNode } from "react";
import { HexKey } from "@snort/system";
import { useUserProfile } from "@snort/system-react";
import { useInView } from "react-intersection-observer";
import ProfileImage from "Element/ProfileImage";
import FollowButton from "Element/FollowButton";
import { useUserProfile } from "Hooks/useUserProfile";
import { HexKey } from "@snort/system";
import { useInView } from "react-intersection-observer";
import { System } from "index";
export interface ProfilePreviewProps {
pubkey: HexKey;
@ -18,7 +19,7 @@ export interface ProfilePreviewProps {
export default function ProfilePreview(props: ProfilePreviewProps) {
const pubkey = props.pubkey;
const { ref, inView } = useInView({ triggerOnce: true });
const user = useUserProfile(inView ? pubkey : undefined);
const user = useUserProfile(System, inView ? pubkey : undefined);
const options = {
about: true,
...props.options,