mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
added basePath to markdown components in order to allow navigation between md files
This commit is contained in:
@@ -29,13 +29,14 @@ import styled from "styled-components";
|
||||
|
||||
type Props = {
|
||||
file: File;
|
||||
basePath: string;
|
||||
};
|
||||
|
||||
const MarkdownContent = styled.div`
|
||||
padding: 0.5rem;
|
||||
`;
|
||||
|
||||
const MarkdownViewer: FC<Props> = ({ file }) => {
|
||||
const MarkdownViewer: FC<Props> = ({ file, basePath }) => {
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<Error | undefined>(undefined);
|
||||
const [content, setContent] = useState("");
|
||||
@@ -62,7 +63,7 @@ const MarkdownViewer: FC<Props> = ({ file }) => {
|
||||
|
||||
return (
|
||||
<MarkdownContent>
|
||||
<MarkdownView content={content} />
|
||||
<MarkdownView content={content} basePath={basePath} />
|
||||
</MarkdownContent>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user