forked from Kieran/snort
bug: use page width for banner
This commit is contained in:
parent
08acab4831
commit
14769f8f33
@ -2,13 +2,13 @@ import useImgProxy from "Feed/ImgProxy";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const ProxyImg = (props: any) => {
|
||||
const { src, ...rest } = props;
|
||||
const { src, size, ...rest } = props;
|
||||
const [url, setUrl] = useState<string>();
|
||||
const { proxy } = useImgProxy();
|
||||
|
||||
useEffect(() => {
|
||||
if (src) {
|
||||
proxy(src)
|
||||
proxy(src, size)
|
||||
.then(a => setUrl(a))
|
||||
.catch(console.warn);
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ export default function ProfilePage() {
|
||||
</IconButton>
|
||||
{showProfileQr && (
|
||||
<Modal className="qr-modal" onClose={() => setShowProfileQr(false)}>
|
||||
<QrCode data={`nostr:${hexToBech32("npub", id)}`} link={undefined} className="m10"/>
|
||||
<QrCode data={`nostr:${hexToBech32("npub", id)}`} link={undefined} className="m10" />
|
||||
</Modal>
|
||||
)}
|
||||
{isMe ? (
|
||||
@ -191,10 +191,11 @@ export default function ProfilePage() {
|
||||
return <div className={`tab f-1${tab === v ? " active" : ""}`} key={v} onClick={() => setTab(v)}>{v}</div>
|
||||
}
|
||||
|
||||
const w = window.document.querySelector(".page")?.clientWidth;
|
||||
return (
|
||||
<>
|
||||
<div className="profile flex">
|
||||
{user?.banner && <ProxyImg alt="banner" className="banner" src={user.banner} />}
|
||||
{user?.banner && <ProxyImg alt="banner" className="banner" src={user.banner} size={w}/>}
|
||||
<div className="profile-wrapper flex">
|
||||
{avatar()}
|
||||
{userDetails()}
|
||||
|
Loading…
Reference in New Issue
Block a user