This file contains hidden or 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 from "react" | |
| import { SafeAreaProvider } from "react-native-safe-area-context" | |
| // Cache the wrapper component to avoid creating a new one every time a screen | |
| // is created. | |
| const componentsCache = new WeakMap< | |
| React.ComponentType<any>, | |
| React.ComponentType<any> | |
| >() |
This file contains hidden or 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
| { | |
| "common": { | |
| "ok": "OK!", | |
| "cancel": "Cancel", | |
| "continue": "Continue", | |
| "doThisLater": "Do This Later", | |
| "percentageCompleted": "%{number}% Completed", | |
| "needHelp": "Need help ?", | |
| "done": "Done", | |
| "next": "Next", |
This file contains hidden or 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
| /* eslint-disable @typescript-eslint/no-explicit-any */ | |
| import React from "react" | |
| import { SafeAreaProvider } from "react-native-safe-area-context" | |
| // Cache the wrapper component to avoid creating a new one every time a screen | |
| // is created. | |
| const componentsCache = new WeakMap< | |
| React.ComponentType<any>, | |
| React.ComponentType<any> | |
| >() |
This file contains hidden or 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 from "react" | |
| import { KeyboardAvoidingView, Platform } from "react-native" | |
| import { StatusBar } from "expo-status-bar" | |
| import { ScreenProps } from "./screen.props" | |
| import { isNonScrolling, offsets, variants } from "./screen.variants" | |
| import { useAppColorScheme } from "@zaboca/ui/hooks/use-app-color-scheme" | |
| import { useThemeColor } from "@zaboca/ui/hooks/use-theme-color" | |
| import { View } from "@zaboca/ui/view" | |
| import { useSafeAreaInsets } from "@zaboca/ui/dimensions" | |
| import { ScrollView } from "@zaboca/ui/scroll-view" |
This file contains hidden or 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 { useEffect, useRef } from "react" | |
| import { noop } from "../../utils" | |
| export function useInterval( | |
| callback: () => void, | |
| delay: number | null | false, | |
| immediate?: boolean, | |
| ) { | |
| const savedCallback = useRef(noop) |
This file contains hidden or 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, { FC, useMemo } from "react" | |
| import { ViewStyle } from "react-native" | |
| import { WebView as RNWebView } from "react-native-webview" | |
| import { | |
| WebViewMessageEvent, | |
| WebViewNavigationEvent, | |
| WebViewSourceUri, | |
| } from "react-native-webview/lib/WebViewTypes" | |
| interface WebViewProps { |
This file contains hidden or 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 { ViewStyle } from "react-native" | |
| export interface SwitchProps { | |
| /** | |
| * On or off. | |
| */ | |
| value?: boolean | |
| /** | |
| * Fires when the on/off switch triggers. | |
| * |
This file contains hidden or 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 { useRef } from 'react' | |
| export function useFirstMountState(): boolean { | |
| const isFirst = useRef(true) | |
| if (isFirst.current) { | |
| isFirst.current = false | |
| return true | |
| } |
This file contains hidden or 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 { Dimensions } from "react-native" | |
| const { width, height } = Dimensions.get("window") | |
| export const widthBreakpoint = (() => { | |
| switch (true) { | |
| case width < 375: | |
| return "small" | |
| case width >= 375 && width < 420: | |
| return "medium" |
This file contains hidden or 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 * as RNIap from 'react-native-iap'; | |
| const productIds = Platform.select({ | |
| ios: [ | |
| 'dev.harris.rniaptutorial' | |
| ] | |
| }); |