fix set html

deksrispi:
- fix di bagian tampilan forum diisi bg
This commit is contained in:
2025-04-30 17:35:31 +08:00
parent 42c19b0303
commit fd978d4b69
8 changed files with 122 additions and 66 deletions

View File

@@ -1,21 +1,53 @@
export function Comp_V3_SetHtmlWithSticker({
import { MainColor } from "../../color";
export function Comp_V3_SetInnerHTML({
props,
className,
color,
style,
}: {
props: string;
props: string | undefined;
className?: string;
color?: string;
style?: React.CSSProperties;
}) {
const baseStyle: React.CSSProperties = {
color: color ?? MainColor.white,
};
return (
<>
<div
className={className}
style={{ ...style, color: color ? color : "white" }}
dangerouslySetInnerHTML={{ __html: props }}
// className={className}
style={{ ...baseStyle, ...style }}
dangerouslySetInnerHTML={{ __html: props ?? "" }}
/>
<style>
{`
div p {
margin: 0 0 8px 0;
}
div ul, div ol {
margin: 0 0 8px 20px;
padding-left: 16px;
}
div h1, div h2, div h3 {
margin: 0 0 12px 0;
}
div li {
margin-bottom: 4px;
}
img {
max-width: 70px !important;
max-height: 70px !important;
}
`}
</style>
</>
);
}

View File

@@ -11,8 +11,8 @@ export const Comp_DangerouslySetInnerHTML = ({
}) => {
const baseStyle: React.CSSProperties = {
color: color ?? MainColor.white,
wordBreak: "break-word",
overflow: "hidden",
// wordBreak: "break-word",
// overflow: "hidden",
};
return (
@@ -22,7 +22,6 @@ export const Comp_DangerouslySetInnerHTML = ({
...baseStyle,
...styleInput,
}}
className="rich-html-content"
dangerouslySetInnerHTML={{
__html: props ?? "",
}}