Add Github and Feedback link
This commit is contained in:
parent
0a027fd7c2
commit
ee2dbe0f7b
2 changed files with 18 additions and 5 deletions
|
|
@ -147,8 +147,7 @@ class App extends React.PureComponent<AppProps & Classes, AppState> {
|
||||||
state: this.state.mqttState,
|
state: this.state.mqttState,
|
||||||
changeState: this.changeState
|
changeState: this.changeState
|
||||||
}}>
|
}}>
|
||||||
<TopBar title={`${this.props.config.space.name} Map`}
|
<TopBar connected={this.state.mqttConnected}
|
||||||
connected={this.state.mqttConnected}
|
|
||||||
onSearch={(s) => this.setState({ search: s })} />
|
onSearch={(s) => this.setState({ search: s })} />
|
||||||
<SideBar open={this.state.drawerOpened}
|
<SideBar open={this.state.drawerOpened}
|
||||||
control={this.state.selectedControl}
|
control={this.state.selectedControl}
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,14 @@ import React from "react";
|
||||||
|
|
||||||
import AppBar from "@material-ui/core/AppBar";
|
import AppBar from "@material-ui/core/AppBar";
|
||||||
import Toolbar from "@material-ui/core/Toolbar";
|
import Toolbar from "@material-ui/core/Toolbar";
|
||||||
import Typography from "@material-ui/core/Typography";
|
|
||||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||||
import InputBase from "@material-ui/core/InputBase";
|
import InputBase from "@material-ui/core/InputBase";
|
||||||
import { fade } from "@material-ui/core/styles/colorManipulator";
|
import { fade } from "@material-ui/core/styles/colorManipulator";
|
||||||
import { withStyles } from "@material-ui/core/styles";
|
import { withStyles } from "@material-ui/core/styles";
|
||||||
|
import Tooltip from "@material-ui/core/Tooltip";
|
||||||
|
import IconButton from "@material-ui/core/IconButton";
|
||||||
|
|
||||||
export type TopBarProps = {
|
export type TopBarProps = {
|
||||||
title: string,
|
|
||||||
connected: boolean,
|
connected: boolean,
|
||||||
onSearch: string => void
|
onSearch: string => void
|
||||||
};
|
};
|
||||||
|
|
@ -85,13 +85,27 @@ const RawSearch = (props: SearchBarProps & Classes) => (
|
||||||
|
|
||||||
const Search = withStyles(searchStyles)(RawSearch);
|
const Search = withStyles(searchStyles)(RawSearch);
|
||||||
|
|
||||||
|
const openOnGithub = () => window.open(
|
||||||
|
"https://github.com/uwap/mqtt-control-map", "_blank");
|
||||||
|
|
||||||
|
const sendFeedback = () => window.open("mailto:mail+feedback@uwap.name");
|
||||||
|
|
||||||
const TopBar = (props: TopBarProps) => (
|
const TopBar = (props: TopBarProps) => (
|
||||||
<AppBar position="static">
|
<AppBar position="static">
|
||||||
<Toolbar>
|
<Toolbar>
|
||||||
{renderConnectionIndicator(props.connected)}
|
{renderConnectionIndicator(props.connected)}
|
||||||
<Search onSearch={props.onSearch} />
|
<Search onSearch={props.onSearch} />
|
||||||
<span style={{flex: 1}}></span>
|
<span style={{flex: 1}}></span>
|
||||||
<Typography variant="title">{props.title}</Typography>
|
<Tooltip title="Github">
|
||||||
|
<IconButton onClick={openOnGithub} style={{ fontSize: "28px" }}>
|
||||||
|
<i className="mdi mdi-github-circle"></i>
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip title="Send me feedback">
|
||||||
|
<IconButton onClick={sendFeedback} style={{ fontSize: "28px" }}>
|
||||||
|
<i className="mdi mdi-email-plus"></i>
|
||||||
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
</AppBar>
|
</AppBar>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue