Files
plane/space/ee/components/navbar/controls.tsx
rahulramesha 5ccc9fbc45 [WEB-1255] feat: publish views (#684)
* chore: views publish endpoints

* fix: members and cycles endpoint

* chore: added issue count and attachment count

* chore: resolved build errors

* chore: added created at and updated at in issue response

* chore: comments, votes and reaction endpoints

* chore: removed the comment, votes and reaction endpoint

* feat Publish views

* chore: added import statement

* revert back unnecessary non ee changes

* fix gantt layout

* fix view issues

* fix lints and remove unncessary code

* revert back yarn.lock

---------

Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
2024-07-24 14:32:18 +05:30

51 lines
1.3 KiB
TypeScript

"use client";
import { useEffect, FC } from "react";
import { observer } from "mobx-react";
// components
import { NavbarTheme, UserAvatar } from "@/components/issues";
// hooks
import useIsInIframe from "@/hooks/use-is-in-iframe";
// plane-web
import { useViewIssuesFilter } from "@/plane-web/hooks/store/use-view-issues-filter";
// store
import { PublishStore } from "@/store/publish/publish.store";
import { ViewIssueFilters } from "../issue-layouts/filters/root";
export type NavbarControlsProps = {
publishSettings: PublishStore;
};
export const ViewNavbarControls: FC<NavbarControlsProps> = observer((props) => {
// props
const { publishSettings } = props;
// hooks
const { initIssueFilters } = useViewIssuesFilter();
// derived values
const { anchor } = publishSettings;
const isInIframe = useIsInIframe();
useEffect(() => {
if (anchor) initIssueFilters(anchor, {});
}, [anchor, initIssueFilters]);
if (!anchor) return null;
return (
<>
{/* issue filters */}
<div className="relative flex flex-shrink-0 items-center gap-1 transition-all delay-150 ease-in-out">
<ViewIssueFilters anchor={anchor} />
</div>
{/* theming */}
<div className="relative flex-shrink-0">
<NavbarTheme />
</div>
{!isInIframe && <UserAvatar />}
</>
);
});