bbbcf9f586
Adds necessary dependencies including axios and react-native-calendars to pnpm-lock.yaml. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7b0991ce-c7b8-4c82-9acc-fd3f9e762a01 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: dc1266fa-8375-43e1-aca0-9df31350f647 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/86064bd6-c937-4ca5-a5bf-bbef5749fb60/7b0991ce-c7b8-4c82-9acc-fd3f9e762a01/kWnlAIM Replit-Helium-Checkpoint-Created: true
25 lines
843 B
TypeScript
25 lines
843 B
TypeScript
import { useColorScheme } from "react-native";
|
|
|
|
import colors from "@/constants/colors";
|
|
|
|
/**
|
|
* Returns the design tokens for the current color scheme.
|
|
*
|
|
* The returned object contains all color tokens for the active palette
|
|
* plus scheme-independent values like `radius`.
|
|
*
|
|
* Falls back to the light palette when no dark key is defined in
|
|
* constants/colors.ts (the scaffold ships light-only by default).
|
|
* When a sibling web artifact's dark tokens are synced into a `dark`
|
|
* key, this hook will automatically switch palettes based on the
|
|
* device's appearance setting.
|
|
*/
|
|
export function useColors() {
|
|
const scheme = useColorScheme();
|
|
const palette =
|
|
scheme === "dark" && "dark" in colors
|
|
? (colors as Record<string, typeof colors.light>).dark
|
|
: colors.light;
|
|
return { ...palette, radius: colors.radius };
|
|
}
|