Skip to content

Commit 2e07185

Browse files
committed
chore(dev-deps): bump react-md to v4.0.0
1 parent 41f053c commit 2e07185

File tree

7 files changed

+393
-480
lines changed

7 files changed

+393
-480
lines changed

components/ErrorHeader.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
FileSizeError,
66
isFileSizeError,
77
isTooManyFilesError,
8-
Text,
8+
Typography,
99
TooManyFilesError,
1010
} from "react-md";
1111

@@ -19,32 +19,32 @@ export function ErrorHeader({ error }: ErrorHeaderProps): ReactElement {
1919
const limit = filesize(error.limit);
2020
if (type === "total") {
2121
return (
22-
<Text type="subtitle-2" margin="none">
22+
<Typography type="subtitle-2" margin="none">
2323
{`Unable to upload the following files due to total upload size limit (${limit})`}
24-
</Text>
24+
</Typography>
2525
);
2626
}
2727

2828
const range = type === "min" ? "greater" : "less";
2929
return (
30-
<Text type="subtitle-2" margin="none">
30+
<Typography type="subtitle-2" margin="none">
3131
{`Unable to upload the following files because files must be ${range} than ${limit}`}
32-
</Text>
32+
</Typography>
3333
);
3434
}
3535
if (isTooManyFilesError(error)) {
3636
const { limit } = error;
3737
return (
38-
<Text type="subtitle-2" margin="none">
38+
<Typography type="subtitle-2" margin="none">
3939
{`Unable to upload the following files due to total files allowed limit (${limit})`}
40-
</Text>
40+
</Typography>
4141
);
4242
}
4343

4444
const { extensions } = error;
4545
return (
46-
<Text type="subtitle-2" margin="none">
46+
<Typography type="subtitle-2" margin="none">
4747
{`Invalid file extension. Must be one of ${extensions.join(", ")}`}
48-
</Text>
48+
</Typography>
4949
);
5050
}

components/ErrorRenderer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
isFileSizeError,
66
List,
77
SimpleListItem,
8-
Text,
8+
Typography,
99
} from "react-md";
1010

1111
import { ErrorHeader } from "./ErrorHeader";
@@ -36,8 +36,8 @@ export function ErrorRenderer({ error }: ErrorRendererProps): ReactElement {
3636
// error
3737
/* ^ is a {@link FileAccessError} */
3838
return (
39-
<Text margin="none">
39+
<Typography margin="none">
4040
File access is restricted. Try a different file or folder.
41-
</Text>
41+
</Typography>
4242
);
4343
}

components/FileDropzone.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import cn from "classnames";
22
import { ReactElement, useEffect, useState } from "react";
3-
import { FileUploadSVGIcon, Text, TextContainer, useDropzone } from "react-md";
3+
import {
4+
FileUploadSVGIcon,
5+
Typography,
6+
TextContainer,
7+
useDropzone,
8+
} from "react-md";
49

510
import styles from "./FileDropzone.module.scss";
611
import { useUpload } from "./useUpload";
@@ -41,10 +46,10 @@ export function FileDropzone(): ReactElement | null {
4146
onMouseLeave={() => setEnabled(false)}
4247
>
4348
<TextContainer>
44-
<Text type="headline-5">
49+
<Typography type="headline-5">
4550
Drag and drop a text file to update the markdown text with the file
4651
contents.
47-
</Text>
52+
</Typography>
4853
<FileUploadSVGIcon />
4954
</TextContainer>
5055
</div>

components/HelpDialog.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
DialogHeader,
1010
DialogTitle,
1111
Link,
12-
Text,
12+
Typography,
1313
TextContainer,
1414
} from "react-md";
1515

@@ -72,32 +72,32 @@ export function HelpDialog({
7272
</DialogHeader>
7373
<TextContainer clone>
7474
<DialogContent>
75-
<Text type="headline-6" margin="none">
75+
<Typography type="headline-6" margin="none">
7676
About
77-
</Text>
78-
<Text>
77+
</Typography>
78+
<Typography>
7979
This playground allows you to preview markdown with either the
8080
default renderer behavior or custom renderers using{" "}
8181
<Link href="https://react-md.dev">react-md</Link> for custom
8282
styling. Markdown can be manually typed into the editor or text
8383
files can be uploaded via drag-and drop.
84-
</Text>
85-
<Text>
84+
</Typography>
85+
<Typography>
8686
The website can be viewed in split-view mode (default) or in a
8787
tabbed view which can be useful if there isn&apos;t enough screen
8888
space. The split-view mode also allows for resizing the panes by
8989
grabbing the divider in the middle of the page.
90-
</Text>
91-
<Text type="headline-6" margin="top">
90+
</Typography>
91+
<Typography type="headline-6" margin="top">
9292
Useful links:
93-
</Text>
93+
</Typography>
9494
<ul>
9595
{links.map(({ name, href }) => (
96-
<Text key={href} component="li" type="subtitle-1">
96+
<Typography key={href} component="li" type="subtitle-1">
9797
<Link href={href} target="_blank">
9898
{name}
9999
</Link>
100-
</Text>
100+
</Typography>
101101
))}
102102
</ul>
103103
</DialogContent>

components/renderers.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
TableContainer,
1212
TableHeader,
1313
TableRow,
14-
Text,
14+
Typography,
1515
} from "react-md";
1616

1717
import {
@@ -43,7 +43,7 @@ export const renderers: MarkdownRenderers = {
4343
},
4444

4545
paragraph: function Paragraph({ children }) {
46-
return <Text>{children}</Text>;
46+
return <Typography>{children}</Typography>;
4747
},
4848

4949
heading: function Heading({ depth, tokens, children }) {
@@ -80,9 +80,9 @@ export const renderers: MarkdownRenderers = {
8080

8181
const id = useSluggedId(tokens);
8282
return (
83-
<Text id={id} type={type}>
83+
<Typography id={id} type={type}>
8484
{children}
85-
</Text>
85+
</Typography>
8686
);
8787
},
8888

@@ -130,7 +130,7 @@ ${PRISM_LANGUAGES.map((lang) => `- ${lang}`).join("\n")}
130130
},
131131

132132
listitem: function ListItem({ children }) {
133-
return <Text component="li">{children}</Text>;
133+
return <Typography component="li">{children}</Typography>;
134134
},
135135

136136
blockquote: function Blockquote({ children }) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"prismjs": "^1.25.0",
6868
"react": "^17.0.2",
6969
"react-dom": "^17.0.2",
70-
"react-md": "^3.1.1",
70+
"react-md": "^4.0.0",
7171
"rimraf": "^3.0.2",
7272
"rollup": "^2.60.1",
7373
"rollup-plugin-terser": "^7.0.2",

0 commit comments

Comments
 (0)