snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
32
react/features/base/icons/components/withBranding.tsx
Normal file
32
react/features/base/icons/components/withBranding.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import React from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
|
||||
import { IReduxState } from '../../../app/types';
|
||||
|
||||
import SvgXmlIcon from './SvgXmlIcon';
|
||||
|
||||
/**
|
||||
* Icon wrapper that checks for branding before returning the SVG component.
|
||||
*
|
||||
* @returns {JSX.Element}
|
||||
*/
|
||||
const withBranding = ({ DefaultIcon, iconName }: {
|
||||
DefaultIcon: any;
|
||||
iconName: string;
|
||||
}) => (props: any) => {
|
||||
const src = useSelector((state: IReduxState) =>
|
||||
state['features/dynamic-branding']?.brandedIcons?.[iconName]
|
||||
);
|
||||
|
||||
if (src) {
|
||||
return (
|
||||
<SvgXmlIcon
|
||||
src = { src }
|
||||
{ ...props } />
|
||||
);
|
||||
}
|
||||
|
||||
return <DefaultIcon { ...props } />;
|
||||
};
|
||||
|
||||
export default withBranding;
|
||||
Reference in New Issue
Block a user