From d1b4451ef6f7452a76c32c1d1e74f4f6bb113f10 Mon Sep 17 00:00:00 2001 From: Zach Fogg Date: Thu, 14 May 2015 17:51:29 -0700 Subject: [PATCH] Vertical centering via flexbox. You get horizontal centering for free. --- lib/components/Centered.js | 52 ++++++---------------------------- lib/components/DownloadPage.js | 8 +++--- lib/components/DropZone.js | 1 - lib/components/UploadPage.js | 6 ++-- 4 files changed, 15 insertions(+), 52 deletions(-) diff --git a/lib/components/Centered.js b/lib/components/Centered.js index ee88844..69101e3 100644 --- a/lib/components/Centered.js +++ b/lib/components/Centered.js @@ -3,51 +3,15 @@ import React from 'react' export default class Centered extends React.Component { render() { - const h = this.props.hor - const v = this.props.ver - - if (h && v) { - - return
-
-
- {this.props.children} -
-
-
- - } else if (h && !v) { - - return
-
- {this.props.children} -
+ return
+
+ {this.props.children}
- - } else if (!h && v) { - - return
-
- {this.props.children} -
-
- - } else { - - return this.props.children - - } +
} } diff --git a/lib/components/DownloadPage.js b/lib/components/DownloadPage.js index 6da838b..7f31093 100644 --- a/lib/components/DownloadPage.js +++ b/lib/components/DownloadPage.js @@ -38,7 +38,7 @@ export default class DownloadPage extends React.Component { render() { switch (this.state.status) { case 'ready': - return + return

FilePizza

+ return

FilePizza

case 'cancelled': - return + return

FilePizza

case 'done': - return + return

FilePizza

- + @@ -65,7 +65,7 @@ export default class UploadPage extends React.Component { case 'processing': - return + return @@ -77,7 +77,7 @@ export default class UploadPage extends React.Component { case 'uploading': var keys = Object.keys(this.state.peerProgress) keys.reverse() - return + return

FilePizza