Commit 60c624fe authored by Xavier Watkins's avatar Xavier Watkins
Browse files

Add structure component

parent 1be50d75
......@@ -3,6 +3,7 @@ import { withRouter } from "react-router-dom";
import PropTypes from "prop-types";
import axios from "axios";
import { withCookies } from "react-cookie";
import { ProtvistaUniprotStructure } from "protvista-uniprot";
import LoadingSpinner from "./components/LoadingSpinner";
import Alignment from "./components/alignment/Alignment";
......@@ -16,6 +17,16 @@ import { statusesList } from "./util/util";
import "../styles/Mapping.scss";
export const defineCustomElement = (name, customElement) => {
if (!window.customElements.get?.(name)) {
try {
window.customElements.define(name, customElement);
} catch (err) {
/**/
}
}
};
class Mapping extends Component {
defaultState = {
details: null,
......@@ -42,6 +53,10 @@ class Mapping extends Component {
};
this.getMappingDetails(mappingId, isLoggedIn);
defineCustomElement(
"protvista-uniprot-structure",
ProtvistaUniprotStructure
);
}
componentDidUpdate(prevProps) {
......@@ -176,6 +191,14 @@ class Mapping extends Component {
) : null}
</div>
{taxonomy.ensemblTaxId === 9606 && (
<div className="row column medium-12">
<protvista-uniprot-structure
accession={mapping.uniprotEntry.uniprotAccession}
></protvista-uniprot-structure>
</div>
)}
<div className="row column medium-12">
<h3>Related Mappings</h3>
<RelatedMappingsSection mappings={relatedEntries} />
......
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