Skip to content

Commit

Permalink
feat(dashboard): Add Terminal and Wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
FranklinWaller committed Aug 21, 2019
1 parent 4a4bafd commit e22fccb
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 14 deletions.
177 changes: 177 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"dependencies": {
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@material-ui/core": "^4.3.2",
"@material-ui/icons": "^4.2.1",
"@types/react-loadable": "^5.5.1",
"babel-polyfill": "^6.26.0",
"classnames": "^2.2.6",
Expand All @@ -41,6 +42,7 @@
"redux": "^3.6.0",
"redux-logger": "^2.10.2",
"redux-thunk": "^2.1.0",
"terminal-in-react": "^4.3.1",
"whatwg-fetch": "^3.0.0"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/js/components/molecules/App/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class App extends React.Component {
if (!userWantsToOpen) return;
}

this.props.dispatch(openApp(this.props.app));
window.open(this.props.app.main);
// window.location.href = this.props.app.main;
// this.props.dispatch(openApp(this.props.app));
}

handlePopoverClose() {
Expand Down
1 change: 1 addition & 0 deletions src/js/components/molecules/App/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
z-index: 1;

img {
border-radius: 10px;
width: 100%;
max-height: 100%;
}
Expand Down
13 changes: 13 additions & 0 deletions src/js/components/molecules/AppCanvas/AppCanvas.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';
import AppTerminal from '../../organims/AppTerminal';

function AppCanvas() {
return (
<>
<AppTerminal />
</>
);
}


export default AppCanvas;
1 change: 1 addition & 0 deletions src/js/components/molecules/AppCanvas/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './AppCanvas';
6 changes: 6 additions & 0 deletions src/js/components/molecules/SideNavigation/SideNavigation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import MenuItem from 'material-ui/MenuItem';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import BusinessIcon from 'material-ui/svg-icons/communication/business';
import AccountIcon from 'material-ui/svg-icons/action/account-circle';
import AccountBalanceWalletIcon from '@material-ui/icons/AccountBalanceWallet';
import PowerIcon from 'material-ui/svg-icons/action/power-settings-new';
import ArrowRightIcon from 'material-ui/svg-icons/hardware/keyboard-arrow-right';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
Expand Down Expand Up @@ -42,6 +43,10 @@ class SideNavigation extends React.Component {
window.location.reload();
}

openWallet() {

}

getMenuItems() {
const profileMenuItem = <MenuItem onClick={() => this.handleRequestChange(false)} leftIcon={<ArrowRightIcon color={white} />} rightIcon={<ProfilePic className={styles.profilePic} />}>{this.props.user.info.fullName}</MenuItem>;

Expand All @@ -59,6 +64,7 @@ class SideNavigation extends React.Component {
return (
<React.Fragment>
{profileMenuItem}
<MenuItem onClick={() => this.openWallet()} leftIcon={<AccountBalanceWalletIcon />}>Wallet</MenuItem>
<MenuItem onClick={() => this.openApp(SETTINGS_NAMESPACE)} leftIcon={<AccountIcon color={white} />}>Profile</MenuItem>
{ hasBusiness && <MenuItem onClick={() => this.openApp(BUSINESS_NAMESPACE)} leftIcon={<BusinessIcon color={white} />}>Manage accounts</MenuItem>}
<MenuItem onClick={this.handleLogoutClick} leftIcon={<PowerIcon color={white} />}>Log out</MenuItem>
Expand Down
38 changes: 38 additions & 0 deletions src/js/components/molecules/Wallet/Wallet.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import * as React from 'react';
import DialogTitle from '@material-ui/core/DialogTitle';
import Dialog from '@material-ui/core/Dialog';
import Button from '@material-ui/core/Button';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogActions from '@material-ui/core/DialogActions';

interface Props {

}

function Wallet(props: Props) {
return (
<>
<Dialog open={false}>
<DialogTitle>
Requesting to sign message:
</DialogTitle>
<DialogContent>
<DialogContentText>
Message
</DialogContentText>
</DialogContent>
<DialogActions>
<Button color="secondary">
Cancel
</Button>
<Button color="primary" autoFocus>
Sign
</Button>
</DialogActions>
</Dialog>
</>
);
}

export default Wallet;
1 change: 1 addition & 0 deletions src/js/components/molecules/Wallet/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from './Wallet';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.appCanvasHolder {
position: absolute;
top:0;
width: 100%;
height: 100%;
background: #252525;
z-index: 2;
}
Loading

0 comments on commit e22fccb

Please sign in to comment.