forked from github/plane
fix: calendar-layout draggable wrapper condition (#3984)
This commit is contained in:
parent
2dbea54d2a
commit
568701881e
@ -174,6 +174,7 @@ export const CalendarChart: React.FC<Props> = observer((props) => {
|
|||||||
viewId={viewId}
|
viewId={viewId}
|
||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
isDragDisabled
|
isDragDisabled
|
||||||
|
isMobileView
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,7 +7,6 @@ import { CalendarQuickAddIssueForm, CalendarIssueBlockRoot } from "components/is
|
|||||||
import { renderFormattedPayloadDate } from "helpers/date-time.helper";
|
import { renderFormattedPayloadDate } from "helpers/date-time.helper";
|
||||||
// types
|
// types
|
||||||
import { TIssue, TIssueMap } from "@plane/types";
|
import { TIssue, TIssueMap } from "@plane/types";
|
||||||
import useSize from "hooks/use-window-size";
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
date: Date;
|
date: Date;
|
||||||
@ -26,6 +25,7 @@ type Props = {
|
|||||||
addIssuesToView?: (issueIds: string[]) => Promise<any>;
|
addIssuesToView?: (issueIds: string[]) => Promise<any>;
|
||||||
viewId?: string;
|
viewId?: string;
|
||||||
readOnly?: boolean;
|
readOnly?: boolean;
|
||||||
|
isMobileView?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CalendarIssueBlocks: React.FC<Props> = observer((props) => {
|
export const CalendarIssueBlocks: React.FC<Props> = observer((props) => {
|
||||||
@ -41,11 +41,10 @@ export const CalendarIssueBlocks: React.FC<Props> = observer((props) => {
|
|||||||
addIssuesToView,
|
addIssuesToView,
|
||||||
viewId,
|
viewId,
|
||||||
readOnly,
|
readOnly,
|
||||||
|
isMobileView = false,
|
||||||
} = props;
|
} = props;
|
||||||
// states
|
// states
|
||||||
const [showAllIssues, setShowAllIssues] = useState(false);
|
const [showAllIssues, setShowAllIssues] = useState(false);
|
||||||
// hooks
|
|
||||||
const [windowWidth] = useSize();
|
|
||||||
|
|
||||||
const formattedDatePayload = renderFormattedPayloadDate(date);
|
const formattedDatePayload = renderFormattedPayloadDate(date);
|
||||||
const totalIssues = issueIdList?.length ?? 0;
|
const totalIssues = issueIdList?.length ?? 0;
|
||||||
@ -54,8 +53,8 @@ export const CalendarIssueBlocks: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{issueIdList?.slice(0, showAllIssues || windowWidth <= 768 ? issueIdList.length : 4).map((issueId, index) =>
|
{issueIdList?.slice(0, showAllIssues || isMobileView ? issueIdList.length : 4).map((issueId, index) =>
|
||||||
windowWidth > 768 ? (
|
!isMobileView ? (
|
||||||
<Draggable key={issueId} draggableId={issueId} index={index} isDragDisabled={isDragDisabled}>
|
<Draggable key={issueId} draggableId={issueId} index={index} isDragDisabled={isDragDisabled}>
|
||||||
{(provided, snapshot) => (
|
{(provided, snapshot) => (
|
||||||
<div
|
<div
|
||||||
|
Loading…
Reference in New Issue
Block a user