Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

655 support markdown at develop #656

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js environment
Expand Down
13 changes: 12 additions & 1 deletion packages/berlin/src/components/option-card/OptionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { useNavigate, useParams } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
import { useMemo, useState } from 'react';
import IconButton from '../icon-button';
import Markdown from 'react-markdown';
import Link from '../link';

type OptionCardProps = {
option: GetCycleResponse['forumQuestions'][number]['questionOptions'][number];
Expand Down Expand Up @@ -161,7 +163,16 @@ function OptionCard({
<Bold>Funding request:</Bold> {option.fundingRequest}
</Body>
)}
{option.optionSubTitle && <Body>{option.optionSubTitle}</Body>}
{option.optionSubTitle && (
<Markdown
components={{
a: ({ node, ...props }) => <Link to={props.href ?? ''}>{props.children}</Link>,
p: ({ node, ...props }) => <Body>{props.children}</Body>,
}}
>
{option.optionSubTitle}
</Markdown>
)}
<IconButton
$padding={0}
$color="secondary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { Bold } from '../../typography/Bold.styled';
// Styled Components
import { useNavigate } from 'react-router-dom';
import { Card, Funding, Icon, Plurality, TitleContainer } from './ResultsTable.styled';
import Markdown from 'react-markdown';
import Link from '../../link';

type ResultsTableProps = {
$expanded: boolean;
Expand Down Expand Up @@ -159,7 +161,16 @@ function ResultsTable({ $expanded, option, onClick, cycleId, eventId }: ResultsT
/>
</Funding>
<FlexColumn className="description">
<Body>{option.optionSubTitle}</Body>
{option.optionSubTitle && (
<Markdown
components={{
a: ({ node, ...props }) => <Link to={props.href ?? ''}>{props.children}</Link>,
p: ({ node, ...props }) => <Body>{props.children}</Body>,
}}
>
{option.optionSubTitle}
</Markdown>
)}
<Body>
<Bold>Research Output:</Bold> {researchOutputValue}
</Body>
Expand Down
Loading