UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

47 lines (46 loc) 2.03 kB
import { jsxs as o, jsx as e } from "react/jsx-runtime"; import { WideButton as p } from "../styled/WideButton.js"; import { Component as g } from "react"; class N extends g { constructor(n) { super(n), this.handleLinkClick = this.handleLinkClick.bind(this); } handleLinkClick = (n) => (a) => { a.preventDefault(), window.open(n, "_blank"); }; render() { const { data: n, schema: a } = this.props, s = n[a.organizationName], r = n[a.organizationPath], m = n[a.summary], l = n[a.website], c = n[a.logo]; let i = l.replace("https://", ""); i = i.replace("http://", ""), i.charAt(i.length - 1) === "/" && (i = i.substring( 0, i.length - 1 )); const t = typeof window < "u" && window.location.hash.substring(1) === r, d = {}; let h; return t ? d.paddingBottom = "42px" : h = /* @__PURE__ */ e("div", { className: "SRC-marginAuto SRC-cardAction", children: /* @__PURE__ */ e( p, { href: r, variant: "contained", color: "secondary", children: "View Funded Research" } ) }), /* @__PURE__ */ o("div", { className: "SRC-portalCard SRC-typeFunder ", style: d, children: [ /* @__PURE__ */ o("div", { className: "SRC-cardContent", children: [ /* @__PURE__ */ e("div", { className: "SRC-type", children: "Organization" }), c && /* @__PURE__ */ e("div", { className: "SRC-cardThumbnail", children: /* @__PURE__ */ e("img", { alt: "funder logo", className: "SRC-logo", src: c }) }), /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o("h3", { children: [ t && s, !t && /* @__PURE__ */ e("a", { href: r, children: s }) ] }) }), /* @__PURE__ */ e("div", { className: "SRC-website", children: /* @__PURE__ */ e("a", { rel: "noopener noreferrer", target: "_blank", href: l, children: i }) }), /* @__PURE__ */ e("div", { className: "SRC-description", children: m }) ] }), h ] }); } } export { N as default }; //# sourceMappingURL=Funder.js.map