Skip to content

Commit

Permalink
🐛 Fixed uncaught promise error
Browse files Browse the repository at this point in the history
  • Loading branch information
KenAJoh committed Dec 6, 2023
1 parent d9aade1 commit 4118b24
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import Hero from "./hero/Hero";
function GodPraksisPage(
props: GpEntryPageProps & { type: "frontpage" | "tema-page" }
) {
console.log(props);
return (
/* TODO: Add surface-subtle to page-component props */
<Page
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import clsx from "clsx";
import dynamic from "next/dynamic";
import { BodyLong, Box, HStack, Heading, Tag, VStack } from "@navikt/ds-react";
import { Sticker } from "./Sticker";

const Sticker = dynamic(() => import("./Sticker"), {
ssr: false,
});

const trunc = (text, num_chars) => {
return `${text.substring(0, num_chars)}${
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import ErrorBoundary from "@/error-boundary";
import { GpArticleViews } from "@/layout/god-praksis-page/types";
import ArticleGrid from "./ArticleGrid";

Expand All @@ -21,4 +22,10 @@ function ArticleList({ views }: GpArticleViews) {
);
}

export default ArticleList;
export default function Component(props: GpArticleViews) {
return (
<ErrorBoundary boundaryName="Accordion">
<ArticleList {...props} />
</ErrorBoundary>
);
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import clsx from "clsx";
import dynamic from "next/dynamic";

export const Sticker = dynamic(() => Promise.resolve(_Sticker), { ssr: false });

const _Sticker = ({ text = "NEW!", large = false }) => {
const Sticker = ({ text = "NEW!", large = false }) => {
return (
<>
<style>
Expand Down Expand Up @@ -47,3 +44,5 @@ const _Sticker = ({ text = "NEW!", large = false }) => {
</>
);
};

export default Sticker;

0 comments on commit 4118b24

Please sign in to comment.