-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathindex.tsx
65 lines (59 loc) · 1.57 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import React from 'react'
import { createTheme, Theme, ThemeProvider } from '@mui/material/styles'
import MUIRichTextEditor from '../../'
import { TMUIRichTextEditorStyles } from '../../'
export const defaultTheme: Theme = createTheme({
palette: {
primary: {
main: "#000000"
}
}
})
const muiRteTheme: TMUIRichTextEditorStyles = {
overrides: {
MUIRichTextEditor: {
root: {
backgroundColor: "#ebebeb",
},
container: {
display: "flex",
flexDirection: "column-reverse"
},
editor: {
backgroundColor: "#ebebeb",
padding: "20px",
height: "200px",
maxHeight: "200px",
overflow: "auto"
},
toolbar: {
borderTop: "1px solid gray",
backgroundColor: "#ebebeb"
},
placeHolder: {
backgroundColor: "#ebebeb",
paddingLeft: 20,
width: "inherit",
},
anchorLink: {
color: "#333333",
textDecoration: "underline"
}
}
}
}
Object.assign(defaultTheme, muiRteTheme)
const save = (data: string) => {
console.log(data)
}
const Themed = () => {
return (
<ThemeProvider theme={defaultTheme}>
<MUIRichTextEditor
label="Type something here..."
onSave={save}
/>
</ThemeProvider>
)
}
export default Themed