Skip to content

Commit f5fd5d7

Browse files
authored
Feature/better ux edit recurring (#588)
* rename .env.example file with .env * Set text color of selected today in date-picker to white * make new recurring event darker * change alert to toast * .env.example file added * update my .env.example file * Remove .env.example from repo * new changes for better-ux-edit-recurring * deleting isRecurring on web.event.types.ts file
1 parent 20e4044 commit f5fd5d7

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/web/src/views/Calendar/components/Event/Grid/GridEvent/GridEvent.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import React, {
66
memo,
77
useMemo,
88
} from "react";
9+
import { toast } from "react-toastify";
910
import { Priorities } from "@core/constants/core.constants";
1011
import {
1112
DATA_EVENT_ELEMENT_ID,
@@ -34,6 +35,8 @@ interface Props {
3435
isDragging: boolean;
3536
isPlaceholder: boolean;
3637
isResizing: boolean;
38+
isRecurring: boolean;
39+
isInPast: boolean;
3740
measurements: Measurements_Grid;
3841
onEventMouseDown: (event: Schema_GridEvent, e: MouseEvent) => void;
3942
onScalerMouseDown: (
@@ -47,6 +50,7 @@ interface Props {
4750
const _GridEvent = (
4851
{
4952
event: _event,
53+
5054
isDraft,
5155
isDragging,
5256
isPlaceholder,
@@ -83,6 +87,7 @@ const _GridEvent = (
8387
allDay: event.isAllDay || false,
8488
className: isDraft ? "active" : undefined,
8589
height: position.height || 0,
90+
isRecurring,
8691
isDragging,
8792
isInPast,
8893
isPlaceholder,
@@ -93,7 +98,7 @@ const _GridEvent = (
9398
onMouseDown: (e: MouseEvent) => {
9499
if (isRecurring) {
95100
console.log(event);
96-
alert("Can't edit recurring events (yet)");
101+
toast("Can't edit recurring events (yet)");
97102
e.stopPropagation();
98103
return;
99104
}
@@ -140,7 +145,7 @@ const _GridEvent = (
140145
showResizeCursor={!isPlaceholder && !isResizing && !isDragging}
141146
onMouseDown={(e) => {
142147
if (isRecurring) {
143-
alert("Can't edit recurring events (yet)");
148+
toast("Can't edit recurring events (yet)");
144149
e.stopPropagation();
145150
return;
146151
}

packages/web/src/views/Calendar/components/Event/styled.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ interface StyledEventProps {
1515
hoverColor?: string;
1616
isDragging: boolean;
1717
isInPast: boolean;
18+
isRecurring: boolean;
1819
isResizing: boolean;
1920
isPlaceholder: boolean;
2021
isOptimistic: boolean;
@@ -52,7 +53,8 @@ export const StyledEvent = styled.div.attrs<StyledEventProps>((props) => {
5253
})<StyledEventProps>`
5354
background-color: ${(props) => props.backgroundColor};
5455
border-radius: 2px;
55-
filter: brightness(${({ isInPast }) => (isInPast ? 0.7 : null)});
56+
filter: ${({ isRecurring, isInPast }) =>
57+
isRecurring || isInPast ? "brightness(0.7)" : "brightness(1)"};
5658
height: ${({ height }) => height}px;
5759
left: ${(props) => props.left}px;
5860
opacity: ${(props) => props.opacity};

packages/web/src/views/Calendar/components/Grid/AllDayRow/AllDayEvent.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import dayjs from "dayjs";
22
import React, { MouseEvent, memo } from "react";
3+
import { toast } from "react-toastify";
34
import { Priorities } from "@core/constants/core.constants";
45
import { DATA_EVENT_ELEMENT_ID } from "@web/common/constants/web.constants";
56
import { Schema_GridEvent } from "@web/common/types/web.event.types";
@@ -49,13 +50,14 @@ const AllDayEvent = ({
4950
isInPast: dayjs().isAfter(dayjs(event.endDate)),
5051
isPlaceholder,
5152
isOptimistic,
53+
isRecurring,
5254
isResizing: false,
5355
left: position.left,
5456
lineClamp: 1,
5557
onMouseDown: (e: MouseEvent) => {
5658
if (isRecurring) {
5759
console.log(event);
58-
alert("Can't edit recurring events (yet)");
60+
toast("Can't edit recurring events (yet)");
5961
e.stopPropagation();
6062
return;
6163
}

0 commit comments

Comments
 (0)