Skip to content

Commit

Permalink
StructDownloadButton - rm chemdoodle format
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Dec 6, 2024
1 parent 797abd8 commit 7090b44
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions lib/components/StructDownloadButton/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@ import Popover from "react-bootstrap/Popover";

import styles from "./styles.module.css";

const defaultFormats = [
{ format: "cif", label: "CIF" },
{ format: "xsf", label: "XSF" },
{ format: "xyz", label: "XYZ" },
];

export function StructDownloadButton(props) {
var dl_url = `${props.aiida_rest_url}/nodes/${props.uuid}/download`;
const dl_url = `${props.aiida_rest_url}/nodes/${props.uuid}/download`;
const downloadFormats = props.download_formats || defaultFormats;

var clickPopover = (
const clickPopover = (
<Popover>
<Popover.Body style={{ padding: "5px 0px" }}>
<ul className={styles.download_dropdown_menu}>
<li>
<a href={`${dl_url}?download_format=chemdoodle`}>ChemDoodle</a>
</li>
<li>
<a href={`${dl_url}?download_format=cif`}>CIF</a>
</li>
<li>
<a href={`${dl_url}?download_format=xsf`}>XSF</a>
</li>
<li>
<a href={`${dl_url}?download_format=xyz`}>XYZ</a>
</li>
{downloadFormats.map(({ format, label }) => (
<li key={format}>
<a href={`${dl_url}?download_format=${format}`}>{label}</a>
</li>
))}
</ul>
</Popover.Body>
</Popover>
);

return (
<OverlayTrigger
trigger="click"
Expand Down

0 comments on commit 7090b44

Please sign in to comment.