Skip to content

Commit

Permalink
chore: code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia committed Sep 9, 2024
1 parent 8e4f18a commit 305ddd1
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions web/core/components/issues/issue-detail/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { EUserProjectRoles } from "@/constants/project";
// hooks
import { useAppTheme, useEventTracker, useIssueDetail, useIssues, useUser } from "@/hooks/store";
import { useAppRouter } from "@/hooks/use-app-router";
import { usePlatformOS } from "@/hooks/use-platform-os";
// images
import emptyIssue from "@/public/empty-state/issue.svg";
// local components
Expand Down Expand Up @@ -81,6 +82,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
membership: { currentProjectRole },
} = useUser();
const { issueDetailSidebarCollapsed } = useAppTheme();
const { isMobile } = usePlatformOS();

const issueOperations: TIssueOperations = useMemo(
() => ({
Expand Down Expand Up @@ -359,18 +361,20 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
isArchived={is_archived}
/>
</div>
<div
className="fixed right-0 z-[5] h-full w-full min-w-[300px] overflow-hidden border-l border-custom-border-200 bg-custom-sidebar-background-100 pb-5 sm:w-1/2 md:relative md:w-1/3 lg:min-w-80 xl:min-w-96"
style={issueDetailSidebarCollapsed ? { right: `-${window?.innerWidth || 0}px` } : {}}
>
<IssueDetailsSidebar
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
issueOperations={issueOperations}
isEditable={!is_archived && isEditable}
/>
</div>
{!isMobile && (
<div
className="fixed right-0 z-[5] h-full w-full min-w-[300px] overflow-hidden border-l border-custom-border-200 bg-custom-sidebar-background-100 pb-5 sm:w-1/2 md:relative md:w-1/3 lg:min-w-80 xl:min-w-96"
style={issueDetailSidebarCollapsed ? { right: `-${window?.innerWidth || 0}px` } : {}}
>
<IssueDetailsSidebar
workspaceSlug={workspaceSlug}
projectId={projectId}
issueId={issueId}
issueOperations={issueOperations}
isEditable={!is_archived && isEditable}
/>
</div>
)}
</div>
)}

Expand Down

0 comments on commit 305ddd1

Please sign in to comment.