1
0
Fork 0

feat(fs.share): Recurse in ReadMore component

This commit is contained in:
Joost De Cock 2022-01-16 12:21:36 +01:00
parent c7f3788732
commit 149ad90feb
3 changed files with 12 additions and 11 deletions

View file

@ -9,13 +9,14 @@ const currentChildren = current => Object.values(order(current))
const ReadMore = props => {
const root = get(props.app.navigation, props.app.slug.split('/'))
const root = get(props.app.navigation, props.slug.split('/'))
const list = []
for (const page of currentChildren(root)) {
list.push(<li key={page.__slug}>
list.push(<li key={page.__slug} className={props.recurse ? 'ont-bold' : ''}>
<Link href={`/${page.__slug}`}>
<a>{page.__title}</a>
<a className={props.recurse ? 'inline-block font-bold pt-3 pb-1' : ''}>{page.__title}</a>
</Link>
{props.recurse && <ReadMore app={props.app} slug={page.__slug} />}
</li>)
}
return <ul>{list}</ul>