summaryrefslogtreecommitdiff
path: root/www/app/components/center.js
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-09-05 17:34:11 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2016-09-06 13:55:16 -0400
commit65c2c18653feb5f6485710e9656b19e368bb2826 (patch)
treea279d6f4eb502b30606870cd34af2896eef7321d /www/app/components/center.js
parentb047beb3e50a541564d2ab6ff17491608a630101 (diff)
[feature] webkit support: get the js and css working in older webkit engines
Diffstat (limited to 'www/app/components/center.js')
-rw-r--r--www/app/components/center.js23
1 files changed, 5 insertions, 18 deletions
diff --git a/www/app/components/center.js b/www/app/components/center.js
index a3b6409..6fa6212 100644
--- a/www/app/components/center.js
+++ b/www/app/components/center.js
@@ -4,22 +4,6 @@
import React from 'react'
-const CONTAINER_CSS = {
- position: 'absolute',
- display: 'flex',
- justifyContent: 'center',
- alignContent: 'center',
- alignItems: 'center',
- top: "0px",
- left: "0px",
- height: "100%",
- width: "100%"
-}
-
-const ITEM_CSS = {
- flex: "0 1 auto"
-}
-
class Center extends React.Component {
static get defaultProps() {return{
@@ -31,9 +15,12 @@ class Center extends React.Component {
}
render() {
- let style = this.props.width ? Object.assign({width: this.props.width + 'px'}, ITEM_CSS) : ITEM_CSS
+ let style = null
+ if (this.props.width) {
+ style = {width: this.props.width + 'px'}
+ }
return (
- <div className="center-container" style={CONTAINER_CSS}>
+ <div className="center-container">
<div className="center-item" style={style}>
{this.props.children}
</div>