.gitea
assets
content
data
layouts
static
admin
config
links
previews
field-previews
page-previews
components
abiturienten-preview.js
about-preview.js
anmeldeformular-preview.js
anmeldung-preview.js
author-preview.js
blog-preview.js
cantorpreis-preview.js
chronik-index-preview.js
chronik-preview.js
contest-preview.js
event-preview.js
forms-preview.js
ganztag-preview.js
header-preview.js
index.js
kontakt-preview.js
page-preview.js
projektwoche-preview.js
styles.js
shortcodes
icons.js
index.html
data
media
schulchronik
favicon.ico
.gitignore
.mailmap
LICENSE
config.yml
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import {
|
|
Container,
|
|
ContentJustify,
|
|
PageHeader,
|
|
Section,
|
|
} from "./components/index.js";
|
|
|
|
const ContestPreview = ({ widgetFor, entry, fields, collection }) => {
|
|
const imageField = useMemo(() => {
|
|
return fields.find((field) => field.name === "image");
|
|
}, [fields]);
|
|
|
|
const imageUrl = useMediaAsset(
|
|
entry.data.image,
|
|
collection,
|
|
imageField,
|
|
entry
|
|
);
|
|
return [
|
|
PageHeader(entry),
|
|
Section(
|
|
Container([
|
|
entry.data.image && entry.data.image != "/media/image.webp"
|
|
? h("img", { className: "img-fluid w-100 mb-4", src: imageUrl })
|
|
: null,
|
|
h(
|
|
"div",
|
|
{ className: "d-flex justify-content-between mb-4" },
|
|
h(
|
|
"div",
|
|
{ className: "d-flex align-items-center" },
|
|
h("i", { className: "mdi mdi-crowd text-primary icon-md me-2" }),
|
|
h(
|
|
"div",
|
|
{ className: "text-start" },
|
|
h("h6", { className: "mb-0 text-uppercase" }, "Klassen"),
|
|
h("p", { className: "mb-0" }, entry.data.class)
|
|
)
|
|
),
|
|
entry.data.web_url
|
|
? h("a", { className: "btn btn-primary" }, "Website")
|
|
: null
|
|
),
|
|
h("hr"),
|
|
ContentJustify(widgetFor("body")),
|
|
])
|
|
),
|
|
];
|
|
};
|
|
|
|
export default ContestPreview;
|