@@ -2,7 +2,7 @@ import DOMPurify from 'dompurify'
2
2
import parse from 'html-react-parser'
3
3
import { forwardRef , useContext , useMemo } from 'react'
4
4
import { ImageList } from './image-list'
5
- import { baseTemplate , themeColorStyles } from './styles'
5
+ import { baseTemplate } from './styles'
6
6
import type { ContentWithId , ImageFile } from '@/types'
7
7
import { base64ToBlob , cn , createStyleClassMap , stripEmptyParagraphs } from '@/lib'
8
8
import { CustomThemeContext } from '@/contexts/custom-theme-context'
@@ -27,28 +27,22 @@ const Card = forwardRef<HTMLDivElement, PreviewItemProps>(({ content, children,
27
27
} , [ uploadFiles ] ) || [ ]
28
28
29
29
const templateClassNameMap = createStyleClassMap ( theme . template , 'template' , baseTemplate )
30
- const themeClassNameMap = createStyleClassMap ( themeColorStyles , 'theme' )
31
30
32
31
// template
33
32
const heroTemplate = templateClassNameMap . hero
34
33
const mainTemplate = templateClassNameMap . main
35
34
const subTemplate = templateClassNameMap . sub
36
35
37
- // theme color
38
- const heroTheme = themeClassNameMap . hero
39
- const mainTheme = themeClassNameMap . main
40
- const subTheme = themeClassNameMap . sub
41
-
42
36
return (
43
37
< div
44
38
id = { `${ content . id } ` }
45
39
className = { cn (
46
40
templateClassNameMap . common . container ,
47
41
content . parentId
48
- ? `${ subTemplate . container } ${ subTheme . container } `
42
+ ? `${ subTemplate . container } `
49
43
: content . type === 'theme_content'
50
- ? `${ heroTemplate . container } ${ heroTheme . container } `
51
- : `${ mainTemplate . container } ${ mainTheme . container } ` ,
44
+ ? `${ heroTemplate . container } `
45
+ : `${ mainTemplate . container } ` ,
52
46
) }
53
47
ref = { ref }
54
48
>
@@ -57,10 +51,10 @@ const Card = forwardRef<HTMLDivElement, PreviewItemProps>(({ content, children,
57
51
< div
58
52
className = {
59
53
cn ( content . parentId
60
- ? `${ subTemplate . title } ${ subTheme . title } `
54
+ ? `${ subTemplate . title } `
61
55
: content . type === 'theme_content'
62
- ? `${ heroTemplate . title } ${ heroTheme . title } `
63
- : `${ mainTemplate . title } ${ mainTheme . title } ` ,
56
+ ? `${ heroTemplate . title } `
57
+ : `${ mainTemplate . title } ` ,
64
58
)
65
59
}
66
60
data-index = { index }
@@ -75,10 +69,10 @@ const Card = forwardRef<HTMLDivElement, PreviewItemProps>(({ content, children,
75
69
className = {
76
70
cn ( templateClassNameMap . common . content ,
77
71
content . parentId
78
- ? `${ subTemplate . content } ${ subTheme . content } `
72
+ ? `${ subTemplate . content } `
79
73
: content . type === 'theme_content'
80
- ? `${ heroTemplate . content } ${ heroTheme . content } `
81
- : `${ mainTemplate . content } ${ mainTheme . content } ` ,
74
+ ? `${ heroTemplate . content } `
75
+ : `${ mainTemplate . content } ` ,
82
76
)
83
77
}
84
78
>
0 commit comments