mirror of
https://github.com/multipleof4/ntfy.git
synced 2026-10-08 21:05:21 +00:00
Back link
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user