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 * as React from "react";
import { Avatar, Box, styled } from "@mui/material"; import { Avatar, Box, styled } from "@mui/material";
import { NavLink } from "react-router-dom";
import logo from "../img/ntfy-filled.svg"; import logo from "../img/ntfy-filled.svg";
import routes from "./routes";
const AvatarBoxContainer = styled(Box)` const AvatarBoxContainer = styled(Box)`
display: flex; display: flex;
@@ -13,11 +15,15 @@ const AvatarBoxContainer = styled(Box)`
max-width: min(400px, 90dvw); max-width: min(400px, 90dvw);
margin: auto; margin: auto;
`; `;
const AvatarBox = (props) => ( const AvatarBox = (props) => {
<AvatarBoxContainer> const avatar = <Avatar sx={{ m: 2, width: 64, height: 64, borderRadius: 3 }} src={logo} variant="rounded" />;
<Avatar sx={{ m: 2, width: 64, height: 64, borderRadius: 3 }} src={logo} variant="rounded" /> return (
{props.children} <AvatarBoxContainer>
</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; export default AvatarBox;