[WEB-4597] fix: project icon render in switcher #7504

This commit is contained in:
Vamsi Krishna 2025-07-30 17:18:18 +05:30 committed by GitHub
parent a67dba45f8
commit 876ccce86b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 5 deletions

View file

@ -37,7 +37,9 @@ export const ProjectBreadcrumb = observer((props: TProjectBreadcrumbProps) => {
return { return {
value: projectId, value: projectId,
query: project?.name, query: project?.name,
content: <SwitcherLabel name={project?.name} logo_props={project?.logo_props} LabelIcon={Briefcase} />, content: (
<SwitcherLabel name={project?.name} logo_props={project?.logo_props} LabelIcon={Briefcase} type="material" />
),
}; };
}) })
.filter((option) => option !== undefined) as ICustomSearchSelectOption[]; .filter((option) => option !== undefined) as ICustomSearchSelectOption[];

View file

@ -8,11 +8,18 @@ type TSwitcherIconProps = {
logo_url?: string; logo_url?: string;
LabelIcon: FC<ISvgIcons>; LabelIcon: FC<ISvgIcons>;
size?: number; size?: number;
type?: "lucide" | "material";
}; };
export const SwitcherIcon: FC<TSwitcherIconProps> = ({ logo_props, logo_url, LabelIcon, size = 12 }) => { export const SwitcherIcon: FC<TSwitcherIconProps> = ({
logo_props,
logo_url,
LabelIcon,
size = 12,
type = "lucide",
}) => {
if (logo_props?.in_use) { if (logo_props?.in_use) {
return <Logo logo={logo_props} size={size} type="lucide" />; return <Logo logo={logo_props} size={size} type={type} />;
} }
if (logo_url) { if (logo_url) {
@ -33,13 +40,14 @@ type TSwitcherLabelProps = {
logo_url?: string; logo_url?: string;
name?: string; name?: string;
LabelIcon: FC<ISvgIcons>; LabelIcon: FC<ISvgIcons>;
type?: "lucide" | "material";
}; };
export const SwitcherLabel: FC<TSwitcherLabelProps> = (props) => { export const SwitcherLabel: FC<TSwitcherLabelProps> = (props) => {
const { logo_props, name, LabelIcon, logo_url } = props; const { logo_props, name, LabelIcon, logo_url, type = "lucide" } = props;
return ( return (
<div className="flex items-center gap-1 text-custom-text-200"> <div className="flex items-center gap-1 text-custom-text-200">
<SwitcherIcon logo_props={logo_props} logo_url={logo_url} LabelIcon={LabelIcon} /> <SwitcherIcon logo_props={logo_props} logo_url={logo_url} LabelIcon={LabelIcon} type={type} />
{truncateText(name ?? "", 40)} {truncateText(name ?? "", 40)}
</div> </div>
); );