Commit 1e2b6ff2 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Conditional rendering of intro

parent afa36264
import React from 'react'
import React, { PureComponent } from 'react'
import {Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap'
import {Row, Col, Collapse, FormControl, FormGroup, ControlLabel, HelpBlock, PanelGroup, Panel} from 'react-bootstrap'
......@@ -10,35 +10,35 @@ import HTTPResponseContainer from '../containers/HTTPResponseContainer'
import WhiteBox from './WhiteBox'
class MainContent extends PureComponent {
render() {
return (
<div>
<div className="container">
{this.props.intro &&
<Jumbotron className="uninett-color-lightBlue">
<h1>Play with OAuth 2.0</h1>
<p>Learn more about how OAuth 2.0 works, and explore OAuth protected APIs without entering any code.</p>
</Jumbotron>
}
const MainContent = () => (
<div>
<div className="container">
<Jumbotron className="uninett-color-lightBlue">
<h1>Play with OAuth 2.0</h1>
<p>Learn more about how OAuth 2.0 works, and explore OAuth protected APIs without entering any code.</p>
<WhiteBox>
<HostnameController />
<ServerConfigController />
<TokenViewContainer />
<HTTPFetchContainer />
<HTTPResponseContainer />
</WhiteBox>
</Jumbotron>
</div>
<WhiteBox>
<HostnameController />
<ServerConfigController />
<TokenViewContainer />
<HTTPFetchContainer />
<HTTPResponseContainer />
</WhiteBox>
</div>
</div>
)
</div>
)
}
}
export default MainContent
import React from 'react'
import React, { PureComponent } from 'react'
import { connect } from 'react-redux'
import Footer from '../components/Footer'
import MainContent from '../components/MainContent'
import Header from '../components/Header'
const App = ({}) => (
<div>
<Header />
<MainContent />
<Footer />
</div>
)
class App extends PureComponent {
render() {
return (
<div>
<Header />
<MainContent intro={this.props.intro}/>
<Footer />
</div>
)
}
}
const mapStateToProps = (state) => ({
intro: !state.token
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment