[WEB-4050] feat: breadcrumbs revamp (#7188)
* chore: project feature enum added * feat: revamp breadcrumb and add navigation dropdown component * chore: custom search select component refactoring * chore: breadcrumb stories added * chore: switch label and breadcrumb link component refactor * chore: project navigation helper function added * chore: common breadcrumb component added * chore: breadcrumb refactoring * chore: code refactor * chore: code refactor * fix: build error * fix: nprogress and button tooltip * chore: code refactor * chore: workspace view breadcrumb improvements * chore: code refactor * chore: code refactor * chore: code refactor * chore: code refactor --------- Co-authored-by: vamsikrishnamathala <matalav55@gmail.com>
This commit is contained in:
parent
64fd0b2830
commit
2b7a17b484
44 changed files with 1251 additions and 581 deletions
|
|
@ -2,6 +2,32 @@ import { FC } from "react";
|
|||
import { TLogoProps } from "@plane/types";
|
||||
import { ISvgIcons, Logo } from "@plane/ui";
|
||||
import { getFileURL, truncateText } from "@plane/utils";
|
||||
|
||||
type TSwitcherIconProps = {
|
||||
logo_props?: TLogoProps;
|
||||
logo_url?: string;
|
||||
LabelIcon: FC<ISvgIcons>;
|
||||
size?: number;
|
||||
};
|
||||
|
||||
export const SwitcherIcon: FC<TSwitcherIconProps> = ({ logo_props, logo_url, LabelIcon, size = 12 }) => {
|
||||
if (logo_props?.in_use) {
|
||||
return <Logo logo={logo_props} size={size} type="lucide" />;
|
||||
}
|
||||
|
||||
if (logo_url) {
|
||||
return (
|
||||
<img
|
||||
src={getFileURL(logo_url)}
|
||||
alt="logo"
|
||||
className="rounded-sm object-cover"
|
||||
style={{ height: size, width: size }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return <LabelIcon height={size} width={size} />;
|
||||
};
|
||||
|
||||
type TSwitcherLabelProps = {
|
||||
logo_props?: TLogoProps;
|
||||
logo_url?: string;
|
||||
|
|
@ -13,13 +39,7 @@ export const SwitcherLabel: FC<TSwitcherLabelProps> = (props) => {
|
|||
const { logo_props, name, LabelIcon, logo_url } = props;
|
||||
return (
|
||||
<div className="flex items-center gap-1 text-custom-text-200">
|
||||
{logo_props?.in_use ? (
|
||||
<Logo logo={logo_props} size={12} type="lucide" />
|
||||
) : logo_url ? (
|
||||
<img src={getFileURL(logo_url)} alt="logo" className="rounded-sm w-3 h-3 object-cover" />
|
||||
) : (
|
||||
<LabelIcon height={12} width={12} />
|
||||
)}
|
||||
<SwitcherIcon logo_props={logo_props} logo_url={logo_url} LabelIcon={LabelIcon} />
|
||||
{truncateText(name ?? "", 40)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue