Skip to content

Commit a457e9e

Browse files
committed
refactor(web): simplify calendar interaction states
1 parent 21a728f commit a457e9e

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

packages/web/src/components/PlannerSidebar/PlannerSidebarActions/PlannerSidebarActions.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
CommandIcon,
44
KeyboardIcon,
55
} from "@phosphor-icons/react";
6-
import { getGoogleSyncStatus } from "@web/auth/google/hooks/useConnectGoogle/useConnectGoogle.util";
76
import { useGoogleUiState } from "@web/auth/google/hooks/useConnectGoogle/useGoogleUiState";
87
import { reloadLocation } from "@web/common/utils/browser/browser-navigation.util";
98
import { useVersionCheck } from "@web/components/PlannerSidebar/PlannerSidebarActions/useVersionCheck";
@@ -27,7 +26,7 @@ export const PlannerSidebarActions = ({
2726
const { isUpdateAvailable } = useVersionCheck();
2827
const googleState = useGoogleUiState();
2928
const isCalendarSyncing =
30-
getGoogleSyncStatus(googleState)?.variant === "syncing";
29+
googleState === "IMPORTING" || googleState === "repairing";
3130

3231
const handleUpdateReload = () => {
3332
reloadLocation();

packages/web/src/components/PlannerSidebar/UpNextCard/UpNextCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const UpNextCard: FC = () => {
3939
<button
4040
aria-label={`Up next: ${upNext.title}. ${countdown}.`}
4141
className="c-focus-ring group relative flex w-full min-w-0 flex-col gap-0.5 rounded border border-border-primary bg-bg-secondary px-2 py-1.5 text-left hover:brightness-110"
42-
onClick={() => openEventDetails()}
42+
onClick={() => openEventDetails("gridClick")}
4343
type="button"
4444
>
4545
<span className="pr-8 text-accent-primary text-xs">{countdown}</span>

packages/web/src/components/PlannerSidebar/UpNextCard/useUpNextEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function useUpNextEvent() {
3131
: undefined;
3232

3333
const openEventDetails = useCallback(
34-
(activity: "gridClick" | "keyboardEdit" = "gridClick") => {
34+
(activity: "gridClick" | "keyboardEdit") => {
3535
if (!sourceEvent) return;
3636

3737
const draft = editGridEventDraft(sourceEvent);

0 commit comments

Comments
 (0)