Denys Konovalov
a275283b6e
- [x] Update auf Static CMS v2.0 - [x] aktualisierte Shortcodes (schließt #225) - [x] aktualisierte Previews (schließt #181) - Ordnerunterstützung - [x] vervollständigte Seiten - [x] Aufräumarbeiten Reviewed-on: https://git.cantorgymnasium.de/gcg/gcg-website/pulls/226
33 lines
671 B
JavaScript
33 lines
671 B
JavaScript
import { Container, PageHeader, Section, Row } from "./components/index.js";
|
|
|
|
const AbiturientenPreview = ({ widgetFor, entry, collection, fields }) => {
|
|
const imageField = useMemo(
|
|
() => fields.find((field) => field.name === "image"),
|
|
[fields]
|
|
);
|
|
|
|
const imageUrl = useMediaAsset(
|
|
entry.data.image,
|
|
collection,
|
|
imageField,
|
|
entry
|
|
);
|
|
return [
|
|
PageHeader(entry),
|
|
Section(
|
|
Container(
|
|
Row([
|
|
h(
|
|
"div",
|
|
{ className: "col-12 mb-4" },
|
|
h("img", { className: "img-fluid w-100", src: imageUrl })
|
|
),
|
|
h("div", { className: "col-12 content" }, widgetFor("body")),
|
|
])
|
|
)
|
|
),
|
|
];
|
|
};
|
|
|
|
export default AbiturientenPreview;
|