File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/components/Ui/Infobox Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import cx from 'clsx';
33import { Icon } from '@ui5/webcomponents-react' ;
44
55import styles from './Infobox.module.css' ;
6+ import { useTheme } from '../../../hooks/useTheme' ;
67
78interface LabelProps {
89 id ?: string ;
@@ -23,13 +24,14 @@ const variantIcons = {
2324
2425export const Infobox : React . FC < LabelProps > = ( {
2526 id,
26- size = 'md' , // Default to medium size
27- variant = 'normal' , // Default to normal variant
27+ size = 'md' ,
28+ variant = 'normal' ,
2829 children,
2930 fullWidth = false ,
3031 className,
3132 icon,
3233} ) => {
34+ const { isDarkTheme } = useTheme ( ) ;
3335 const infoboxClasses = cx (
3436 styles . infobox ,
3537 {
@@ -41,6 +43,7 @@ export const Infobox: React.FC<LabelProps> = ({
4143 [ styles [ 'variant-warning' ] ] : variant === 'warning' ,
4244 [ styles [ 'variant-danger' ] ] : variant === 'danger' ,
4345 [ styles [ 'full-width' ] ] : fullWidth ,
46+ [ styles [ 'dark-mode' ] ] : isDarkTheme ,
4447 } ,
4548 className ,
4649 ) ;
You can’t perform that action at this time.
0 commit comments