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