chore: project view item observer added

This commit is contained in:
Anmol Singh Bhatia 2024-03-14 13:10:34 +05:30
parent 0f92473eba
commit cae1f53183
2 changed files with 10 additions and 6 deletions

View File

@ -1,4 +1,5 @@
import { FC, useMemo } from "react";
import { observer } from "mobx-react";
// components
import { ViewAppliedFiltersItem } from "./";
// hooks
@ -13,7 +14,7 @@ type TViewAppliedFiltersItemMap = {
filterValue: string[];
};
export const ViewAppliedFiltersItemMap: FC<TViewAppliedFiltersItemMap> = (props) => {
export const ViewAppliedFiltersItemMap: FC<TViewAppliedFiltersItemMap> = observer((props) => {
const { workspaceSlug, projectId, filterKey, filterValue } = props;
// hooks
const viewFilterStore = useViewFilter(workspaceSlug, projectId);
@ -23,7 +24,7 @@ export const ViewAppliedFiltersItemMap: FC<TViewAppliedFiltersItemMap> = (props)
[viewFilterStore, filterKey]
);
const propertyVisibleCount = 5;
const propertyVisibleCount = 3;
if (!filterValue) return <></>;
@ -54,4 +55,4 @@ export const ViewAppliedFiltersItemMap: FC<TViewAppliedFiltersItemMap> = (props)
</div>
</div>
);
};
});

View File

@ -1,8 +1,11 @@
import { FC } from "react";
import { observer } from "mobx-react";
// hooks
import { useViewFilter } from "hooks/user-view-filters";
// icons
import { ImagePlus } from "lucide-react";
// types
import { IIssueFilterOptions } from "@plane/types";
import { useViewFilter } from "hooks/user-view-filters";
type TViewAppliedFiltersItem = {
workspaceSlug: string;
@ -11,7 +14,7 @@ type TViewAppliedFiltersItem = {
propertyId: string;
};
export const ViewAppliedFiltersItem: FC<TViewAppliedFiltersItem> = (props) => {
export const ViewAppliedFiltersItem: FC<TViewAppliedFiltersItem> = observer((props) => {
const { workspaceSlug, projectId, filterKey, propertyId } = props;
// hooks
const viewFilterHelper = useViewFilter(workspaceSlug, projectId);
@ -29,4 +32,4 @@ export const ViewAppliedFiltersItem: FC<TViewAppliedFiltersItem> = (props) => {
<div className="text-xs">{propertyDetail?.label || propertyId}</div>
</div>
);
};
});