Back link

This commit is contained in:
binwiederhier
2026-06-24 12:21:41 -04:00
parent 5d96888f0e
commit 87e9dc9da4
+12 -6
View File
@@ -1,6 +1,8 @@
import * as React from "react";
import { Avatar, Box, styled } from "@mui/material";
import { NavLink } from "react-router-dom";
import logo from "../img/ntfy-filled.svg";
import routes from "./routes";
const AvatarBoxContainer = styled(Box)`
display: flex;
@@ -13,11 +15,15 @@ const AvatarBoxContainer = styled(Box)`
max-width: min(400px, 90dvw);
margin: auto;
`;
const AvatarBox = (props) => (
<AvatarBoxContainer>
<Avatar sx={{ m: 2, width: 64, height: 64, borderRadius: 3 }} src={logo} variant="rounded" />
{props.children}
</AvatarBoxContainer>
);
const AvatarBox = (props) => {
const avatar = <Avatar sx={{ m: 2, width: 64, height: 64, borderRadius: 3 }} src={logo} variant="rounded" />;
return (
<AvatarBoxContainer>
{/* The logo links back to the app, unless login is forced (no app to go back to without signing in) */}
{config.require_login ? avatar : <NavLink to={routes.app}>{avatar}</NavLink>}
{props.children}
</AvatarBoxContainer>
);
};
export default AvatarBox;