[WEB-4597] fix: project icon render in switcher #7504
This commit is contained in:
parent
a67dba45f8
commit
876ccce86b
2 changed files with 15 additions and 5 deletions
|
|
@ -37,7 +37,9 @@ export const ProjectBreadcrumb = observer((props: TProjectBreadcrumbProps) => {
|
|||
return {
|
||||
value: projectId,
|
||||
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[];
|
||||
|
|
|
|||
|
|
@ -8,11 +8,18 @@ type TSwitcherIconProps = {
|
|||
logo_url?: string;
|
||||
LabelIcon: FC<ISvgIcons>;
|
||||
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) {
|
||||
return <Logo logo={logo_props} size={size} type="lucide" />;
|
||||
return <Logo logo={logo_props} size={size} type={type} />;
|
||||
}
|
||||
|
||||
if (logo_url) {
|
||||
|
|
@ -33,13 +40,14 @@ type TSwitcherLabelProps = {
|
|||
logo_url?: string;
|
||||
name?: string;
|
||||
LabelIcon: FC<ISvgIcons>;
|
||||
type?: "lucide" | "material";
|
||||
};
|
||||
|
||||
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 (
|
||||
<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)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue