mirror of
https://github.com/irislib/iris-messenger.git
synced 2024-10-18 06:03:22 +00:00
parent
5be5064628
commit
eb513f2501
@ -62,14 +62,9 @@ const ProxyImg = (props: Props) => {
|
||||
onError={handleError}
|
||||
onClick={props.onClick}
|
||||
className={props.className}
|
||||
style={{
|
||||
...props.style,
|
||||
width: props.square ? props.width : undefined,
|
||||
height: props.square ? props.width : undefined,
|
||||
objectFit: props.square ? 'cover' : undefined,
|
||||
}}
|
||||
width={props.square ? props.width : undefined}
|
||||
height={props.square ? props.width : undefined}
|
||||
style={props.style}
|
||||
width={props.width}
|
||||
height={props.width}
|
||||
alt={props.alt}
|
||||
/>
|
||||
);
|
||||
|
@ -3,7 +3,6 @@ import { Event } from 'nostr-tools';
|
||||
import { route } from 'preact-router';
|
||||
|
||||
import EventDB from '@/nostr/EventDB';
|
||||
import { useProfile } from '@/nostr/hooks/useProfile.ts';
|
||||
|
||||
import Key from '../../nostr/Key';
|
||||
import PubSub from '../../nostr/PubSub';
|
||||
@ -11,6 +10,7 @@ import SocialNetwork from '../../nostr/SocialNetwork';
|
||||
import localState from '../../state/LocalState.ts';
|
||||
import { translate as t } from '../../translations/Translation.mjs';
|
||||
import Helpers from '../../utils/Helpers';
|
||||
import { ID } from '../../utils/UniqueIds';
|
||||
import Follow from '../buttons/Follow';
|
||||
import Show from '../helpers/Show';
|
||||
import HyperText from '../HyperText';
|
||||
@ -43,7 +43,7 @@ const ProfileCard = (props: { hexPub: string; npub: string }) => {
|
||||
};
|
||||
|
||||
const { hexPub, npub } = props;
|
||||
const profile = useProfile(hexPub);
|
||||
const [profile, setProfile] = useState<any>(SocialNetwork.profiles.get(ID(hexPub)) || {});
|
||||
const [lightning, setLightning] = useState<string>(getLightning(profile));
|
||||
const [website, setWebsite] = useState<string>(getWebsite(profile.website));
|
||||
const [loggedIn, setLoggedIn] = useState<boolean>(false);
|
||||
@ -69,7 +69,7 @@ const ProfileCard = (props: { hexPub: string; npub: string }) => {
|
||||
subscriptions.push(
|
||||
SocialNetwork.getProfile(
|
||||
address,
|
||||
() => {
|
||||
(profile) => {
|
||||
if (!profile) {
|
||||
return;
|
||||
}
|
||||
@ -104,6 +104,8 @@ const ProfileCard = (props: { hexPub: string; npub: string }) => {
|
||||
|
||||
setLightning(getLightning(profile));
|
||||
setWebsite(getWebsite(profile.website));
|
||||
|
||||
setProfile(profile);
|
||||
},
|
||||
true,
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user