Skip to content

Commit

Permalink
added styling to similar button, added sbolexplorer check for similar…
Browse files Browse the repository at this point in the history
…, needs updating
  • Loading branch information
danielfang97 committed Mar 25, 2024
1 parent 7cdde8f commit b3dd33a
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions frontend/components/Viewing/ViewHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,21 @@ export default function ViewHeader(properties) {
setIsEditingTitle(false);
};

const checkSBOLExplorer = () => {
axios.get(`${publicRuntimeConfig.backend}/admin/explorer`, {
headers: {
"Accept": "text/plain; charset=UTF-8",
"X-authorization": token
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error checking SBOLExplorer:', error);
});
};

return (
<div>
<div className={styles.contentheader}>
Expand Down Expand Up @@ -235,7 +250,7 @@ export default function ViewHeader(properties) {
</a>
</Link>
</div>
<div
<div
title={displayedDescription.length > 0 ? "Find all records with terms in common with this description" : ""}>
{isEditingDescription ? (
<div>
Expand Down Expand Up @@ -280,8 +295,8 @@ export default function ViewHeader(properties) {
)}
</div>
<div>
{properties.search.similar && ( //TODO: Add check for SBOLExplorer
<button className={styles.searchButton} onClick={similar}> Similar </button>
{properties.search.similar && checkSBOLExplorer?.data?.includes('SBOLExplorer') && ( //TODO: Add check for SBOLExplorer
<button className={styles.simANDTwinbutton} onClick={similar}> Similar </button>
)}
{properties.search.twins && (
<button className={styles.simANDTwinbutton} onClick={twins}> Twins </button>
Expand Down

0 comments on commit b3dd33a

Please sign in to comment.