Files
Sauci/apps/mobile/src/components/share/QuestionShareCard.tsx
T
jjbruntonandClaude Fable 5 6bc4e31719 chore(mobile): upgrade to Expo SDK 56
Bump expo, react, react-native, and all expo-* / react-native-* peers to
the SDK 56 line via expo install --fix, adding expo-splash-screen and
expo-system-ui for config plugins the SDK split out of core. Bump
@bacons/apple-targets, react-native-view-shot, and other native modules
to versions compatible with React Native 0.85 and the new architecture.

Remove @react-navigation/* direct dependencies and route their hooks
through expo-router, which is no longer compatible with react-navigation
as of SDK 56. Fix RN 0.85's removed StyleSheet.absoluteFillObject (use
absoluteFill) and react-native-view-shot 5.x's ViewShotRef type across
call sites. Downgrade eslint-plugin-react-hooks v7's new React Compiler
era rules to warnings pending a dedicated refactor, and repair Jest
fallout from the jest-expo/reanimated/worklets/expo-media-library bumps.

Regenerate the committed ios/ and android/ native projects with
`expo prebuild --clean` (required for @bacons/apple-targets 5.x) against
the production release channel, and document that requirement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 11:11:37 +01:00

159 lines
4.5 KiB
TypeScript

import { Image, StyleSheet, Text, View } from "react-native";
import { LinearGradient } from "expo-linear-gradient";
import { colors, gradients, radius, spacing, typography } from "../../theme";
const logo = require("../../../assets/logo.png");
interface QuestionShareCardProps {
question: {
text: string;
};
packName?: string;
cardColor?: string;
cardWidth: number;
}
/**
* The story card captured for outbound shares (Instagram Stories, Messages,
* share sheet). Carries the question and Sauci branding only — never the
* sharer's couple join code, which is a private pairing credential, not a
* referral link.
*/
export function QuestionShareCard({
question,
packName,
cardColor,
cardWidth,
}: QuestionShareCardProps) {
const useGradient = !cardColor;
return (
<View style={[styles.card, { width: cardWidth }]}>
{/* Background - solid color matching what the user saw, or gradient fallback */}
{useGradient ? (
<LinearGradient
colors={gradients.primary as [string, string]}
style={[StyleSheet.absoluteFill, { borderRadius: radius.xl }]}
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 1 }}
/>
) : (
<View
style={[
StyleSheet.absoluteFill,
{ backgroundColor: cardColor, borderRadius: radius.xl },
]}
/>
)}
{/* Subtle overlay for depth */}
<View style={styles.overlay} />
{/* Header: wordmark + pack badge */}
<View style={styles.header}>
<View style={styles.wordmark}>
<Image source={logo} style={styles.wordmarkLogo} />
<Text style={styles.wordmarkText}>Sauci</Text>
</View>
{packName ? (
<View style={styles.packBadge}>
<Text style={styles.packBadgeText}>{packName}</Text>
</View>
) : null}
</View>
{/* Question */}
<View style={styles.content}>
<Text style={styles.questionText}>{question.text}</Text>
</View>
{/* Branded footer */}
<View style={styles.footer}>
<Text style={styles.footerPrompt}>Play it with your partner</Text>
<View style={styles.linkPill}>
<Text style={styles.linkText}>sauci.app</Text>
</View>
</View>
</View>
);
}
const styles = StyleSheet.create({
card: {
aspectRatio: 0.7,
borderRadius: radius.xl,
overflow: "hidden",
padding: spacing.lg,
},
overlay: {
...StyleSheet.absoluteFill,
backgroundColor: "rgba(0, 0, 0, 0.1)",
},
header: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
gap: spacing.sm,
},
wordmark: {
flexDirection: "row",
alignItems: "center",
gap: spacing.xs,
},
wordmarkLogo: {
width: 22,
height: 22,
resizeMode: "contain",
},
wordmarkText: {
...typography.subhead,
color: colors.text,
fontWeight: "700",
},
packBadge: {
flexShrink: 1,
backgroundColor: "rgba(255, 255, 255, 0.2)",
paddingHorizontal: spacing.md,
paddingVertical: spacing.xs,
borderRadius: radius.full,
},
packBadgeText: {
...typography.caption1,
color: colors.text,
fontWeight: "600",
},
content: {
flex: 1,
justifyContent: "center",
paddingVertical: spacing.xl,
},
questionText: {
...typography.title1,
color: colors.text,
fontWeight: "700",
lineHeight: 36,
},
footer: {
alignItems: "center",
gap: spacing.sm,
},
footerPrompt: {
...typography.caption1,
color: "rgba(255, 255, 255, 0.85)",
fontWeight: "600",
letterSpacing: 1,
textTransform: "uppercase",
},
linkPill: {
backgroundColor: "rgba(255, 255, 255, 0.95)",
paddingHorizontal: spacing.lg,
paddingVertical: spacing.sm,
borderRadius: radius.full,
},
linkText: {
...typography.subhead,
color: "#1a1a2e",
fontWeight: "700",
},
});