import React, { PureComponent } from 'react'
import {Alert, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap'
import {Panel, Row, Col, Collapse, FormControl, FormGroup, ControlLabel, HelpBlock} from 'react-bootstrap'
import FontAwesome from 'react-fontawesome'
const defaultHost = "https://auth.dataporten.no"
class Component extends PureComponent {
constructor(props) {
super(props)
this.state = {
hostname: defaultHost
}
}
discoveryStart(e) {
console.log("Setting hostname", this.state.hostname)
console.log(this.props)
this.props.discoveryStart(this.state.hostname)
}
updateHostfield(e) {
console.log("Updating hostname to ", e.target.value)
this.setState({hostname: e.target.value})
}
handleAlertDismiss() {
console.error("TODO: Dismiss alert.")
// this.setState({hostname: e.target.value})
}
getErrorMessage() {
if (this.props.serverError) {
console.log(typeof this.props.serverError)
console.error(this.props.serverError)
return (
{this.props.serverError.toString()}
or
Error performing OAuth Discovery
{this.props.serverError}