bug: use page width for banner
This commit is contained in:
@ -2,13 +2,13 @@ import useImgProxy from "Feed/ImgProxy";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export const ProxyImg = (props: any) => {
|
export const ProxyImg = (props: any) => {
|
||||||
const { src, ...rest } = props;
|
const { src, size, ...rest } = props;
|
||||||
const [url, setUrl] = useState<string>();
|
const [url, setUrl] = useState<string>();
|
||||||
const { proxy } = useImgProxy();
|
const { proxy } = useImgProxy();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (src) {
|
if (src) {
|
||||||
proxy(src)
|
proxy(src, size)
|
||||||
.then(a => setUrl(a))
|
.then(a => setUrl(a))
|
||||||
.catch(console.warn);
|
.catch(console.warn);
|
||||||
}
|
}
|
||||||
|
@ -191,10 +191,11 @@ export default function ProfilePage() {
|
|||||||
return <div className={`tab f-1${tab === v ? " active" : ""}`} key={v} onClick={() => setTab(v)}>{v}</div>
|
return <div className={`tab f-1${tab === v ? " active" : ""}`} key={v} onClick={() => setTab(v)}>{v}</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const w = window.document.querySelector(".page")?.clientWidth;
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="profile flex">
|
<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">
|
<div className="profile-wrapper flex">
|
||||||
{avatar()}
|
{avatar()}
|
||||||
{userDetails()}
|
{userDetails()}
|
||||||
|
Reference in New Issue
Block a user