Add titlebar, update gitignore, add titlebar to Welcome page
This commit is contained in:
parent
a44d1fbb0a
commit
b2dbdf6931
|
@ -65,6 +65,7 @@ typings/
|
|||
|
||||
# Production dirs
|
||||
build/
|
||||
dist/
|
||||
|
||||
# Electron app files
|
||||
desktop/*.plist
|
||||
|
|
|
@ -41,7 +41,11 @@
|
|||
"electrify": "npm run build; electron .",
|
||||
"electrify-nobuild": "electron .",
|
||||
"build": "react-scripts build",
|
||||
"build-desktop": "build -mwl deb AppImage snap",
|
||||
"build-desktop": "npm run build; build -mwl deb AppImage snap",
|
||||
"build-desktop-win": "npm run build; build -w",
|
||||
"build-desktop-darwin": "npm run build; build -m",
|
||||
"build-desktop-linux": "npm run build, build -l deb AppImage snap",
|
||||
"build-desktop-linux-select": "npm run build; build -l ",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@ export const styles = (theme: Theme) => createStyles({
|
|||
zIndex: 1000,
|
||||
verticalAlign: 'middle',
|
||||
WebkitUserSelect: 'none',
|
||||
WebkitAppRegion: "drag"
|
||||
WebkitAppRegion: "drag",
|
||||
},
|
||||
titleBarText: {
|
||||
color: theme.palette.common.white,
|
||||
|
|
|
@ -300,6 +300,17 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
}
|
||||
}
|
||||
|
||||
titlebar() {
|
||||
const { classes } = this.props;
|
||||
if ((navigator.userAgent.includes(this.state.brandName || "Hyperspace") || navigator.userAgent.includes("Electron")) && navigator.userAgent.includes("Macintosh")) {
|
||||
return (
|
||||
<div className={classes.titleBarRoot}>
|
||||
<Typography className={classes.titleBarText}>{this.state.brandName? this.state.brandName: "Hyperspace"}</Typography>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
showLanding() {
|
||||
const { classes } = this.props;
|
||||
return (
|
||||
|
@ -435,6 +446,8 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
render() {
|
||||
const { classes } = this.props;
|
||||
return (
|
||||
<div>
|
||||
{this.titlebar()}
|
||||
<div className={classes.root} style={{ backgroundImage: `url(${this.state !== null? this.state.backgroundUrl: "background.png"})`}}>
|
||||
<Paper className={classes.paper}>
|
||||
<img className={classes.logo} alt={this.state? this.state.brandName: "Hyperspace"} src={this.state? this.state.logoUrl: "logo.png"}/>
|
||||
|
@ -464,6 +477,7 @@ class WelcomePage extends Component<IWelcomeProps, IWelcomeState> {
|
|||
</Paper>
|
||||
{this.showAuthDialog()}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,25 @@ export const styles = (theme: Theme) => createStyles({
|
|||
paddingRight: '35%',
|
||||
}
|
||||
},
|
||||
titleBarRoot: {
|
||||
top: 0,
|
||||
left: 0,
|
||||
height: 24,
|
||||
width: '100%',
|
||||
backgroundColor: "rgba(0, 0, 0, 0.2)",
|
||||
textAlign: 'center',
|
||||
zIndex: 1000,
|
||||
verticalAlign: 'middle',
|
||||
WebkitUserSelect: 'none',
|
||||
WebkitAppRegion: "drag",
|
||||
position: "absolute"
|
||||
},
|
||||
titleBarText: {
|
||||
color: theme.palette.common.white,
|
||||
fontSize: 12,
|
||||
paddingTop: 2,
|
||||
paddingBottom: 1
|
||||
},
|
||||
paper: {
|
||||
height: '100%',
|
||||
[theme.breakpoints.up('sm')]: {
|
||||
|
|
Loading…
Reference in New Issue