visually center root node

Summary: root node is now centerwed between edge and editor

Reviewed By: emilsjolander

Differential Revision: D6989159

fbshipit-source-id: ce2621402d380843125fabc43452c64ea3b563dd
This commit is contained in:
Daniel Büchele
2018-02-15 08:25:14 -08:00
committed by Facebook Github Bot
parent 35c6931ade
commit 91621641e6
3 changed files with 48 additions and 42 deletions

View File

@@ -49,6 +49,10 @@
align-self: center; align-self: center;
} }
.Playground.standalone > .YogaNode {
transform: translateX(-175px);
}
.Playground .Actions { .Playground .Actions {
padding: 15px; padding: 15px;
} }

View File

@@ -218,7 +218,7 @@ export default class Playground extends Component<Props, State> {
const playground = ( const playground = (
<div <div
className="Playground" className={`Playground ${this.props.renderSidebar ? '' : 'standalone'}`}
onMouseDown={this.onMouseDown} onMouseDown={this.onMouseDown}
style={{height, maxHeight: height}} style={{height, maxHeight: height}}
ref={ref => { ref={ref => {
@@ -232,6 +232,7 @@ export default class Playground extends Component<Props, State> {
direction={direction} direction={direction}
showGuides={this.props.showGuides} showGuides={this.props.showGuides}
/> />
{!this.props.renderSidebar && (
<Sidebar> <Sidebar>
<div className="Actions"> <div className="Actions">
<Row gutter={15}> <Row gutter={15}>
@@ -273,6 +274,7 @@ export default class Playground extends Component<Props, State> {
</div> </div>
)} )}
</Sidebar> </Sidebar>
)}
</div> </div>
); );

View File

@@ -58,7 +58,7 @@ const HeroSection = () => (
const PlaygroundSection = () => ( const PlaygroundSection = () => (
<Row> <Row>
<Col xl={24} lg={0} md={0} sm={0} xs={0}> <Col xl={24} lg={0} md={0} sm={0} xs={0}>
<Playground selectedNodePath={[]} showGuides={false} height={600} /> <Playground selectedNodePath={[]} showGuides={false} height={601} />
</Col> </Col>
</Row> </Row>
); );