Skip to content
Source
Sign inSign up
samwillis/neon-glow-demo
Open History to see the last commit

theme.ts

19 lines1.2 KB

1import { Platform } from 'react-native';
2import { colors } from '@glow/design-tokens';
3import { glowGradient } from '@glow/design-tokens/art';
4​
5// Native mirror of the web design tokens.
6export const c = { ...colors, faint: '#6f6d8a', borderStrong: '#3b3b55', overlay: 'rgba(10,10,18,0.72)' };
7export const gradient = [...glowGradient] as [string, string, string];
8export const apiUrl = process.env.EXPO_PUBLIC_API_URL ?? 'http://localhost:3001';
9export const webUrl = process.env.EXPO_PUBLIC_WEB_URL ?? 'http://localhost:3000';
10// Media paths are API-relative (/v1/media/...).
11export const mediaUrl = (path?: string | null) => (path ? (path.startsWith('http') ? path : `${apiUrl}${path}`) : undefined);
12// iOS's AVPlayer cannot play WebM; those clips fall back to the poster there.
13export const playableClip = (path?: string | null) => (path && !(Platform.OS === 'ios' && path.endsWith('.webm')) ? mediaUrl(path) : undefined);
14export const glow = (color: string = c.accent, radius = 18) => Platform.select({
15 ios: { shadowColor: color, shadowOpacity: 0.55, shadowRadius: radius, shadowOffset: { width: 0, height: 6 } },
16 default: { elevation: 8 },
17});
18// Height of the floating tab bar above the safe area; screens pad their content by this.
19export const TAB_BAR_SPACE = 64;