From dfe7301f6d23a6ab734bb89506dfc6dcbe44c4b9 Mon Sep 17 00:00:00 2001 From: Milan Paunovic Date: Thu, 28 Nov 2024 08:38:52 +0100 Subject: [PATCH] bugfixes --- android/app/src/main/res/values/strings.xml | 2 +- app/(auth)/calendar/index.tsx | 125 +++++++++--------- components/pages/calendar/CalendarHeader.tsx | 83 ++++++------ .../pages/calendar/ManuallyAddEventModal.tsx | 9 +- eas.json | 5 +- firebase/functions/index.js | 6 +- package.json | 2 + 7 files changed, 116 insertions(+), 116 deletions(-) diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 22880b8..09a92f3 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,5 +1,5 @@ - "Cally " + \"Cally \" contain false light diff --git a/app/(auth)/calendar/index.tsx b/app/(auth)/calendar/index.tsx index 8c64624..0a5987a 100644 --- a/app/(auth)/calendar/index.tsx +++ b/app/(auth)/calendar/index.tsx @@ -1,18 +1,15 @@ import React from "react"; import {RefreshControl, ScrollView, View} from "react-native"; import CalendarPage from "@/components/pages/calendar/CalendarPage"; -import {colorMap} from "@/constants/colorMap"; import TabletCalendarPage from "@/components/pages/(tablet_pages)/calendar/TabletCalendarPage"; import * as Device from "expo-device"; import {DeviceType} from "expo-device"; import {useCalSync} from "@/hooks/useCalSync"; +import {colorMap} from "@/constants/colorMap"; export default function Screen() { const isTablet = Device.deviceType === DeviceType.TABLET; - const { - resyncAllCalendars, - isSyncing, - } = useCalSync(); + const {resyncAllCalendars, isSyncing} = useCalSync(); const onRefresh = React.useCallback(async () => { try { @@ -22,58 +19,68 @@ export default function Screen() { } }, [resyncAllCalendars]); - return ( - - - {Device.deviceType === DeviceType.TABLET ? ( - - ) : ( - - )} - - - - } - bounces={true} - showsVerticalScrollIndicator={false} - pointerEvents={isSyncing ? "auto" : "none"} - /> - + const refreshControl = ( + ); -} + + if (isTablet) { + return ( + + + + + + + ); + } + + return ( + + + + + + ); +} \ No newline at end of file diff --git a/components/pages/calendar/CalendarHeader.tsx b/components/pages/calendar/CalendarHeader.tsx index 20feb48..0fb1e97 100644 --- a/components/pages/calendar/CalendarHeader.tsx +++ b/components/pages/calendar/CalendarHeader.tsx @@ -1,5 +1,5 @@ import React, {memo} from "react"; -import {Button, Picker, PickerModes, SegmentedControl, Text, View,} from "react-native-ui-lib"; +import {Button, Picker, PickerModes, SegmentedControl, Text, View} from "react-native-ui-lib"; import {MaterialIcons} from "@expo/vector-icons"; import {months} from "./constants"; import {StyleSheet} from "react-native"; @@ -8,6 +8,7 @@ import {modeAtom, selectedDateAtom} from "@/components/pages/calendar/atoms"; import {format, isSameDay} from "date-fns"; import * as Device from "expo-device"; import {Mode} from "react-native-big-calendar"; +import { FontAwesome5 } from '@expo/vector-icons'; export const CalendarHeader = memo(() => { const [selectedDate, setSelectedDate] = useAtom(selectedDateAtom); @@ -15,8 +16,8 @@ export const CalendarHeader = memo(() => { const isTablet = Device.deviceType === Device.DeviceType.TABLET; const segments = isTablet - ? [{label: "D"}, {label: "W"}, {label: "M"}] // Tablet segments - : [{label: "D"}, {label: "3D"}, {label: "M"}]; // Phone segments + ? [{label: "D"}, {label: "W"}, {label: "M"}] + : [{label: "D"}, {label: "3D"}, {label: "M"}]; const handleSegmentChange = (index: number) => { let selectedMode: Mode; @@ -46,28 +47,18 @@ export const CalendarHeader = memo(() => { const getInitialIndex = () => { if (isTablet) { - // Tablet index mapping switch (mode) { - case "day": - return 0; - case "week": - return 1; - case "month": - return 2; - default: - return 1; // Default to week view for tablets + case "day": return 0; + case "week": return 1; + case "month": return 2; + default: return 1; } } else { - // Phone index mapping switch (mode) { - case "day": - return 0; - case "3days": - return 1; - case "month": - return 2; - default: - return 1; // Default to 3day view for phones + case "day": return 0; + case "3days": return 1; + case "month": return 2; + default: return 1; } } }; @@ -110,31 +101,16 @@ export const CalendarHeader = memo(() => { - {!isSelectedDateToday && ( - { setIsPrivate(editEvent?.private || false); setStartTime(() => { - const date = new Date(initialDate ?? new Date()); - const minutes = date.getMinutes(); - date.setMinutes(0, 0, 0); - if (minutes >= 30) { - date.setHours(date.getHours() + 1); - } + const date = initialDate ?? new Date(); + date.setSeconds(0, 0); return date; }); - setEndTime(() => { if (editEvent?.end) { return startOfMinute(new Date(editEvent.end)); diff --git a/eas.json b/eas.json index da2a074..a3235fa 100644 --- a/eas.json +++ b/eas.json @@ -11,7 +11,10 @@ }, "preview": { "distribution": "internal", - "channel": "preview" + "channel": "production", + "android": { + "buildType": "apk" + } }, "production": { "channel": "production", diff --git a/firebase/functions/index.js b/firebase/functions/index.js index 4b3c04a..2b0f277 100644 --- a/firebase/functions/index.js +++ b/firebase/functions/index.js @@ -1212,6 +1212,7 @@ async function fetchAndSaveGoogleEvents({token, refreshToken, email, familyId, c email, creatorId, externalOrigin: "google", + private: item.visibility === "private" || item.visibility === "confidential", }; events.push(googleEvent); }); @@ -1399,7 +1400,7 @@ async function fetchAndSaveMicrosoftEvents({token, refreshToken, email, familyId const url = `https://graph.microsoft.com/v1.0/me/calendar/events`; const queryParams = new URLSearchParams({ - $select: 'subject,start,end,id,isAllDay', + $select: 'subject,start,end,id,isAllDay,sensitivity', $filter: `start/dateTime ge '${timeMin}' and end/dateTime le '${timeMax}'` }); @@ -1450,7 +1451,8 @@ async function fetchAndSaveMicrosoftEvents({token, refreshToken, email, familyId familyId, email, creatorId, - externalOrigin: "microsoft" + externalOrigin: "microsoft", + private: item.sensitivity === "private" || item.sensitivity === "confidential", }; }); diff --git a/package.json b/package.json index 67dd5e7..890fceb 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "ios": "TAMAGUI_TARGET=native npx expo run:ios", "ios-native": "TAMAGUI_TARGET=native npx expo run:ios --device", "dev-ios": "TAMAGUI_TARGET=native npx eas-cli build --profile development --platform ios", + "dev-android": "TAMAGUI_TARGET=native npx eas-cli build --profile development --platform android", "build-ios": "TAMAGUI_TARGET=native npx eas-cli build --profile production --platform ios", "build-android": "TAMAGUI_TARGET=native npx eas-cli build --profile production --platform android", + "build-apk": "TAMAGUI_TARGET=native eas build -p android --profile preview", "build-cicd": "TAMAGUI_TARGET=native npx eas-cli build --profile production --platform all --non-interactive --no-wait --auto-submit ", "build-ios-cicd": "TAMAGUI_TARGET=native npx eas-cli build --profile production --platform ios --non-interactive --no-wait --auto-submit ", "build-dev-ios": "TAMAGUI_TARGET=native npx eas-cli build --profile development --platform ios",