Files
cally/components/pages/calendar/CalendarPage.tsx
2024-11-17 23:53:28 +01:00

41 lines
1.1 KiB
TypeScript

import React from "react";
import { View } from "react-native-ui-lib";
import HeaderTemplate from "@/components/shared/HeaderTemplate";
import { InnerCalendar } from "@/components/pages/calendar/InnerCalendar";
import { useSetAtom } from "jotai";
import { refreshEnabledAtom } from "./atoms";
export default function CalendarPage() {
const setRefreshEnabled = useSetAtom(refreshEnabledAtom);
const disableRefreshControl = () => setRefreshEnabled(false);
const enableRefreshControl = () => setRefreshEnabled(true);
return (
<View
style={{ flex: 1, height: "100%", padding: 10 }}
paddingH-22
paddingT-0
>
<View
onStartShouldSetResponder={() => {
enableRefreshControl();
console.log("yeah");
return true;
}}
onResponderRelease={() => {
disableRefreshControl();
console.log("sure");
console.log(refreshEnabledAtom)
}}
>
<HeaderTemplate
message={"Let's get your week started !"}
isWelcome
isCalendar={true}
/>
</View>
<InnerCalendar />
</View>
);
}