feat(mobile): match PawFeed web design system, fix Clerk device trust
- Add design tokens (colors, radii, typography) mirroring DESIGN.md's "Spotlight Porch" system, plus Button/TextField/Card components built on them. Restyle the sign-in and placeholder home screens to match. - Load Inter via @expo-google-fonts/inter, gate rendering on fonts + Clerk being ready instead of a blank screen. - Pin react-dom to match react's version — Metro/Hermes hard-require exact equality, and react-dom wasn't pinned anywhere before. - Handle Clerk's `needs_client_trust` status (Device Trust, tied to the dashboard's Native Applications API): send/verify an email code before finalizing sign-in. Verified end-to-end in the Android emulator against the live backend: sign-in, device-trust code verification, and the home screen showing real stats.getPublicStats data.
This commit is contained in:
1 parent
9eb31c3323
commit
dc344f1188
10 files changed
+359
-49
No files matched your search
+5
-1
@@ -25,6 +25,10 @@
|
||||
"web": {
|
||||
"favicon": "./assets/favicon.png"
|
||||
},
|
||||
"plugins": ["expo-router", "expo-secure-store"]
|
||||
"plugins": [
|
||||
"expo-router",
|
||||
"expo-secure-store",
|
||||
"expo-font"
|
||||
]
|
||||
}
|
||||
}
|
||||
+22
-17
@@ -1,7 +1,10 @@
|
||||
import { View, Text, Pressable, StyleSheet, ActivityIndicator } from "react-native";
|
||||
import { View, Text, StyleSheet, ActivityIndicator } from "react-native";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useAuth, useUser } from "@clerk/expo";
|
||||
import { useTRPC } from "../../src/api/trpc";
|
||||
import { Button } from "../../src/components/Button";
|
||||
import { Card } from "../../src/components/Card";
|
||||
import { colors, typography } from "../../src/theme/tokens";
|
||||
|
||||
/**
|
||||
* Placeholder home screen — its only job right now is to prove the mobile
|
||||
@@ -19,32 +22,34 @@ export default function HomeScreen() {
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>Angemeldet als {user?.primaryEmailAddress?.emailAddress}</Text>
|
||||
|
||||
<View style={styles.card}>
|
||||
<Card>
|
||||
<Text style={styles.cardTitle}>Backend-Verbindung</Text>
|
||||
{isLoading && <ActivityIndicator />}
|
||||
{isLoading && <ActivityIndicator color={colors.marigoldOrange} />}
|
||||
{error && <Text style={styles.error}>{error.message}</Text>}
|
||||
{data && (
|
||||
<>
|
||||
<Text>Owner: {data.ownerCount}</Text>
|
||||
<Text>Pets: {data.petCount}</Text>
|
||||
<Text>Sponsoren: {data.sponsorCount}</Text>
|
||||
<Text style={styles.cardBody}>Owner: {data.ownerCount}</Text>
|
||||
<Text style={styles.cardBody}>Pets: {data.petCount}</Text>
|
||||
<Text style={styles.cardBody}>Sponsoren: {data.sponsorCount}</Text>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
</Card>
|
||||
|
||||
<Pressable style={styles.button} onPress={() => signOut()}>
|
||||
<Text style={styles.buttonText}>Abmelden</Text>
|
||||
</Pressable>
|
||||
<Button title="Abmelden" variant="outline" onPress={() => signOut()} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: { flex: 1, padding: 24, gap: 16, paddingTop: 64 },
|
||||
title: { fontSize: 18, fontWeight: "600" },
|
||||
card: { borderWidth: 1, borderColor: "#e5e7eb", borderRadius: 12, padding: 16, gap: 4 },
|
||||
cardTitle: { fontWeight: "600", marginBottom: 8 },
|
||||
error: { color: "#dc2626" },
|
||||
button: { backgroundColor: "#111827", borderRadius: 8, padding: 14, alignItems: "center" },
|
||||
buttonText: { color: "#fff", fontWeight: "600" },
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 24,
|
||||
gap: 16,
|
||||
paddingTop: 64,
|
||||
backgroundColor: colors.porchWhite,
|
||||
},
|
||||
title: { ...typography.title },
|
||||
cardTitle: { ...typography.label, marginBottom: 4 },
|
||||
cardBody: { ...typography.body },
|
||||
error: { ...typography.body, color: colors.alertRed },
|
||||
});
|
||||
@@ -1,7 +1,10 @@
|
||||
import { useState } from "react";
|
||||
import { View, Text, TextInput, Pressable, StyleSheet } from "react-native";
|
||||
import { View, Text, StyleSheet } from "react-native";
|
||||
import { useSignIn } from "@clerk/expo";
|
||||
import { useRouter } from "expo-router";
|
||||
import { Button } from "../../src/components/Button";
|
||||
import { TextField } from "../../src/components/TextField";
|
||||
import { colors, typography } from "../../src/theme/tokens";
|
||||
|
||||
/**
|
||||
* Minimal email/password sign-in — enough to prove the Clerk <-> backend
|
||||
@@ -11,14 +14,30 @@ import { useRouter } from "expo-router";
|
||||
* Uses Clerk's newer "Futures" API (signIn.password()/signIn.finalize()) —
|
||||
* the classic signIn.create()/setActive() pattern from older Clerk docs
|
||||
* doesn't exist on the installed @clerk/expo version. See AGENTS.md.
|
||||
*
|
||||
* Handles the `needs_client_trust` status: Clerk's Device Trust feature
|
||||
* (tied to the dashboard's Native Applications API) requires an email-code
|
||||
* check the first time a device signs in, separate from any account-level
|
||||
* MFA setting — see signIn.mfa.sendEmailCode()/verifyEmailCode() below.
|
||||
*/
|
||||
export default function SignInScreen() {
|
||||
const { signIn, fetchStatus } = useSignIn();
|
||||
const router = useRouter();
|
||||
const [emailAddress, setEmailAddress] = useState("");
|
||||
const [password, setPassword] = useState("");
|
||||
const [code, setCode] = useState("");
|
||||
const [step, setStep] = useState<"credentials" | "verify-device">("credentials");
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
||||
const finalizeIfComplete = async () => {
|
||||
if (signIn.status !== "complete") {
|
||||
setError(`Anmeldung unvollständig — Status: ${signIn.status}`);
|
||||
return;
|
||||
}
|
||||
await signIn.finalize();
|
||||
router.replace("/(app)");
|
||||
};
|
||||
|
||||
const onSignInPress = async () => {
|
||||
setError(null);
|
||||
const { error: signInError } = await signIn.password({ identifier: emailAddress, password });
|
||||
@@ -26,49 +45,85 @@ export default function SignInScreen() {
|
||||
setError(signInError.longMessage ?? signInError.message);
|
||||
return;
|
||||
}
|
||||
if (signIn.status !== "complete") {
|
||||
setError("Anmeldung unvollständig — weitere Schritte erforderlich.");
|
||||
|
||||
if (signIn.status === "needs_client_trust") {
|
||||
const { error: sendError } = await signIn.mfa.sendEmailCode();
|
||||
if (sendError) {
|
||||
setError(sendError.longMessage ?? sendError.message);
|
||||
return;
|
||||
}
|
||||
setStep("verify-device");
|
||||
return;
|
||||
}
|
||||
await signIn.finalize();
|
||||
router.replace("/(app)");
|
||||
|
||||
await finalizeIfComplete();
|
||||
};
|
||||
|
||||
const onVerifyPress = async () => {
|
||||
setError(null);
|
||||
const { error: verifyError } = await signIn.mfa.verifyEmailCode({ code });
|
||||
if (verifyError) {
|
||||
setError(verifyError.longMessage ?? verifyError.message);
|
||||
return;
|
||||
}
|
||||
await finalizeIfComplete();
|
||||
};
|
||||
|
||||
if (step === "verify-device") {
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>Gerät bestätigen</Text>
|
||||
<Text style={styles.hint}>
|
||||
Wir haben einen Code an {emailAddress} geschickt, um dieses Gerät zu bestätigen.
|
||||
</Text>
|
||||
<TextField
|
||||
autoCapitalize="none"
|
||||
keyboardType="number-pad"
|
||||
placeholder="Code"
|
||||
value={code}
|
||||
onChangeText={setCode}
|
||||
/>
|
||||
{error ? <Text style={styles.error}>{error}</Text> : null}
|
||||
<Button title="Bestätigen" disabled={fetchStatus === "fetching"} onPress={onVerifyPress} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.title}>PawFeed Login</Text>
|
||||
<TextInput
|
||||
<TextField
|
||||
autoCapitalize="none"
|
||||
keyboardType="email-address"
|
||||
placeholder="E-Mail"
|
||||
value={emailAddress}
|
||||
onChangeText={setEmailAddress}
|
||||
style={styles.input}
|
||||
/>
|
||||
<TextInput
|
||||
<TextField
|
||||
placeholder="Passwort"
|
||||
secureTextEntry
|
||||
value={password}
|
||||
onChangeText={setPassword}
|
||||
style={styles.input}
|
||||
/>
|
||||
{error ? <Text style={styles.error}>{error}</Text> : null}
|
||||
<Pressable
|
||||
style={styles.button}
|
||||
<Button
|
||||
title="Anmelden"
|
||||
disabled={fetchStatus === "fetching"}
|
||||
onPress={onSignInPress}
|
||||
>
|
||||
<Text style={styles.buttonText}>Anmelden</Text>
|
||||
</Pressable>
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: { flex: 1, justifyContent: "center", padding: 24, gap: 12 },
|
||||
title: { fontSize: 24, fontWeight: "600", marginBottom: 16 },
|
||||
input: { borderWidth: 1, borderColor: "#ccc", borderRadius: 8, padding: 12 },
|
||||
error: { color: "#dc2626" },
|
||||
button: { backgroundColor: "#111827", borderRadius: 8, padding: 14, alignItems: "center" },
|
||||
buttonText: { color: "#fff", fontWeight: "600" },
|
||||
container: {
|
||||
flex: 1,
|
||||
justifyContent: "center",
|
||||
padding: 24,
|
||||
gap: 12,
|
||||
backgroundColor: colors.porchWhite,
|
||||
},
|
||||
title: { ...typography.headline, marginBottom: 16 },
|
||||
hint: { ...typography.body, color: colors.quietGray, marginBottom: 8 },
|
||||
error: { ...typography.body, color: colors.alertRed },
|
||||
});
|
||||
+38
-6
@@ -1,11 +1,20 @@
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { ActivityIndicator, View } from "react-native";
|
||||
import { Slot, useRouter, useSegments } from "expo-router";
|
||||
import { ClerkProvider, ClerkLoaded, useAuth } from "@clerk/expo";
|
||||
import { ClerkProvider, useAuth } from "@clerk/expo";
|
||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
import { QueryClientProvider } from "@tanstack/react-query";
|
||||
import {
|
||||
useFonts,
|
||||
Inter_400Regular,
|
||||
Inter_600SemiBold,
|
||||
Inter_700Bold,
|
||||
Inter_800ExtraBold,
|
||||
} from "@expo-google-fonts/inter";
|
||||
import { secureTokenCache } from "../src/lib/tokenCache";
|
||||
import { env } from "../src/lib/env";
|
||||
import { TRPCProvider, createMobileTRPCClient, makeQueryClient } from "../src/api/trpc";
|
||||
import { colors } from "../src/theme/tokens";
|
||||
|
||||
/**
|
||||
* Redirects between the (auth) and (app) route groups based on Clerk's
|
||||
@@ -44,8 +53,22 @@ function ApiProviders({ children }: { children: React.ReactNode }) {
|
||||
);
|
||||
}
|
||||
|
||||
function LoadingScreen() {
|
||||
return (
|
||||
<View style={{ flex: 1, alignItems: "center", justifyContent: "center", backgroundColor: colors.porchWhite }}>
|
||||
<ActivityIndicator color={colors.marigoldOrange} />
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
function InitialLayout() {
|
||||
const { isLoaded } = useAuth();
|
||||
useProtectedRoute();
|
||||
|
||||
if (!isLoaded) {
|
||||
return <LoadingScreen />;
|
||||
}
|
||||
|
||||
return (
|
||||
<ApiProviders>
|
||||
<Slot />
|
||||
@@ -54,13 +77,22 @@ function InitialLayout() {
|
||||
}
|
||||
|
||||
export default function RootLayout() {
|
||||
const [fontsLoaded] = useFonts({
|
||||
Inter_400Regular,
|
||||
Inter_600SemiBold,
|
||||
Inter_700Bold,
|
||||
Inter_800ExtraBold,
|
||||
});
|
||||
|
||||
if (!fontsLoaded) {
|
||||
return <LoadingScreen />;
|
||||
}
|
||||
|
||||
return (
|
||||
<ClerkProvider publishableKey={env.clerkPublishableKey} tokenCache={secureTokenCache}>
|
||||
<ClerkLoaded>
|
||||
<SafeAreaProvider>
|
||||
<InitialLayout />
|
||||
</SafeAreaProvider>
|
||||
</ClerkLoaded>
|
||||
<SafeAreaProvider>
|
||||
<InitialLayout />
|
||||
</SafeAreaProvider>
|
||||
</ClerkProvider>
|
||||
);
|
||||
}
|
||||
Generated
+13
-5
@@ -9,16 +9,19 @@
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@clerk/expo": "^4.6.1",
|
||||
"@expo-google-fonts/inter": "^0.4.2",
|
||||
"@tanstack/react-query": "5.101.0",
|
||||
"@trpc/client": "11.17.0",
|
||||
"@trpc/tanstack-react-query": "11.17.0",
|
||||
"expo": "~57.0.18",
|
||||
"expo-constants": "~57.0.16",
|
||||
"expo-font": "~57.0.3",
|
||||
"expo-linking": "~57.0.8",
|
||||
"expo-router": "^5.1.11",
|
||||
"expo-secure-store": "~57.0.2",
|
||||
"expo-status-bar": "~57.0.1",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"react-native": "0.86.3",
|
||||
"react-native-safe-area-context": "~5.7.0",
|
||||
"react-native-screens": "~4.26.0"
|
||||
@@ -1295,6 +1298,12 @@
|
||||
"viem": "^2.27.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@expo-google-fonts/inter": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@expo-google-fonts/inter/-/inter-0.4.2.tgz",
|
||||
"integrity": "sha512-syfiImMaDmq7cFi0of+waE2M4uSCyd16zgyWxdPOY7fN2VBmSLKEzkfbZgeOjJq61kSqPBNNtXjggiQiSD6gMQ==",
|
||||
"license": "MIT AND OFL-1.1"
|
||||
},
|
||||
"node_modules/@expo/code-signing-certificates": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@expo/code-signing-certificates/-/code-signing-certificates-0.0.6.tgz",
|
||||
@@ -8254,16 +8263,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/react-dom": {
|
||||
"version": "19.2.8",
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.8.tgz",
|
||||
"integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==",
|
||||
"version": "19.2.3",
|
||||
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz",
|
||||
"integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"scheduler": "^0.27.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^19.2.8"
|
||||
"react": "^19.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/react-fast-compare": {
|
||||
|
||||
@@ -4,16 +4,19 @@
|
||||
"main": "expo-router/entry",
|
||||
"dependencies": {
|
||||
"@clerk/expo": "^4.6.1",
|
||||
"@expo-google-fonts/inter": "^0.4.2",
|
||||
"@tanstack/react-query": "5.101.0",
|
||||
"@trpc/client": "11.17.0",
|
||||
"@trpc/tanstack-react-query": "11.17.0",
|
||||
"expo": "~57.0.18",
|
||||
"expo-constants": "~57.0.16",
|
||||
"expo-font": "~57.0.3",
|
||||
"expo-linking": "~57.0.8",
|
||||
"expo-router": "^5.1.11",
|
||||
"expo-secure-store": "~57.0.2",
|
||||
"expo-status-bar": "~57.0.1",
|
||||
"react": "19.2.3",
|
||||
"react-dom": "19.2.3",
|
||||
"react-native": "0.86.3",
|
||||
"react-native-safe-area-context": "~5.7.0",
|
||||
"react-native-screens": "~4.26.0"
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import { Pressable, Text, StyleSheet, type PressableProps } from "react-native";
|
||||
import { colors, radii, fontFamily } from "../theme/tokens";
|
||||
|
||||
type Variant = "primary" | "outline";
|
||||
|
||||
type Props = PressableProps & {
|
||||
title: string;
|
||||
variant?: Variant;
|
||||
};
|
||||
|
||||
/**
|
||||
* Mirrors the web app's button-primary/button-outline tokens (DESIGN.md) —
|
||||
* marigold fill for primary, hairline-bordered canvas fill for outline.
|
||||
* Height is 48px rather than the web's 32px: that control size is a
|
||||
* desktop-density choice, too small as a touch target on a phone.
|
||||
*/
|
||||
export function Button({ title, variant = "primary", style, disabled, ...rest }: Props) {
|
||||
return (
|
||||
<Pressable
|
||||
disabled={disabled}
|
||||
style={(state) => [
|
||||
styles.base,
|
||||
variant === "primary" ? styles.primary : styles.outline,
|
||||
disabled && styles.disabled,
|
||||
state.pressed && !disabled && styles.pressed,
|
||||
typeof style === "function" ? style(state) : style,
|
||||
]}
|
||||
{...rest}
|
||||
>
|
||||
<Text style={variant === "primary" ? styles.primaryText : styles.outlineText}>{title}</Text>
|
||||
</Pressable>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
base: {
|
||||
height: 48,
|
||||
borderRadius: radii.lg,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
paddingHorizontal: 16,
|
||||
},
|
||||
primary: {
|
||||
backgroundColor: colors.marigoldOrange,
|
||||
},
|
||||
outline: {
|
||||
backgroundColor: colors.porchWhite,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.hairlineGray,
|
||||
},
|
||||
pressed: {
|
||||
transform: [{ translateY: 1 }],
|
||||
opacity: 0.92,
|
||||
},
|
||||
disabled: {
|
||||
opacity: 0.5,
|
||||
},
|
||||
primaryText: {
|
||||
color: colors.pureWhite,
|
||||
fontFamily: fontFamily.semiBold,
|
||||
fontSize: 14,
|
||||
},
|
||||
outlineText: {
|
||||
color: colors.ink,
|
||||
fontFamily: fontFamily.semiBold,
|
||||
fontSize: 14,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { View, StyleSheet, type ViewProps } from "react-native";
|
||||
import { colors, radii, spacing } from "../theme/tokens";
|
||||
|
||||
/**
|
||||
* Mirrors the web app's card token (DESIGN.md): pure-white surface,
|
||||
* rounded-xl, defined by a hairline ring rather than a resting shadow.
|
||||
*/
|
||||
export function Card({ style, ...rest }: ViewProps) {
|
||||
return <View style={[styles.card, style]} {...rest} />;
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
card: {
|
||||
backgroundColor: colors.pureWhite,
|
||||
borderRadius: radii.xl,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.hairlineGray,
|
||||
padding: spacing.cardDefault,
|
||||
gap: 4,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
import { TextInput, StyleSheet, type TextInputProps } from "react-native";
|
||||
import { colors, radii, fontFamily } from "../theme/tokens";
|
||||
|
||||
/**
|
||||
* Mirrors the web app's input token (DESIGN.md): rounded-lg, transparent
|
||||
* background, hairline border. Height is 48px rather than the web's 32px —
|
||||
* see Button.tsx for why touch targets diverge from the desktop control size.
|
||||
*/
|
||||
export function TextField(props: TextInputProps) {
|
||||
return <TextInput placeholderTextColor={colors.quietGray} {...props} style={[styles.input, props.style]} />;
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
input: {
|
||||
height: 48,
|
||||
borderRadius: radii.lg,
|
||||
borderWidth: 1,
|
||||
borderColor: colors.hairlineGray,
|
||||
backgroundColor: "transparent",
|
||||
paddingHorizontal: 14,
|
||||
fontFamily: fontFamily.regular,
|
||||
fontSize: 14,
|
||||
color: colors.ink,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* Design tokens mirroring the web app's "Spotlight Porch" system — see
|
||||
* ../../../DESIGN.md at the repo root. Hex values are sRGB approximations of
|
||||
* the web app's OKLCH tokens (React Native's StyleSheet doesn't parse oklch()).
|
||||
* Keep in sync by hand when DESIGN.md changes; there's no shared package yet.
|
||||
*/
|
||||
|
||||
export const colors = {
|
||||
marigoldOrange: "#f97316",
|
||||
marigoldOrangeHover: "#ea580c",
|
||||
marigoldTint: "#ffedd5",
|
||||
marigoldDeep: "#c2410c",
|
||||
porchWhite: "#fafafa",
|
||||
pureWhite: "#ffffff",
|
||||
ink: "#171717",
|
||||
hairlineGray: "#e5e5e5",
|
||||
whisperGray: "#f2f2f2",
|
||||
quietGray: "#737373",
|
||||
alertRed: "#dc2626",
|
||||
alertRedTint: "#fee2e2",
|
||||
} as const;
|
||||
|
||||
export const radii = {
|
||||
sm: 6,
|
||||
md: 8,
|
||||
lg: 10,
|
||||
xl: 14,
|
||||
"2xl": 18,
|
||||
"3xl": 22,
|
||||
"4xl": 26,
|
||||
} as const;
|
||||
|
||||
export const spacing = {
|
||||
cardSm: 12,
|
||||
cardDefault: 16,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Font family names as registered by useFonts() in app/_layout.tsx — must
|
||||
* match the @expo-google-fonts/inter export names exactly.
|
||||
*/
|
||||
export const fontFamily = {
|
||||
regular: "Inter_400Regular",
|
||||
semiBold: "Inter_600SemiBold",
|
||||
bold: "Inter_700Bold",
|
||||
extraBold: "Inter_800ExtraBold",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Named text styles from DESIGN.md's typography scale. React Native has no
|
||||
* letter-spacing keyword like Tailwind's tracking-tight, so values are in
|
||||
* absolute pixels (negative = tighter).
|
||||
*/
|
||||
export const typography = {
|
||||
display: {
|
||||
fontFamily: fontFamily.extraBold,
|
||||
fontSize: 30,
|
||||
lineHeight: 36,
|
||||
letterSpacing: -0.5,
|
||||
color: colors.ink,
|
||||
},
|
||||
headline: {
|
||||
fontFamily: fontFamily.bold,
|
||||
fontSize: 24,
|
||||
lineHeight: 30,
|
||||
letterSpacing: -0.3,
|
||||
color: colors.ink,
|
||||
},
|
||||
title: {
|
||||
fontFamily: fontFamily.semiBold,
|
||||
fontSize: 20,
|
||||
lineHeight: 28,
|
||||
color: colors.ink,
|
||||
},
|
||||
body: {
|
||||
fontFamily: fontFamily.regular,
|
||||
fontSize: 14,
|
||||
lineHeight: 22,
|
||||
color: colors.ink,
|
||||
},
|
||||
label: {
|
||||
fontFamily: fontFamily.semiBold,
|
||||
fontSize: 12,
|
||||
lineHeight: 16,
|
||||
letterSpacing: 0.3,
|
||||
textTransform: "uppercase",
|
||||
color: colors.quietGray,
|
||||
},
|
||||
} as const;
|
||||
Reference in new issue
Block a user