Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { | |
createContext, | |
useCallback, | |
useContext, | |
useReducer, | |
} from "react"; | |
import AsyncStorage from "@react-native-community/async-storage"; | |
import api from "../services/api"; | |
import { IAuthState, initialState } from "./authState"; | |
import { ActionType, AuthActions, ICredentials } from "./authActions"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import createDataContext from "./createDataContext"; | |
import trackerApi from "../api/trackerApi"; | |
import AsyncStorage from "@react-native-community/async-storage"; | |
import { navigate } from "../navigationRef"; | |
const TOKEN_KEY = "@TrackersApp"; | |
const ACTIONS = { | |
ADD_ERROR: "add_error", | |
SIGN_UP: "sign_up", | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { parse, format } from "date-fns"; | |
export function convertStringToDate(dateValue: string): Date { | |
const parsedDate = parse(dateValue, "dd/MM/yyyy", new Date()); | |
const day = parsedDate.getDate(); | |
const month = parsedDate.getMonth(); | |
const year = parsedDate.getFullYear(); | |
return new Date(year, month, day, 23, 59, 59); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
useEffect(() => { | |
const handleScroll = () => { | |
const currentScrollY = window.scrollY; | |
// Handle Menu Transparency | |
if ( | |
currentScrollY > 50 && | |
headerBackgroundColor === "transparent" | |
) { | |
setTransparentHeader(false); |