fix tampilan html view

This commit is contained in:
2025-04-29 17:25:16 +08:00
parent 480fea026c
commit 0e7c491031
10 changed files with 96 additions and 30 deletions

View File

@@ -4,7 +4,7 @@ import React from "react";
/**
* ComponentGlobal_CardStyles
*
*
* A React component that renders a customizable card element.
*
* Props:
@@ -24,6 +24,7 @@ export function ComponentGlobal_CardStyles({
height,
color,
onClickHandler,
style,
}: {
children: React.ReactNode;
backgroundColor?: string;
@@ -32,11 +33,13 @@ export function ComponentGlobal_CardStyles({
height?: string | number;
color?: string;
onClickHandler?: React.MouseEventHandler<HTMLDivElement>;
style?: React.CSSProperties;
}) {
return (
<>
<Card
style={{
...style,
backgroundColor: backgroundColor
? backgroundColor
: AccentColor.darkblue,

View File

@@ -0,0 +1,4 @@
.sticker-content .chat-content img {
max-width: 70px;
max-height: 70px;
}

View File

@@ -1,18 +1,21 @@
export function Comp_V3_SetHtmlWithSticker({
props,
className,
color,
style,
}: {
props: string;
className: string;
className?: string;
color?: string;
style?: React.CSSProperties;
}) {
return (
<>
<div className={className} style={{
color: color ? color : "white"
}} dangerouslySetInnerHTML={{ __html: props }} />
<div
className={className}
style={{ ...style, color: color ? color : "white" }}
dangerouslySetInnerHTML={{ __html: props }}
/>
</>
);
}

View File

@@ -1,23 +1,30 @@
import { MainColor } from "../../color";
export const Comp_DangerouslySetInnerHTML= ({
export const Comp_DangerouslySetInnerHTML = ({
props,
color,
style,
}: {
props: string | undefined;
color?: string;
}) => {
style?: React.CSSProperties;
}) => {
const baseStyle: React.CSSProperties = {
color: color ?? MainColor.white,
};
return (
<>
<div
style={{
color: color ? color : MainColor.white,
...baseStyle,
...style,
// wordBreak: "break-word",
}}
// className="chat-content"
dangerouslySetInnerHTML={{
__html: props ?? "",
}}
/>
</>
);
}
};