2022-02-25 17:46:22 +00:00
|
|
|
import AppBar from "@mui/material/AppBar";
|
|
|
|
import Navigation from "./Navigation";
|
|
|
|
import Toolbar from "@mui/material/Toolbar";
|
|
|
|
import IconButton from "@mui/material/IconButton";
|
|
|
|
import MenuIcon from "@mui/icons-material/Menu";
|
|
|
|
import Typography from "@mui/material/Typography";
|
|
|
|
import IconSubscribeSettings from "./IconSubscribeSettings";
|
|
|
|
import * as React from "react";
|
2022-02-28 21:56:38 +00:00
|
|
|
import Box from "@mui/material/Box";
|
2022-03-02 21:16:30 +00:00
|
|
|
import {topicShortUrl} from "../app/utils";
|
2022-02-25 17:46:22 +00:00
|
|
|
|
|
|
|
const ActionBar = (props) => {
|
2022-03-02 21:16:30 +00:00
|
|
|
const title = (props.selectedSubscription)
|
|
|
|
? topicShortUrl(props.selectedSubscription.baseUrl, props.selectedSubscription.topic)
|
2022-02-25 17:46:22 +00:00
|
|
|
: "ntfy";
|
|
|
|
return (
|
2022-02-26 19:22:21 +00:00
|
|
|
<AppBar position="fixed" sx={{
|
|
|
|
width: '100%',
|
2022-02-26 19:36:23 +00:00
|
|
|
zIndex: { sm: 1250 }, // > Navigation (1200), but < Dialog (1300)
|
2022-02-26 19:22:21 +00:00
|
|
|
ml: { sm: `${Navigation.width}px` }
|
|
|
|
}}>
|
2022-02-25 17:46:22 +00:00
|
|
|
<Toolbar sx={{pr: '24px'}}>
|
|
|
|
<IconButton
|
|
|
|
color="inherit"
|
|
|
|
edge="start"
|
|
|
|
onClick={props.onMobileDrawerToggle}
|
|
|
|
sx={{ mr: 2, display: { sm: 'none' } }}
|
|
|
|
>
|
|
|
|
<MenuIcon />
|
|
|
|
</IconButton>
|
2022-02-28 21:56:38 +00:00
|
|
|
<Box component="img" src="static/img/ntfy.svg" sx={{
|
|
|
|
display: { xs: 'none', sm: 'block' },
|
|
|
|
marginRight: '10px',
|
|
|
|
height: '28px'
|
|
|
|
}}/>
|
2022-02-26 19:22:21 +00:00
|
|
|
<Typography variant="h6" noWrap component="div" sx={{ flexGrow: 1 }}>
|
|
|
|
{title}
|
|
|
|
</Typography>
|
2022-02-25 17:46:22 +00:00
|
|
|
{props.selectedSubscription !== null && <IconSubscribeSettings
|
|
|
|
subscription={props.selectedSubscription}
|
|
|
|
onUnsubscribe={props.onUnsubscribe}
|
|
|
|
/>}
|
|
|
|
</Toolbar>
|
|
|
|
</AppBar>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ActionBar;
|