Skip to content

Instantly share code, notes, and snippets.

View samuelhorn's full-sized avatar
👨‍💻
jam stackin'

Samuel Horn af Rantzien samuelhorn

👨‍💻
jam stackin'
View GitHub Profile
@samuelhorn
samuelhorn / relatedposts.tsx
Last active October 24, 2023 08:50
How to fetch content relationships in a slice
@samuelhorn
samuelhorn / menu-items-no-slicezone.tsx
Last active December 6, 2023 08:43
Menu items as Slices without SliceZone, as used in Prismic top level menu
<ul className="flex flex-col lg:items-center lg:flex-row lg:justify-center">
{layout.data.slices1.map((item, index) => {
if (item.variation === "default") {
return (
<MenuItem
key={index}
slice={item}
/>
);
} else {
@samuelhorn
samuelhorn / menu-items-slicezone.tsx
Last active December 6, 2023 08:45
Menu items rendered in SliceZone as in Prismic's sub menu within a <MenuItemWithSubmenu />
<div className="px-0 container lg:px-8 flex flex-col lg:flex-row">
<div
className="flex flex-col lg:w-[26.6666666667%] lg:py-12 gap-3 my-6 lg:my-0"
>
<SliceZone
slices="{slice.primary.sub_menu.data.slices}"
components="{components}"
/>
</div>
<ColumnSeparator />