-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(WindowManager): Add ability to theme the app window with manifes…
…t.json
- Loading branch information
1 parent
f87155d
commit 25f252b
Showing
16 changed files
with
246 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
42 changes: 6 additions & 36 deletions
42
src/js/components/molecules/SideNavigation/SideNavigation.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,13 @@ | ||
:local .drawer { | ||
& > div { | ||
& span { | ||
color: white!important; | ||
|
||
&:hover { | ||
background: linear-gradient(to right, rgb(0, 201, 253) 0%, rgb(129, 238, 142) 100%) 0px 0px repeat scroll rgba(0, 0, 0, 0)!important; | ||
} | ||
} | ||
.drawerList { | ||
width: 250px; | ||
} | ||
|
||
&:last-child { | ||
background-color: #333333!important; | ||
} | ||
} | ||
.drawer { | ||
// background-color: #333333; | ||
} | ||
|
||
:local .profilePic { | ||
.profilePic { | ||
position: absolute; | ||
top:4px; | ||
right: 20px; | ||
} | ||
|
||
// Desktop only styles. | ||
@media screen and (min-width: 767px) { | ||
:local .drawer { | ||
// The background for the drawer | ||
& > div:first-child { | ||
background: none!important; | ||
} | ||
|
||
// The Drawer | ||
& > div:last-child { | ||
// height: calc(100% - #{$header-height}) !important; | ||
// margin-top: $header-height; | ||
border-left: 1px solid rgba(255, 255, 255, 0.28); | ||
|
||
// MenuItem | ||
& > div:first-child { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
src/js/components/molecules/SideNavigation/SideNavigation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import * as React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import Drawer from '@material-ui/core/Drawer'; | ||
import List from '@material-ui/core/List'; | ||
import ListItem from '@material-ui/core/ListItem'; | ||
import ListItemText from '@material-ui/core/ListItemText'; | ||
import ListItemIcon from '@material-ui/core/ListItemIcon'; | ||
import PowerSettingsNewIcon from '@material-ui/icons/PowerSettingsNew'; | ||
import GetAppIcon from '@material-ui/icons/GetApp'; | ||
import { setOpenSideBarNavigationState } from '../../../store/SideBarNavigationStore'; | ||
import UserService from '../../../services/UserService'; | ||
const styles = require('./SideNavigation.scss'); | ||
|
||
interface Props { | ||
isOpen: boolean; | ||
dispatch: Function; | ||
} | ||
|
||
function SideNavigation(props: Props) { | ||
function handleDrawerOnClose() { | ||
props.dispatch(setOpenSideBarNavigationState(false)); | ||
} | ||
|
||
async function handleLogoutClick() { | ||
await UserService.logout(); | ||
location.reload(); | ||
} | ||
|
||
return ( | ||
<Drawer className={styles.drawer} anchor="right" open={props.isOpen} onClose={handleDrawerOnClose}> | ||
<List className={styles.drawerList}> | ||
<ListItem button> | ||
<ListItemIcon> | ||
<GetAppIcon /> | ||
</ListItemIcon> | ||
<ListItemText>Install App</ListItemText> | ||
</ListItem> | ||
<ListItem button onClick={handleLogoutClick}> | ||
<ListItemIcon> | ||
<PowerSettingsNewIcon /> | ||
</ListItemIcon> | ||
<ListItemText>Logout</ListItemText> | ||
</ListItem> | ||
</List> | ||
</Drawer> | ||
); | ||
} | ||
|
||
const mapStateToProps = (state: any) => ({ | ||
user: state.UserInfoStore, | ||
isOpen: state.SideBarNavigationStore.isOpen, | ||
}); | ||
|
||
export default connect(mapStateToProps)(SideNavigation); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 10 additions & 3 deletions
13
src/js/components/organims/AppProcessesHolder/AppCanvasHolder.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
@import '../../../../scss/variables'; | ||
|
||
.processHolder { | ||
width: 200%; | ||
height: 200%; | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
top: $header-height; | ||
top: 0; | ||
z-index: 100; | ||
pointer-events: none; | ||
} | ||
|
||
@media screen and (min-width: $desktop-breakpoint) { | ||
.processHolder { | ||
top: $header-height; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@import '../../../../scss/variables'; | ||
|
||
$appbar-height: 35px; | ||
$window-border-radius: 5px; | ||
|
||
.appBar { | ||
width: 100%; | ||
height: $appbar-height; | ||
background: #f6f6f6; | ||
color: #3c3c3c; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
|
||
@media screen and (min-width: $desktop-breakpoint) { | ||
.appBar { | ||
border-top-left-radius: $window-border-radius; | ||
border-top-right-radius: $window-border-radius; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as React from 'react'; | ||
import IconButton from '@material-ui/core/IconButton'; | ||
import CloseIcon from '@material-ui/icons/Close'; | ||
import ArrowBackIcon from '@material-ui/icons/ArrowBack'; | ||
import { connect } from 'react-redux'; | ||
import { Process, killProcess, closeApp } from '../../../store/AppProcessesStore'; | ||
import getIdealTextColor from '../../../services/micro/getIdealTextColor'; | ||
import useMedia from '../../../services/hooks/useMedia'; | ||
import Time from '../../atoms/Time'; | ||
const styles = require('./AppTitleBar.scss'); | ||
|
||
interface Props { | ||
title: string; | ||
process: Process; | ||
dispatch: Function; | ||
} | ||
|
||
function AppTitleBar(props: Props) { | ||
const isDesktop = useMedia('(min-width: 960px)'); | ||
|
||
function handleCloseClick() { | ||
props.dispatch(killProcess(props.process.id)); | ||
} | ||
|
||
const textColor = getIdealTextColor(props.process.app.background_color); | ||
|
||
return ( | ||
<header className={styles.appBar} style={{ backgroundColor: props.process.app.background_color }}> | ||
<IconButton aria-label="Back" style={{ color: textColor }}> | ||
<ArrowBackIcon /> | ||
</IconButton> | ||
{isDesktop && <span style={{ color: textColor }}>{props.process.app.short_name}</span>} | ||
{!isDesktop && <Time style={{ color: textColor }} />} | ||
<IconButton aria-label="Close" onClick={handleCloseClick} style={{ color: textColor }}> | ||
<CloseIcon /> | ||
</IconButton> | ||
</header> | ||
); | ||
} | ||
|
||
const mapStateToProps = (store: any) => { | ||
return { | ||
a: 1, | ||
} | ||
} | ||
|
||
// @ts-ignore | ||
export default connect(mapStateToProps)(AppTitleBar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function resolveUrl(url: string, relativeUrl: string) { | ||
return new URL(relativeUrl, url).href; | ||
} |
Oops, something went wrong.