Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwheeler committed Aug 16, 2017
1 parent 6e671d0 commit 7a9e38e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 10 deletions.
4 changes: 4 additions & 0 deletions app/app.global.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ table {
table td {
word-wrap: break-word;
}

::-webkit-scrollbar {
display: none;
}
6 changes: 4 additions & 2 deletions app/components/HeaderActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import FaCog from 'react-icons/lib/fa/cog';
import FaEye from 'react-icons/lib/fa/eye';

const HeaderAction = styled.button`
-webkit-app-region: no-drag;
border: 0;
background: none;
outline: none;
Expand All @@ -26,7 +27,7 @@ const HeaderActionWrapper = styled.div`
transform: translateY(-50%);
`;

const HeaderActions = ({ vizActive, onVizToggle }) =>
const HeaderActions = ({ vizActive, onVizToggle }) => (
<HeaderActionWrapper>
<HeaderAction onClick={onVizToggle} vizActive={vizActive}>
<FaEye width="24px" height="24px" />
Expand All @@ -38,6 +39,7 @@ const HeaderActions = ({ vizActive, onVizToggle }) =>
>
<FaCog width="24px" height="24px" />
</HeaderAction>
</HeaderActionWrapper>;
</HeaderActionWrapper>
);

export default HeaderActions;
6 changes: 4 additions & 2 deletions app/components/HeaderIcons.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const close = () => {
};

const HeaderIcon = styled.span`
-webkit-app-region: no-drag;
background: white;
border-radius: 50%;
display: inline-block;
Expand All @@ -42,11 +43,12 @@ const HeaderIconWrapper = styled.div`
transform: translateY(-50%);
`;

const HeaderIcons = () =>
const HeaderIcons = () => (
<HeaderIconWrapper>
<HeaderIcon onClick={close} />
<HeaderIcon onClick={minimize} />
<HeaderIcon onClick={maximize} />
</HeaderIconWrapper>;
</HeaderIconWrapper>
);

export default HeaderIcons;
17 changes: 11 additions & 6 deletions app/containers/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,25 @@ class Body extends React.PureComponent {
problemsLoading: false,
};
componentWillMount() {
this.server = new SocketIO(DEFAULT_PORT);
this.server.on('connection', socket => {
socket.on('message', message => {
this.setState(handleSocketData(message));
try {
this.server = new SocketIO(DEFAULT_PORT);
} catch (e) {
alert(e);
}
this.server &&
this.server.on('connection', socket => {
socket.on('message', message => {
this.setState(handleSocketData(message));
});
});
});
}
componentDidMount() {
window.addEventListener('resize', this.checkLayout);
this.checkLayout();
}
componentWillUnmount() {
window.removeEventListener('resize', this.checkLayout);
this.server.disconnect();
this.server && this.server.disconnect();
}
checkLayout = () => {
let breakpoint;
Expand Down
1 change: 1 addition & 0 deletions app/containers/Modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Modules extends React.PureComponent {
}
if (stats) {
const modules = formatModules(stats);
console.log(modules);
return (
<Container>
<table>
Expand Down
1 change: 1 addition & 0 deletions app/util/format-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ function bundleSizeTree(stats) {

export function formatModules(data) {
let trees;
console.log(data);
if (!data.hasOwnProperty('modules')) {
trees = data.children.map(bundleSizeTree);
} else {
Expand Down

0 comments on commit 7a9e38e

Please sign in to comment.