Add more vertical margin to Markdown rendering and change embed to image tag

This commit is contained in:
Mitchell McCaffrey 2021-06-11 17:30:10 +10:00
parent 44aa4d694a
commit 0bf911675c
15 changed files with 20 additions and 22 deletions

View File

@ -9,7 +9,7 @@ import {
import ReactMarkdown from "react-markdown";
function Paragraph(props) {
return <Text variant="body2" {...props} />;
return <Text as="p" my={2} variant="body2" {...props} />;
}
function Heading({ level, ...props }) {
@ -27,6 +27,9 @@ function Heading({ level, ...props }) {
}
function Image(props) {
if (props.alt === "embed:") {
return <Embed as="span" sx={{ display: "block" }} src={props.src} my={2} />;
}
if (props.src.endsWith(".mp4")) {
return (
<video
@ -125,12 +128,7 @@ function TableCell({ children }) {
}
function Link({ href, children }) {
const linkText = children[0].props.value;
if (linkText === "embed:") {
return <Embed src={href} my={2} />;
} else {
return <UILink href={href}>{children}</UILink>;
}
return <UILink href={href}>{children}</UILink>;
}
function Markdown({ source, assets }) {
@ -151,7 +149,7 @@ function Markdown({ source, assets }) {
<ReactMarkdown
source={source}
renderers={renderers}
transformImageUri={(uri) => assets[uri]}
transformImageUri={(uri) => assets[uri] || uri}
/>
);
}

View File

@ -1 +1 @@
[embed:](https://www.youtube.com/embed/KLUsOZA-SHI)
![embed:](https://www.youtube.com/embed/KLUsOZA-SHI)

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/ztLDznOpmsg)
![embed:](https://www.youtube.com/embed/ztLDznOpmsg)
Once you have started a game you can share a map to all other party members by clicking the Select Map button then selecting the desired map to share and clicking the Done button.

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/Er_grVmqpk0)
![embed:](https://www.youtube.com/embed/Er_grVmqpk0)
Owlbear Rodeo supports a physically simulated 3D dice tray and dice. To access these features click the Show Dice Tray icon in the top left of the map view.

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/2e07DtB-Xrc)
![embed:](https://www.youtube.com/embed/2e07DtB-Xrc)
The Drawing Tool allows you to draw on top of a map. To access the Drawing Tool click the Drawing Tool button in the top right of the map view.

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/1ra7DoIsas8)
![embed:](https://www.youtube.com/embed/1ra7DoIsas8)
The Fog Tool allows you to add hidden areas to control what the other party members can see on your map. To access the Fog Tool click the Fog Tool button in the top right of the map view.

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/j-9X9CF7_UY)
![embed:](https://www.youtube.com/embed/j-9X9CF7_UY)
Once you have a map shared between a party all players can drag tokens from the Token List on the right hand side of the screen. Tokens can then be used to represent players, monsters or any other object that needs to be moved around the map.

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/aOTvQOrpNo4)
![embed:](https://www.youtube.com/embed/aOTvQOrpNo4)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/IhSS24d4zlM)
![embed:](https://www.youtube.com/embed/IhSS24d4zlM)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/Y7sEgoopz4E)
![embed:](https://www.youtube.com/embed/Y7sEgoopz4E)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/vtNpj-449B8)
![embed:](https://www.youtube.com/embed/vtNpj-449B8)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/i4JvZboAPhQ)
![embed:](https://www.youtube.com/embed/i4JvZboAPhQ)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/TIhCAJoTeAU)
![embed:](https://www.youtube.com/embed/TIhCAJoTeAU)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/MWbfbN3Brhw)
![embed:](https://www.youtube.com/embed/MWbfbN3Brhw)
## Major Changes

View File

@ -1,4 +1,4 @@
[embed:](https://www.youtube.com/embed/MBy0VLsesL0)
![embed:](https://www.youtube.com/embed/MBy0VLsesL0)
## Major Changes