-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sebastian Tilsch
committed
Apr 3, 2024
1 parent
1072f03
commit a99de82
Showing
6 changed files
with
324 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
apps/exhibition-live/components/form/show/EntityDetailCardProps.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { PrimaryFieldResults } from "../../utils/types"; | ||
import React from "react"; | ||
import { AllPropTableProps } from "../lobid/LobidAllPropTable"; | ||
|
||
type OwnProps = { | ||
typeIRI: string; | ||
entityIRI: string; | ||
cardInfo: PrimaryFieldResults<string>; | ||
cardActionChildren?: React.ReactNode; | ||
data: any; | ||
readonly?: boolean; | ||
inlineEditing?: boolean; | ||
onEditClicked?: () => void; | ||
tableProps?: Partial<AllPropTableProps>; | ||
}; | ||
|
||
export type EntityDetailCardProps = OwnProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/exhibition-live/components/form/show/MarkdownContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { useEffect } from "react"; | ||
import { useRemark } from "react-remark"; | ||
import { Container } from "@mui/material"; | ||
|
||
export type MarkdownContentProps = { | ||
mdDocument: string; | ||
}; | ||
const MarkdownContent = ({ mdDocument }: MarkdownContentProps) => { | ||
const [reactContent, setMarkdownSource] = useRemark(); | ||
|
||
useEffect(() => { | ||
setMarkdownSource(mdDocument); | ||
}, [mdDocument]); | ||
|
||
return <Container>{reactContent}</Container>; | ||
}; | ||
|
||
export default MarkdownContent; |
13 changes: 13 additions & 0 deletions
13
apps/exhibition-live/components/form/show/MarkdownContentNoSSR.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import dynamic from "next/dynamic"; | ||
|
||
const DynamicComponentWithNoSSR = dynamic(() => import("./MarkdownContent"), { | ||
ssr: false, | ||
}); | ||
|
||
export type MarkdownContentProps = { | ||
mdDocument: string; | ||
}; | ||
|
||
export default (props: MarkdownContentProps) => ( | ||
<DynamicComponentWithNoSSR {...props} /> | ||
); |
Oops, something went wrong.