Skip to content

Commit

Permalink
📝 Add some documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasGilg committed Mar 21, 2024
1 parent 9424188 commit 4f751a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/components/shared/MUILocalization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import {LocalizationProvider} from '@mui/x-date-pickers/LocalizationProvider';
import {AdapterDayjs} from '@mui/x-date-pickers/AdapterDayjs';
import React from 'react';

/**
* A utility component to provide localization support for certain MUI elements, like date pickers.
*/
export function MUILocalization(props: {children: string | JSX.Element | JSX.Element[]}): JSX.Element {
const {i18n} = useTranslation();

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/shared/MathMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import ReactMarkdown from 'react-markdown';
import rehypeKatex from 'rehype-katex';
import remarkMath from 'remark-math';

/**
* Renders the given content in a markdown environment that supports mathematical equations.
*/
export default function MathMarkdown(props: Readonly<{children: string}>): JSX.Element {
return (
<ReactMarkdown remarkPlugins={[remarkMath]} rehypePlugins={[rehypeKatex]}>
Expand Down

0 comments on commit 4f751a9

Please sign in to comment.