-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
62 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"use client"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
import { BibleContentChild } from "@/site/bible-contents"; | ||
import Link from "next/link"; | ||
import { usePathname } from "next/navigation"; | ||
import { FC } from "react"; | ||
|
||
export const BibleChild: FC<BibleContentChild> = (child) => { | ||
const segment = usePathname(); | ||
const isActive = segment?.includes(child.href); | ||
return ( | ||
<Link | ||
href={child.href} | ||
className={cn("text-muted-foreground", isActive && "text-primary")} | ||
> | ||
{child.title} | ||
</Link> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Stack } from "@/components/primitives/stack"; | ||
import { Text } from "@/components/typography/text"; | ||
import { BibleContent, bibleContents } from "@/site/bible-contents"; | ||
import { FC } from "react"; | ||
import { BibleChild } from "./bible-child"; | ||
|
||
export const BibleSide = () => { | ||
return ( | ||
<Stack gap="2xl" className="p-4"> | ||
{bibleContents.map((bibleContent) => ( | ||
<BibleContent key={bibleContent.title} {...bibleContent} /> | ||
))} | ||
</Stack> | ||
); | ||
}; | ||
|
||
const BibleContent: FC<BibleContent> = (content) => { | ||
const bibleChilds = ( | ||
<Stack gap="xs" className="pl-xs border-l-2"> | ||
{content.children.map((bibleChild) => ( | ||
<BibleChild key={bibleChild.title} {...bibleChild} /> | ||
))} | ||
</Stack> | ||
); | ||
|
||
const title = <Text>{content.title}</Text>; | ||
|
||
return ( | ||
<Stack gap="xs"> | ||
{title} | ||
{bibleChilds} | ||
</Stack> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,3 @@ | ||
import { Stack } from "@/components/primitives/stack"; | ||
import { Text } from "@/components/typography/text"; | ||
import { | ||
BibleContent, | ||
BibleContentChild, | ||
bibleContents, | ||
} from "@/site/bible-contents"; | ||
import Link from "next/link"; | ||
import { FC } from "react"; | ||
|
||
export default function Home() { | ||
return ( | ||
<Stack gap="2xl" className="p-4"> | ||
{bibleContents.map((bibleContent) => ( | ||
<BibleContent key={bibleContent.title} {...bibleContent} /> | ||
))} | ||
</Stack> | ||
); | ||
return <div>home</div>; | ||
} | ||
|
||
const BibleContent: FC<BibleContent> = (content) => { | ||
const bibleChilds = ( | ||
<Stack gap="xs" className="pl-xs border-l-2"> | ||
{content.children.map((bibleChild) => ( | ||
<BibleChild key={bibleChild.title} {...bibleChild} /> | ||
))} | ||
</Stack> | ||
); | ||
|
||
const title = <Text tone="muted">{content.title}</Text>; | ||
|
||
return ( | ||
<Stack gap="xs"> | ||
{title} | ||
{bibleChilds} | ||
</Stack> | ||
); | ||
}; | ||
|
||
const BibleChild: FC<BibleContentChild> = (child) => { | ||
const title = child.href ? ( | ||
<Link href={child.href}> {child.title}</Link> | ||
) : ( | ||
<Text>{child.title}</Text> | ||
); | ||
|
||
const notes = child.notes && ( | ||
<Stack className="border-l-2 py-xxs" gap="xs"> | ||
{child.notes.map((note) => ( | ||
<Text key={note} tone="muted" className="pl-xs"> | ||
{note} | ||
</Text> | ||
))} | ||
</Stack> | ||
); | ||
|
||
return ( | ||
<Stack gap="xxs"> | ||
{title} | ||
{notes} | ||
</Stack> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters