Repository navigation
[WEB-5614] chore: update component styles and class names for consistency across… #8376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ import { useOutsideClickDetector } from "@plane/hooks"; | |
| import { useTranslation } from "@plane/i18n"; | ||
| import { Logo } from "@plane/propel/emoji-icon-picker"; | ||
| import { ArchiveIcon, ChevronRightIcon } from "@plane/propel/icons"; | ||
| import { IconButton } from "@plane/propel/icon-button"; | ||
| import { Tooltip } from "@plane/propel/tooltip"; | ||
| import { CustomMenu, DropIndicator, DragHandle, ControlLink } from "@plane/ui"; | ||
| import { cn } from "@plane/utils"; | ||
|
|
@@ -80,7 +81,7 @@ export const SidebarProjectsListItem = observer(function SidebarProjectsListItem | |
| const isProjectListOpen = getIsProjectListOpen(projectId); | ||
| const [instruction, setInstruction] = useState<"DRAG_OVER" | "DRAG_BELOW" | undefined>(undefined); | ||
| // refs | ||
| const actionSectionRef = useRef<HTMLDivElement | null>(null); | ||
| const actionSectionRef = useRef<HTMLButtonElement | null>(null); | ||
| const projectRef = useRef<HTMLDivElement | null>(null); | ||
| const dragHandleRef = useRef<HTMLButtonElement | null>(null); | ||
| // router | ||
|
|
@@ -341,31 +342,33 @@ export const SidebarProjectsListItem = observer(function SidebarProjectsListItem | |
| </div> | ||
| )} | ||
| </ControlLink> | ||
| <CustomMenu | ||
| customButton={ | ||
| <span | ||
| ref={actionSectionRef} | ||
| className="grid place-items-center p-0.5 text-placeholder hover:bg-layer-1 rounded-sm" | ||
| onClick={() => setIsMenuActive(!isMenuActive)} | ||
| > | ||
| <MoreHorizontal className="size-4" /> | ||
| </span> | ||
| } | ||
| className={cn( | ||
| "opacity-0 pointer-events-none flex-shrink-0 group-hover/project-item:opacity-100 group-hover/project-item:pointer-events-auto", | ||
| { | ||
| "opacity-100 pointer-events-auto": isMenuActive, | ||
| <div className="flex items-center gap-1"> | ||
| <CustomMenu | ||
| customButton={ | ||
| <IconButton | ||
| ref={actionSectionRef} | ||
| variant="ghost" | ||
| size="sm" | ||
| icon={MoreHorizontal} | ||
| onClick={() => setIsMenuActive(!isMenuActive)} | ||
| className="text-placeholder" | ||
| /> | ||
| } | ||
| )} | ||
| customButtonClassName="grid place-items-center" | ||
| placement="bottom-start" | ||
| ariaLabel={t("aria_labels.projects_sidebar.toggle_quick_actions_menu")} | ||
| useCaptureForOutsideClick | ||
| closeOnSelect | ||
| onMenuClose={() => setIsMenuActive(false)} | ||
| > | ||
| {/* TODO: Removed is_favorite logic due to the optimization in projects API */} | ||
| {/* {isAuthorized && ( | ||
| className={cn( | ||
| "opacity-0 pointer-events-none flex-shrink-0 group-hover/project-item:opacity-100 group-hover/project-item:pointer-events-auto", | ||
| { | ||
| "opacity-100 pointer-events-auto": isMenuActive, | ||
| } | ||
| )} | ||
| customButtonClassName="grid place-items-center" | ||
| placement="bottom-start" | ||
| ariaLabel={t("aria_labels.projects_sidebar.toggle_quick_actions_menu")} | ||
| useCaptureForOutsideClick | ||
| closeOnSelect | ||
| onMenuClose={() => setIsMenuActive(false)} | ||
| > | ||
| {/* TODO: Removed is_favorite logic due to the optimization in projects API */} | ||
| {/* {isAuthorized && ( | ||
| <CustomMenu.MenuItem | ||
| onClick={project.is_favorite ? handleRemoveFromFavorites : handleAddToFavorites} | ||
| > | ||
|
|
@@ -380,79 +383,76 @@ export const SidebarProjectsListItem = observer(function SidebarProjectsListItem | |
| </CustomMenu.MenuItem> | ||
| )} */} | ||
|
|
||
| {/* publish project settings */} | ||
| {isAdmin && ( | ||
| <CustomMenu.MenuItem onClick={() => setPublishModal(true)}> | ||
| <div className="relative flex flex-shrink-0 items-center justify-start gap-2"> | ||
| <div className="flex h-4 w-4 cursor-pointer items-center justify-center rounded-sm text-secondary transition-all duration-300 hover:bg-layer-1"> | ||
| <Share2 className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| {/* publish project settings */} | ||
| {isAdmin && ( | ||
| <CustomMenu.MenuItem onClick={() => setPublishModal(true)}> | ||
| <div className="relative flex flex-shrink-0 items-center justify-start gap-2"> | ||
| <div className="flex h-4 w-4 cursor-pointer items-center justify-center rounded-sm text-secondary transition-all duration-300 hover:bg-layer-1"> | ||
| <Share2 className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| </div> | ||
| <div>{t("publish_project")}</div> | ||
| </div> | ||
| <div>{t("publish_project")}</div> | ||
| </div> | ||
| </CustomMenu.MenuItem> | ||
| )} | ||
| <CustomMenu.MenuItem onClick={handleCopyText}> | ||
| <span className="flex items-center justify-start gap-2"> | ||
| <LinkIcon className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("copy_link")}</span> | ||
| </span> | ||
| </CustomMenu.MenuItem> | ||
| )} | ||
| <CustomMenu.MenuItem onClick={handleCopyText}> | ||
| <span className="flex items-center justify-start gap-2"> | ||
| <LinkIcon className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("copy_link")}</span> | ||
| </span> | ||
| </CustomMenu.MenuItem> | ||
| {isAuthorized && ( | ||
| {isAuthorized && ( | ||
| <CustomMenu.MenuItem | ||
| onClick={() => { | ||
| router.push(`/${workspaceSlug}/projects/${project?.id}/archives/issues`); | ||
| }} | ||
| > | ||
| <div className="flex items-center justify-start gap-2 cursor-pointer"> | ||
| <ArchiveIcon className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("archives")}</span> | ||
| </div> | ||
| </CustomMenu.MenuItem> | ||
| )} | ||
| <CustomMenu.MenuItem | ||
| onClick={() => { | ||
| router.push(`/${workspaceSlug}/projects/${project?.id}/archives/issues`); | ||
| router.push(`/${workspaceSlug}/settings/projects/${project?.id}`); | ||
| }} | ||
| > | ||
| <div className="flex items-center justify-start gap-2 cursor-pointer"> | ||
| <ArchiveIcon className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("archives")}</span> | ||
| <Settings className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("settings")}</span> | ||
| </div> | ||
| </CustomMenu.MenuItem> | ||
| )} | ||
| <CustomMenu.MenuItem | ||
| onClick={() => { | ||
| router.push(`/${workspaceSlug}/settings/projects/${project?.id}`); | ||
| }} | ||
| > | ||
| <div className="flex items-center justify-start gap-2 cursor-pointer"> | ||
| <Settings className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("settings")}</span> | ||
| </div> | ||
| </CustomMenu.MenuItem> | ||
| {/* leave project */} | ||
| {!isAuthorized && ( | ||
| <CustomMenu.MenuItem | ||
| onClick={handleLeaveProject} | ||
| data-ph-element={MEMBER_TRACKER_ELEMENTS.SIDEBAR_PROJECT_QUICK_ACTIONS} | ||
| > | ||
| <div className="flex items-center justify-start gap-2"> | ||
| <LogOut className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("leave_project")}</span> | ||
| </div> | ||
| </CustomMenu.MenuItem> | ||
| )} | ||
| </CustomMenu> | ||
| {isAccordionMode && ( | ||
| <Disclosure.Button | ||
| as="button" | ||
| type="button" | ||
| className={cn("hidden group-hover/project-item:inline-block p-0.5 rounded-sm hover:bg-layer-1", { | ||
| "inline-block": isMenuActive, | ||
| })} | ||
| onClick={() => setIsProjectListOpen(!isProjectListOpen)} | ||
| aria-label={t( | ||
| isProjectListOpen | ||
| ? "aria_labels.projects_sidebar.close_project_menu" | ||
| : "aria_labels.projects_sidebar.open_project_menu" | ||
| {/* leave project */} | ||
| {!isAuthorized && ( | ||
| <CustomMenu.MenuItem | ||
| onClick={handleLeaveProject} | ||
| data-ph-element={MEMBER_TRACKER_ELEMENTS.SIDEBAR_PROJECT_QUICK_ACTIONS} | ||
| > | ||
| <div className="flex items-center justify-start gap-2"> | ||
| <LogOut className="h-3.5 w-3.5 stroke-[1.5]" /> | ||
| <span>{t("leave_project")}</span> | ||
| </div> | ||
| </CustomMenu.MenuItem> | ||
| )} | ||
|
Comment on lines
+426
to
436
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: cd /tmp && find . -name "projects-list-item.tsx" 2>/dev/null | head -5Repository: makeplane/plane Length of output: 41 🏁 Script executed: git ls-files | grep "projects-list-item.tsx"Repository: makeplane/plane Length of output: 124 🏁 Script executed: fd "projects-list-item.tsx" --type fRepository: makeplane/plane Length of output: 124 🏁 Script executed: rg -n "isAuthorized|handleLeaveProject" --type ts --type tsx -B5 -A5 -iRepository: makeplane/plane Length of output: 86 🏁 Script executed: rg -n "MEMBER_ROLE\|MEMBER_TRACKER" --type ts --type tsxRepository: makeplane/plane Length of output: 86 🏁 Script executed: rg "handleLeaveProject" --type ts --type tsx -B10 -A10Repository: makeplane/plane Length of output: 86 🏁 Script executed: cat apps/web/core/components/workspace/sidebar/projects-list-item.tsx | head -100Repository: makeplane/plane Length of output: 4761 🏁 Script executed: cat apps/web/core/components/workspace/sidebar/projects-list-item.tsx | sed -n '400,450p'Repository: makeplane/plane Length of output: 2520 🏁 Script executed: rg "handleLeaveProject" -A15 -B5Repository: makeplane/plane Length of output: 13456 🏁 Script executed: rg "isAuthorized" -B10 -A5 apps/web/core/components/workspace/sidebar/projects-list-item.tsxRepository: makeplane/plane Length of output: 2894 🏁 Script executed: rg "EUserPermissions\." --type js --type ts -A2 -B2 | head -50Repository: makeplane/plane Length of output: 3742 🏁 Script executed: grep -r "leave.*project\|MEMBER\|GUEST" apps/web/core/components/project/ --include="*.tsx" --include="*.ts" | grep -i "leave\|permission" | head -20Repository: makeplane/plane Length of output: 2580 🏁 Script executed: cat apps/web/core/components/project/member-list-item.tsx | grep -A20 "leaveProject\|can't leave"Repository: makeplane/plane Length of output: 1188 🏁 Script executed: rg "You can't leave" -B10 -A10Repository: makeplane/plane Length of output: 41 🏁 Script executed: cat apps/web/core/components/project/leave-project-modal.tsx | head -80Repository: makeplane/plane Length of output: 2403 🏁 Script executed: rg "project.*leave\|leave.*project" apps/web/core/components/project/ --type ts --type tsx -B3 -A3 | grep -i "guest\|member\|admin\|authorize" | head -30Repository: makeplane/plane Length of output: 86 🏁 Script executed: cat apps/web/core/components/navigation/tab-navigation-root.tsx | grep -A30 "isAuthorized"Repository: makeplane/plane Length of output: 2131 🏁 Script executed: rg "onLeaveProject\|isAuthorized.*leave" apps/web/core/components/navigation/ -A5 -B5Repository: makeplane/plane Length of output: 41 🏁 Script executed: cat apps/web/core/components/navigation/project-actions-menu.tsx | head -120Repository: makeplane/plane Length of output: 3741 🏁 Script executed: rg "leave.*project" apps/web/core/components/project/card.tsx -B5 -A5Repository: makeplane/plane Length of output: 41 🏁 Script executed: grep -n "!isAuthorized\|isAuthorized" apps/web/core/components/project/card.tsxRepository: makeplane/plane Length of output: 41 🏁 Script executed: rg "leave_project\|LeaveProject" apps/web/core/components/ --type js --type ts -B3 -A3 | head -80Repository: makeplane/plane Length of output: 41 🏁 Script executed: rg "leave.*guest\|guest.*leave\|member.*leave" -i --type ts --type js | head -20Repository: makeplane/plane Length of output: 41 🏁 Script executed: cat apps/web/core/components/project/leave-project-modal.tsx | tail -60Repository: makeplane/plane Length of output: 2446 Leave project option should be available to members in sidebar menu. Currently, the condition 🤖 Prompt for AI Agents |
||
| > | ||
| <ChevronRightIcon | ||
| className={cn("size-4 flex-shrink-0 text-placeholder transition-transform", { | ||
| </CustomMenu> | ||
| {isAccordionMode && ( | ||
| <IconButton | ||
| variant="ghost" | ||
| size="sm" | ||
| icon={ChevronRightIcon} | ||
| onClick={() => setIsProjectListOpen(!isProjectListOpen)} | ||
| className={cn("hidden group-hover/project-item:inline-flex text-placeholder transition-transform", { | ||
| "inline-flex": isMenuActive, | ||
| "rotate-90": isProjectListOpen, | ||
| })} | ||
| aria-label={t( | ||
| isProjectListOpen | ||
| ? "aria_labels.projects_sidebar.close_project_menu" | ||
| : "aria_labels.projects_sidebar.open_project_menu" | ||
| )} | ||
| /> | ||
| </Disclosure.Button> | ||
| )} | ||
| )} | ||
| </div> | ||
| </> | ||
| </div> | ||
| {isAccordionMode && ( | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -7,15 +7,15 @@ export const buttonVariants = cva( | |||||
| variants: { | ||||||
| variant: { | ||||||
| primary: | ||||||
| "bg-accent-primary hover:bg-accent-primary-hover active:bg-accent-primary-active focus:bg-accent-primary-active disabled:bg-layer-disabled text-on-color disabled:text-disabled", | ||||||
| "bg-accent-primary hover:bg-accent-primary-hover active:bg-accent-primary-active disabled:bg-layer-disabled text-on-color disabled:text-disabled", | ||||||
| "error-fill": | ||||||
| "bg-danger-primary hover:bg-danger-primary-hover active:bg-danger-primary-active focus:bg-danger-primary-active disabled:bg-layer-disabled text-on-color disabled:text-disabled", | ||||||
| "bg-danger-primary hover:bg-danger-primary-hover active:bg-danger-primary-active disabled:bg-layer-disabled text-on-color disabled:text-disabled", | ||||||
| "error-outline": | ||||||
| "bg-layer-2 hover:bg-danger-subtle active:bg-danger-subtle-hover focus:bg-danger-subtle-hover disabled:bg-layer-2 text-danger disabled:text-disabled border border-danger-strong disabled:border-subtle-1", | ||||||
| "bg-layer-2 hover:bg-danger-subtle active:bg-danger-subtle-hover disabled:bg-layer-2 text-danger disabled:text-disabled border border-danger-strong disabled:border-subtle-1", | ||||||
| secondary: | ||||||
| "bg-layer-2 hover:bg-layer-2-hover active:bg-layer-2-active focus:bg-layer-2-active disabled:bg-layer-transparent text-secondary disabled:text-disabled border border-strong disabled:border-subtle-1 shadow-raised-100", | ||||||
| "bg-layer-2 hover:bg-layer-2-hover active:bg-layer-2-active disabled:bg-layer-transparent text-secondary disabled:text-disabled border border-strong disabled:border-subtle-1 shadow-raised-100", | ||||||
|
||||||
| "bg-layer-2 hover:bg-layer-2-hover active:bg-layer-2-active disabled:bg-layer-transparent text-secondary disabled:text-disabled border border-strong disabled:border-subtle-1 shadow-raised-100", | |
| "bg-layer-2 hover:bg-layer-2-hover active:bg-layer-2-active disabled:bg-layer-transparent text-secondary disabled:text-disabled border border-strong disabled:border-subtle-1 shadow-raised-100", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
cnimport from "@plane/utils" is no longer used after refactoring to use the Button component and should be removed.