Skip to content

Commit

Permalink
feat: add link to task content
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikssonJoakim committed Dec 13, 2022
1 parent d25b17a commit 1d0512a
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/pages/tasks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ContentBlock: React.FC<ContentBlockProps> = ({ title, description, icon })
</div>
)

const phaseTasks: PhaseTask[] = [
const phaseTasks = (originalContentUrl: string): PhaseTask[] => [
{
phase: 'Sidh',
title: (
Expand Down Expand Up @@ -280,8 +280,11 @@ const phaseTasks: PhaseTask[] = [
title: 'How to submit',
description: (
<p>
Share the content links to Anik#9282 on Discord. Only one submission per druid will be
studied.
Share the content links on{' '}
<a href={originalContentUrl} rel="noreferrer" target="_blank">
this form
</a>
. Only one submission per druid will be studied.
</p>
),
icon: <HelpIcon />
Expand All @@ -291,7 +294,14 @@ const phaseTasks: PhaseTask[] = [
]

const Tasks: NextPage<TasksProps> = props => {
const { urls } = props
const {
urls,
urls: {
tasksUrls: {
sidh: { originalContentUrl }
}
}
} = props
const [activeIndex, setActiveIndex] = useAccordion()

const handleClick = (index: number) => () => {
Expand All @@ -306,7 +316,7 @@ const Tasks: NextPage<TasksProps> = props => {
<div className="okp4-nemeton-web-page-content-container" id="tasks">
<h1>Tasks</h1>
<div className="okp4-nemeton-web-page-content-wrapper">
{phaseTasks.map(({ phase, title, content }, index, array) => {
{phaseTasks(originalContentUrl).map(({ phase, title, content }, index, array) => {
const previous: PhaseTask | null = index > 0 ? array[index - 1] : null
const active = activeIndex === index
const mustDisplayPart = !previous || previous.phase !== phase
Expand Down

0 comments on commit 1d0512a

Please sign in to comment.