synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
172 lines (171 loc) • 4.49 kB
JavaScript
import { jsxs as m, jsx as e, Fragment as x } from "react/jsx-runtime";
import { PRODUCTION_ENDPOINT_CONFIG as h } from "../../utils/functions/getEndpoint.js";
import { Box as n, Typography as i, Button as R, Link as y } from "@mui/material";
import { Link as C } from "react-router";
import { formatReleaseCardData as S } from "./ReleaseCardUtils.js";
function w({ value: t, label: a }) {
return /* @__PURE__ */ m(x, { children: [
/* @__PURE__ */ e(
n,
{
sx: {
gridColumn: "span 1",
gridRow: "span 1",
justifySelf: "flex-end"
},
children: /* @__PURE__ */ e(
i,
{
variant: "body1",
sx: {
lineHeight: "20px"
},
children: t
}
)
}
),
/* @__PURE__ */ e(
n,
{
sx: {
gridColumn: "span 1",
gridRow: "span 1",
justifySelf: "flex-start"
},
children: /* @__PURE__ */ e(
i,
{
variant: "body1",
sx: {
lineHeight: "20px",
color: "grey.700"
},
children: a
}
)
}
)
] });
}
function I({
data: t,
schema: a,
includePortalCardClass: g = !0,
releaseCardConfig: s
}) {
const { releaseName: o, releaseEntityId: l, releaseDate: u, stats: d } = S(
a,
t,
s.releaseMetadataConfig,
s.statsConfig
);
if (o === null) return /* @__PURE__ */ e(x, {});
const p = 2, r = `span ${p}`, f = d.length + 4;
return /* @__PURE__ */ m(
n,
{
className: `ReleaseCard ${g ? "SRC-portalCard" : ""}`,
sx: {
display: "grid",
gridTemplateColumns: `repeat(${p}, 1fr)`,
// columns are controlled by this component, not the parent grid
columnGap: "10px",
gridTemplateRows: "subgrid",
// rows are controlled by parent grid, so text will be aligned across cards
gridRow: `span ${f}`,
// ensures that card spans the correct number of rows in the parent grid
rowGap: "0px",
// prevent parent grid from applying its gap to the subgrid rows
alignItems: "center",
justifyItems: "center",
textAlign: "center",
padding: "30px 40px 40px",
my: 0
// remove margin added by .SRC-portalCard - CardContainer list will set the gap between cards
},
children: [
/* @__PURE__ */ e(
n,
{
sx: {
gridColumn: r,
gridRow: "span 1",
alignSelf: "end"
},
children: /* @__PURE__ */ e(i, { variant: "headline1", children: o })
}
),
/* @__PURE__ */ e(
n,
{
sx: {
gridColumn: r,
gridRow: "span 1",
mb: "30px"
},
children: /* @__PURE__ */ e(
i,
{
variant: "body1",
sx: {
lineHeight: "20px",
fontStyle: "italic",
color: "grey.800"
},
children: `Released ${u.value}`
}
)
}
),
d.map((c) => /* @__PURE__ */ e(w, { ...c }, c.label)),
/* @__PURE__ */ e(
n,
{
sx: {
gridColumn: r,
gridRow: "span 1",
mt: "20px",
mb: "5px"
},
children: /* @__PURE__ */ e(
R,
{
component: C,
to: s.requestAccessPath,
sx: { fontSize: "14px" },
children: "Request Access"
}
)
}
),
/* @__PURE__ */ e(
n,
{
sx: {
gridColumn: r,
gridRow: "span 1"
},
children: l && /* @__PURE__ */ e(
y,
{
href: `${h.PORTAL}Synapse:${l}`,
target: "_blank",
rel: "noreferrer",
sx: {
fontSize: "14px",
textDecoration: "none"
},
children: "View on Synapse.org"
}
)
}
)
]
}
);
}
export {
I as ReleaseCardMedium
};
//# sourceMappingURL=ReleaseCardMedium.js.map