hide mobile footer in dm view, fix ProxyImg
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Martti Malmi 2023-12-01 17:42:13 +02:00
parent 689839e043
commit 1d5107bd89
4 changed files with 7 additions and 5 deletions

View File

@ -6,7 +6,7 @@ export default function NavLink(props: NavLinkProps) {
const isActive = location.pathname === to.toString(); const isActive = location.pathname === to.toString();
const handleClick = (event) => { const handleClick = event => {
if (onClick) { if (onClick) {
onClick(event); onClick(event);
} }

View File

@ -33,7 +33,7 @@ export const ProxyImg = ({ size, className, promptToLoadDirectly, missingImageEl
</div> </div>
); );
} }
const src = bypass ? props.src : proxy(props.src ?? "", size); const src = loadFailed && bypass ? props.src : proxy(props.src ?? "", size);
if (!src || (loadFailed && !bypass)) return missingImageElement; if (!src || (loadFailed && !bypass)) return missingImageElement;
return ( return (
<img <img

View File

@ -1,5 +1,5 @@
import "./Layout.css"; import "./Layout.css";
import { useCallback, useEffect, useMemo, useState } from "react"; import { useCallback } from "react";
import { Outlet, useLocation } from "react-router-dom"; import { Outlet, useLocation } from "react-router-dom";
import Icon from "@/Icons/Icon"; import Icon from "@/Icons/Icon";
@ -59,7 +59,7 @@ export default function Index() {
</div> </div>
<LoginUnlock /> <LoginUnlock />
{isStalker && <StalkerModal id={id} />} {isStalker && <StalkerModal id={id} />}
{!shouldHideFooter && <Footer/>} {!shouldHideFooter && <Footer />}
</div> </div>
); );
} }

View File

@ -357,6 +357,8 @@ export default function ProfilePage({ id: propId, state }: ProfilePageProps) {
return <TabElement key={v.value} t={v} tab={tab} setTab={setTab} />; return <TabElement key={v.value} t={v} tab={tab} setTab={setTab} />;
} }
const bannerWidth = Math.min(window.innerWidth, 940);
return ( return (
<> <>
<div className="profile"> <div className="profile">
@ -365,7 +367,7 @@ export default function ProfilePage({ id: propId, state }: ProfilePageProps) {
alt="banner" alt="banner"
className="banner pointer" className="banner pointer"
src={user.banner} src={user.banner}
size={940} size={bannerWidth}
onClick={() => setModalImage(user.banner || "")} onClick={() => setModalImage(user.banner || "")}
/> />
)} )}