Skip to content

Commit

Permalink
isContentOnlyMode
Browse files Browse the repository at this point in the history
  • Loading branch information
juliuxu committed Aug 12, 2023
1 parent d85fd4d commit 88afa5a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
30 changes: 15 additions & 15 deletions apps/nye-julianjark.no/app/routes/i-dag-lærte-jeg.$slug/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { buildSiteHeaderMetaInfo } from "~/components/site-header";
import { useDevMode } from "~/root";
import { classes } from "../($prefix).$notionPage/notion-driven-page";
import { TodayILearnedArticlePreviewList } from "./today-i-learned-article-preview";
import { useContentOnlyMode } from "~/content-only-mode";

export const meta: V2_MetaFunction<typeof loader> = ({ data }) => {
return [
Expand Down Expand Up @@ -69,6 +70,7 @@ export default function Component() {
const { entry, relatedEntries } = useLoaderData<typeof loader>();
useEditNotionPage({ pageId: entry.id });
const devMode = useDevMode();
const isContentOnlyMode = useContentOnlyMode();
return (
<>
<main className="max-w-3xl mx-auto">
Expand All @@ -84,21 +86,19 @@ export default function Component() {
)}
<TodayILearnedArticle entry={entry} titleAs="h1" />
</main>
<aside>
{relatedEntries.length > 0 && (
<>
<hr className={classes.divider.root} />
<h2 className=" text-h2 lg:text-h2-lg mb-6 lg:mb-12">
Andre ting jeg har lært
</h2>
<TodayILearnedArticlePreviewList
titleAs="h3"
entries={relatedEntries}
hideSummary
/>
</>
)}
</aside>
{!isContentOnlyMode && relatedEntries.length > 0 && (
<aside>
<hr className={classes.divider.root} />
<h2 className=" text-h2 lg:text-h2-lg mb-6 lg:mb-12">
Andre ting jeg har lært
</h2>
<TodayILearnedArticlePreviewList
titleAs="h3"
entries={relatedEntries}
hideSummary
/>
</aside>
)}
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ export function TodayILearnedArticle({
<time className="block mt-2 text-body lg:text-body">
{dateFormatter.format(new Date(entry.publishedDate))}
</time>

<div className="mt-4 md:mt-6">
<ul className="flex gap-2">
{entry.tags.map((tag) => (
<Badge as="li" key={tag.id} color={tag.color}>
{tag.title}
</Badge>
))}
</ul>
</div>
</>
)}

<div className="mt-4 md:mt-6">
<ul className="flex gap-2">
{entry.tags.map((tag) => (
<Badge as="li" key={tag.id} color={tag.color}>
{tag.title}
</Badge>
))}
</ul>
</div>

<div
className={classNames(
!isContentOnlyMode && "mt-6",
Expand Down

0 comments on commit 88afa5a

Please sign in to comment.