Commit fc0abc25 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Revert "Updates to the embedded view"

This reverts commit 77e57e2b.
parent 9a21d681
......@@ -3,7 +3,7 @@ import React from 'react'
import FontAwesome from 'react-fontawesome'
// import HostnameInput from '../components/HostnameInput'
// import { discoveryStart } from '../actions/'
import {Radio, ListGroup, Label, ListGroupItem, Alert, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap'
import {ListGroup, Label, ListGroupItem, Alert, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap'
import API from '../utils/API'
class XController extends React.Component {
......@@ -12,37 +12,18 @@ class XController extends React.Component {
this.props.orcidRemove(id)
}
radioSelect(id) {
console.error("RADIO SELECT", id)
}
getORCIDentry(orcid) {
if (this.props.embedded) {
return (
<ListGroupItem key={orcid.orcid}>
<Button key={orcid.orcid} onClick={this.orcidRemove.bind(this, orcid.orcid)} className="pull-right" bsSize="small" bsStyle="danger">Fjern</Button>
<Radio name="orcidSelector" onChange={this.radioSelect.bind(this, orcid.orcid)} inline>
<h4>{orcid.orcid} { orcid.verified ? <FontAwesome name='check-circle-o' /> : <Label bsStyle="danger">unverified</Label> }</h4>
</Radio>
</ListGroupItem>
)
}
return (
<ListGroupItem key={orcid.orcid}>
<Button key={orcid.orcid} onClick={this.orcidRemove.bind(this, orcid.orcid)} className="pull-right" bsSize="small" bsStyle="danger">Fjern</Button>
<h4>{orcid.orcid} { orcid.verified ? <FontAwesome name='check-circle-o' /> : <Label bsStyle="danger">unverified</Label> }</h4>
</ListGroupItem>
)
}
render() {
var content
if (this.props.orcids.items.length > 0) {
content = this.props.orcids.items.map((orcid) => this.getORCIDentry(orcid))
content = this.props.orcids.items.map((orcid) =>
(
<ListGroupItem key={orcid.orcid}>
<Button key={orcid.orcid} onClick={this.orcidRemove.bind(this, orcid.orcid)} className="pull-right" bsSize="small" bsStyle="danger">Fjern</Button>
<h4>{orcid.orcid} { orcid.verified ? <FontAwesome name='check-circle-o' /> : <Label bsStyle="danger">unverified</Label> }</h4>
</ListGroupItem>
)
)
} else {
content = (
<div>Ingen ORCIDs registrert på din bruker.</div>
......@@ -65,8 +46,7 @@ class XController extends React.Component {
const mapStateToProps = (state) => ({
orcids: state.orcids,
embedded: state.embedded
orcids: state.orcids
})
const mapDispatchToProps = {
......
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