mirror of
https://github.com/urosran/cally.git
synced 2025-07-15 17:47:08 +00:00
Test adding events by clicking on calendar cells
This commit is contained in:
2
app.json
2
app.json
@ -16,7 +16,7 @@
|
||||
"supportsTablet": true,
|
||||
"bundleIdentifier": "com.cally.app",
|
||||
"googleServicesFile": "./ios/GoogleService-Info.plist",
|
||||
"buildNumber": "10"
|
||||
"buildNumber": "11"
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
|
@ -5,6 +5,7 @@ import {Button, Picker, PickerModes, SegmentedControl, Text, View} from "react-n
|
||||
import {MaterialIcons} from "@expo/vector-icons";
|
||||
import {AddEventDialog} from "@/components/pages/calendar/AddEventDialog";
|
||||
import {useGetEvents} from "@/hooks/firebase/useGetEvents";
|
||||
import {ManuallyAddEventModal} from "@/components/pages/calendar/ManuallyAddEventModal";
|
||||
|
||||
const modeMap = new Map([
|
||||
[0, "day"],
|
||||
@ -21,6 +22,8 @@ export default function Screen() {
|
||||
const [calendarHeight, setCalendarHeight] = useState(0);
|
||||
const [mode, setMode] = useState<"week" | "month" | "day">("week");
|
||||
const [selectedDate, setSelectedDate] = useState<Date>(new Date());
|
||||
const [selectedNewEventDate, setSelectedNewEndDate] = useState<Date | undefined>(undefined);
|
||||
|
||||
|
||||
const calendarContainerRef = useRef(null);
|
||||
const { data: events} = useGetEvents()
|
||||
@ -109,6 +112,7 @@ export default function Screen() {
|
||||
events={events ?? []}
|
||||
height={calendarHeight}
|
||||
activeDate={selectedDate}
|
||||
onPressCell={setSelectedNewEndDate}
|
||||
onSwipeEnd={(newDate) => {
|
||||
console.log(newDate)
|
||||
setSelectedDate(newDate);
|
||||
@ -117,7 +121,9 @@ export default function Screen() {
|
||||
)}
|
||||
</View>
|
||||
|
||||
<AddEventDialog/>
|
||||
<AddEventDialog />
|
||||
<ManuallyAddEventModal show={!!selectedNewEventDate} close={() => setSelectedNewEndDate(undefined)}/>
|
||||
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -29,14 +29,14 @@ const daysOfWeek = [
|
||||
{label: "Sunday", value: "sunday"},
|
||||
];
|
||||
|
||||
export const ManuallyAddEventModal = ({show, close}: { show: boolean, close: () => void }) => {
|
||||
export const ManuallyAddEventModal = ({show, close, initialDate}: { show: boolean, close: () => void, initialDate?: Date }) => {
|
||||
const {user} = useAuthContext()
|
||||
const insets = useSafeAreaInsets();
|
||||
|
||||
const [title, setTitle] = useState<string>("");
|
||||
|
||||
const [isAllDay, setIsAllDay] = useState(false);
|
||||
const [startTime, setStartTime] = useState(new Date());
|
||||
const [startTime, setStartTime] = useState(initialDate ?? new Date());
|
||||
const [endTime, setEndTime] = useState(new Date())
|
||||
|
||||
const [startDate, setStartDate] = useState(new Date());
|
||||
|
@ -45,7 +45,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>10</string>
|
||||
<string>11</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
@ -61,6 +61,7 @@
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER).expo.index_route</string>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>SplashScreen</string>
|
||||
|
Reference in New Issue
Block a user