fix(): missing challengeNumber properties

This commit is contained in:
Eduardo Roth
2023-12-19 17:29:20 -06:00
parent 33b63f4e13
commit 0f5a452142
3 changed files with 10 additions and 10 deletions

View File

@@ -6,17 +6,17 @@ import Author from './Author.astro';
import ChallengeFooter from './ChallengeFooter.astro';
import CommentSection from './CommentSection.astro';
const {challengeNumber} = Astro.props.entry.data;
const {challenge} = Astro.props.entry.data;
const author = Astro.props.entry.data.author ? await getEntry(Astro.props.entry.data.author) : null;
const renderCommentSection = !Astro.props.entry.data.noCommentSection;
---
{ challengeNumber && author && <Author {...author.data}/> }
{ challenge?.number && author && <Author {...author.data}/> }
<Default {...Astro.props}><slot /></Default>
{challengeNumber && <ChallengeFooter {...Astro.props} />}
{challenge?.number && <ChallengeFooter {...Astro.props} />}
{ renderCommentSection && <CommentSection /> }
@@ -26,4 +26,4 @@ const renderCommentSection = !Astro.props.entry.data.noCommentSection;
font-size: var(--sl-text-xs);
color: var(--sl-color-gray-3);
}
</style>
</style>