fix(mobile): dark mode on auth screens + RepostCard, expand .easignore
Sign-in/sign-up and RepostCard used the static (light-only) color tokens instead of useTheme() — in dark mode the login screen kept a light background with light-theme-colored text baked in, and RepostCard's text color was hardcoded independent of its (already theme-aware) surrounding background, both landing on illegible low-contrast text. Same bug class as earlier dark-mode fixes this session, converted the same way (useTheme() + makeStyles(colors)). Also add a root-level .easignore (EAS Build's archive root may resolve above mobile/ for monorepo purposes) excluding backend/tooling directories the mobile app never needs at build or runtime (.claude, .impeccable, .planning, docker, prisma — the last is only a type-only dependency via mobile's tRPC router import, erased before Metro bundles anything).
This commit is contained in:
1 parent
212cff942b
commit
c04b69a11f
5 files changed
+90
-46
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { useMemo } from "react";
|
||||
import { View, Text, Pressable, StyleSheet, useWindowDimensions } from "react-native";
|
||||
import { useRouter } from "expo-router";
|
||||
import { useTranslation } from "react-i18next";
|
||||
@@ -5,7 +6,8 @@ import { Image } from "expo-image";
|
||||
import { PawPrint, Video, Trophy } from "lucide-react-native";
|
||||
import { PetAvatar } from "./PetAvatar";
|
||||
import { getMediaUrl } from "../lib/media-url";
|
||||
import { colors, typography, radii } from "../theme/tokens";
|
||||
import { useTheme } from "../context/ThemeContext";
|
||||
import { getTypography, radii, type ColorTokens, type Typography } from "../theme/tokens";
|
||||
import type { PostCardPost } from "./PostCard";
|
||||
|
||||
type Props = {
|
||||
@@ -25,6 +27,8 @@ export function RepostCard({ post }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const router = useRouter();
|
||||
const { width } = useWindowDimensions();
|
||||
const { colors } = useTheme();
|
||||
const styles = useMemo(() => makeStyles(colors), [colors]);
|
||||
const cardWidth = width - 32;
|
||||
const originalPost = post.repost?.originalPost;
|
||||
|
||||
@@ -72,18 +76,21 @@ export function RepostCard({ post }: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
card: { gap: 8 },
|
||||
attribution: { flexDirection: "row", alignItems: "center", gap: 6 },
|
||||
attributionText: { ...typography.label, textTransform: "none", letterSpacing: 0, color: colors.quietGray },
|
||||
header: { flexDirection: "row", alignItems: "center", gap: 8 },
|
||||
name: { ...typography.body, fontFamily: typography.title.fontFamily },
|
||||
caption: { ...typography.body },
|
||||
placeholder: {
|
||||
aspectRatio: 1.2,
|
||||
borderRadius: radii.md,
|
||||
backgroundColor: colors.ink,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
});
|
||||
function makeStyles(colors: ColorTokens) {
|
||||
const typography: Typography = getTypography(colors);
|
||||
return StyleSheet.create({
|
||||
card: { gap: 8 },
|
||||
attribution: { flexDirection: "row", alignItems: "center", gap: 6 },
|
||||
attributionText: { ...typography.label, textTransform: "none", letterSpacing: 0, color: colors.quietGray },
|
||||
header: { flexDirection: "row", alignItems: "center", gap: 8 },
|
||||
name: { ...typography.body, fontFamily: typography.title.fontFamily },
|
||||
caption: { ...typography.body },
|
||||
placeholder: {
|
||||
aspectRatio: 1.2,
|
||||
borderRadius: radii.md,
|
||||
backgroundColor: colors.ink,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user