Skip to content

Instantly share code, notes, and snippets.

@barongun
Created April 22, 2019 11:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barongun/61d1334cb1662fd621905fc9d133295e to your computer and use it in GitHub Desktop.
Save barongun/61d1334cb1662fd621905fc9d133295e to your computer and use it in GitHub Desktop.
import React, {Component} from 'react'
import { Container, Header, HeaderContent, Grid, GridColumn } from 'semantic-ui-react'
class Main extends Component {
constructor (props) {
super(props)
this.state = {
hello: 'heeeeeeello',
browser: {height: window.innerHeight, width: window.innerWidth},
headerHeight: 50
}
}
gridHeight = () => {
return this.state.browser.height - this.state.headerHeight
}
render () {
return (
<Container style={{width: '100%', height: this.state.browser.height, backgroundColor: 'yellow'}}>
<Header style={{backgroundColor: 'red', height: this.state.headerHeight}}>
11111
</Header>
<Grid style={{height: this.gridHeight()}}>
<GridColumn width={2} style={{backgroundColor: 'green'}}>11</GridColumn>
<GridColumn width={14} style={{backgroundColor: 'blue', width: '100%'}}>22</GridColumn>
</Grid>
</Container>
)
}
}
export default Main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment