Remove magic numbers and tidy up

This commit is contained in:
Simon Howe
2016-10-05 10:12:16 +02:00
parent 83d4fad5b4
commit 6996e58c8b
2 changed files with 5 additions and 7 deletions
@@ -48,8 +48,8 @@ class DetailsCard extends React.Component {
}
const style = {
transform,
left: showingTerminal ? 36 : null,
width: showingTerminal ? null : 420
left: showingTerminal ? MARGINS.right : null,
width: showingTerminal ? null : WIDTH
};
return (
<div className="details-wrapper" style={style}>
@@ -2,6 +2,7 @@ import React from 'react';
import { connect } from 'react-redux';
import { brightenColor, getNodeColorDark } from '../utils/color-utils';
import { DETAILS_PANEL_WIDTH, DETAILS_PANEL_MARGINS } from '../constants/styles';
import Terminal from './terminal';
class EmeddedTerminal extends React.Component {
@@ -23,11 +24,8 @@ class EmeddedTerminal extends React.Component {
}
getTransform() {
//
// lazy but close enough for a quick transition
//
const dx = this.state.mounted ? 0 : window.innerWidth - 420;
console.log('dx', dx);
const dx = this.state.mounted ? 0 :
window.innerWidth - DETAILS_PANEL_WIDTH - DETAILS_PANEL_MARGINS.right;
return `translateX(${dx}px)`;
}