Compare commits

..

No commits in common. "0a20b779b84ad0b6f450ff4935294c2ac4c345c1" and "1265fad98acfef6602a2d7aec3a5930f4014ab10" have entirely different histories.

17 changed files with 41 additions and 75 deletions

8
.env
View File

@ -17,9 +17,9 @@
# old working .env file # old working .env file
# Production Dev # Production Dev
EXPO_PUBLIC_API_URL=https://api.acupedia.in/api # EXPO_PUBLIC_API_URL=https://api.acupedia.in/api
EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store # EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store
# Local Dev # Local Dev
# EXPO_PUBLIC_API_URL=http://localhost:8000/api EXPO_PUBLIC_API_URL=http://localhost:8000/api
# EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000 EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000

View File

@ -10,12 +10,7 @@
"ios": { "ios": {
"bundleIdentifier": "com.anonymous.acupedia", "bundleIdentifier": "com.anonymous.acupedia",
"supportsTablet": true, "supportsTablet": true,
"icon": "./assets/expo.icon", "icon": "./assets/expo.icon"
"infoPlist": {
"NSAppTransportSecurity": {
"NSAllowsArbitraryLoads": true
}
}
}, },
"android": { "android": {
"adaptiveIcon": { "adaptiveIcon": {

View File

@ -1,6 +0,0 @@
import React from "react";
import { Redirect } from "expo-router";
export default function ModulesListRoute() {
return <Redirect href="/modules" />;
}

View File

@ -180,7 +180,7 @@ export default function SubscriptionScreen() {
}; };
return ( return (
<SafeAreaView style={styles.safeArea} edges={["top", "left", "right"]}> <SafeAreaView style={styles.safeArea}>
<View style={styles.header}> <View style={styles.header}>
<TouchableOpacity onPress={() => router.back()} style={styles.backButton}> <TouchableOpacity onPress={() => router.back()} style={styles.backButton}>
<Ionicons name="chevron-back" size={24} color={Colors.textPrimary} /> <Ionicons name="chevron-back" size={24} color={Colors.textPrimary} />
@ -272,7 +272,7 @@ export default function SubscriptionScreen() {
</> </>
) : ( ) : (
<View style={styles.buttonContainer}> <View style={styles.buttonContainer}>
<PrimaryButton title="Back to Modules" onPress={() => router.replace("/modules")} /> <PrimaryButton title="Back to Modules" onPress={() => router.replace("/modules/list")} />
</View> </View>
)} )}
</ScrollView> </ScrollView>
@ -281,15 +281,13 @@ export default function SubscriptionScreen() {
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
safeArea: { flex: 1, backgroundColor: "#FFFFFF" }, safeArea: { flex: 1, backgroundColor: Colors.background },
header: { header: {
minHeight: 64, height: 60,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
justifyContent: "space-between", justifyContent: "space-between",
paddingHorizontal: moderateScale(16), paddingHorizontal: moderateScale(16),
paddingTop: Platform.OS === "web" ? 14 : moderateScale(8),
paddingBottom: moderateScale(8),
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: "#ECECEC", borderBottomColor: "#ECECEC",
backgroundColor: "#FFFFFF", backgroundColor: "#FFFFFF",

View File

@ -2,10 +2,10 @@ import React from "react";
import { import {
ActivityIndicator, ActivityIndicator,
Pressable, Pressable,
SafeAreaView,
Text, Text,
View, View,
} from "react-native"; } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
export function ScreenLoading({ message = "Loading content…" }: { message?: string }) { export function ScreenLoading({ message = "Loading content…" }: { message?: string }) {
return ( return (

View File

@ -1,5 +1,5 @@
import React, { type ReactNode } from "react"; import React, { type ReactNode } from "react";
import { Platform, Pressable, StyleSheet, Text, View } from "react-native"; import { Pressable, StyleSheet, Text, View } from "react-native";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { router } from "expo-router"; import { router } from "expo-router";
import { moderateScale } from "react-native-size-matters"; import { moderateScale } from "react-native-size-matters";
@ -92,13 +92,11 @@ export function ContentPageHeader({
const styles = StyleSheet.create({ const styles = StyleSheet.create({
header: { header: {
minHeight: 64, minHeight: 60,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
justifyContent: "space-between", justifyContent: "space-between",
paddingHorizontal: moderateScale(16), paddingHorizontal: moderateScale(16),
paddingTop: Platform.OS === "web" ? 14 : moderateScale(8),
paddingBottom: moderateScale(8),
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: "#ECECEC", borderBottomColor: "#ECECEC",
backgroundColor: "#FFFFFF", backgroundColor: "#FFFFFF",

View File

@ -3,6 +3,7 @@ import React, { memo, useEffect, useMemo, useRef, useState } from "react";
import { import {
ActivityIndicator, ActivityIndicator,
FlatList, FlatList,
Image,
NativeScrollEvent, NativeScrollEvent,
NativeSyntheticEvent, NativeSyntheticEvent,
Pressable, Pressable,
@ -11,7 +12,6 @@ import {
useWindowDimensions, useWindowDimensions,
View, View,
} from "react-native"; } from "react-native";
import { Image } from "expo-image";
import { useAuthStore } from "@/store/auth.store"; import { useAuthStore } from "@/store/auth.store";
import { Colors } from "@/theme/colors"; import { Colors } from "@/theme/colors";
@ -103,13 +103,12 @@ const GalleryImage = memo(function GalleryImage({
<Image <Image
source={source} source={source}
style={styles.image} style={styles.image}
contentFit="contain" resizeMode="contain"
accessible accessible
accessibilityRole="image" accessibilityRole="image"
accessibilityLabel={item.alt_text || item.caption || "Content image"} accessibilityLabel={item.alt_text || item.caption || "Content image"}
onLoad={() => setLoading(false)} onLoad={() => setLoading(false)}
onError={(error) => { onError={() => {
console.warn("Failed to load GalleryImage:", source, error);
setLoading(false); setLoading(false);
setFailed(true); setFailed(true);
}} }}

View File

@ -76,7 +76,7 @@ export function FullScreenMediaViewer({
</Text> </Text>
<Pressable <Pressable
onPress={onClose} onPress={onClose}
hitSlop={16} hitSlop={12}
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel="Close image viewer" accessibilityLabel="Close image viewer"
style={({ pressed }) => [styles.closeButton, pressed && styles.pressed]} style={({ pressed }) => [styles.closeButton, pressed && styles.pressed]}
@ -107,7 +107,7 @@ export function FullScreenMediaViewer({
item={item} item={item}
accessToken={accessToken} accessToken={accessToken}
width={width} width={width}
height={Math.max(height - 150, 320)} height={Math.max(height - 170, 320)}
active={index === activeIndex} active={index === activeIndex}
onZoomStateChange={index === activeIndex ? setZoomed : undefined} onZoomStateChange={index === activeIndex ? setZoomed : undefined}
/> />
@ -128,8 +128,7 @@ export function FullScreenMediaViewer({
const styles = StyleSheet.create({ const styles = StyleSheet.create({
root: { flex: 1, backgroundColor: Colors.black }, root: { flex: 1, backgroundColor: Colors.black },
toolbar: { toolbar: {
height: 56, height: 58,
marginTop: 16,
paddingHorizontal: 16, paddingHorizontal: 16,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
@ -145,12 +144,7 @@ const styles = StyleSheet.create({
backgroundColor: "rgba(255,255,255,0.12)", backgroundColor: "rgba(255,255,255,0.12)",
}, },
pressed: { opacity: 0.65 }, pressed: { opacity: 0.65 },
footer: { footer: { minHeight: 94, paddingHorizontal: 20, paddingTop: 12, paddingBottom: 18 },
minHeight: 64, caption: { color: Colors.white, fontSize: 15, lineHeight: 21, textAlign: "center" },
paddingHorizontal: 20, hint: { marginTop: 7, color: "#AFAFAF", fontSize: 12, textAlign: "center" },
paddingTop: 6,
paddingBottom: 8,
},
caption: { color: Colors.white, fontSize: 15, lineHeight: 20, textAlign: "center" },
hint: { marginTop: 4, color: "#AFAFAF", fontSize: 12, textAlign: "center" },
}); });

View File

@ -1,6 +1,5 @@
import React, { memo, useEffect, useMemo, useState } from "react"; import React, { memo, useEffect, useMemo, useState } from "react";
import { ActivityIndicator, StyleSheet, Text, View } from "react-native"; import { ActivityIndicator, Image, StyleSheet, Text, View } from "react-native";
import { Image } from "expo-image";
import { Gesture, GestureDetector } from "react-native-gesture-handler"; import { Gesture, GestureDetector } from "react-native-gesture-handler";
import Animated, { import Animated, {
runOnJS, runOnJS,
@ -183,14 +182,13 @@ export const ZoomableImage = memo(function ZoomableImage({
<Animated.View style={[styles.imageWrap, animatedStyle]}> <Animated.View style={[styles.imageWrap, animatedStyle]}>
<Image <Image
source={source} source={source}
contentFit="contain" resizeMode="contain"
style={styles.image} style={styles.image}
accessible accessible
accessibilityRole="image" accessibilityRole="image"
accessibilityLabel={item.alt_text || item.caption || "Content image"} accessibilityLabel={item.alt_text || item.caption || "Content image"}
onLoad={() => setLoading(false)} onLoad={() => setLoading(false)}
onError={(error) => { onError={() => {
console.warn("Failed to load ZoomableImage:", source, error);
setLoading(false); setLoading(false);
setFailed(true); setFailed(true);
}} }}

View File

@ -1,4 +1,4 @@
import type { ImageSource } from "expo-image"; import type { ImageSourcePropType } from "react-native";
import type { ContentMediaItem } from "../types/media.types"; import type { ContentMediaItem } from "../types/media.types";
/** /**
@ -44,7 +44,7 @@ export function buildMediaImageSourceFromValues(
storageKey: string | null | undefined, storageKey: string | null | undefined,
requiresAuth: boolean | null | undefined, requiresAuth: boolean | null | undefined,
accessToken: string | null, accessToken: string | null,
): ImageSource | null { ): ImageSourcePropType | null {
const uri = resolveMediaUri(url, storageKey); const uri = resolveMediaUri(url, storageKey);
if (!uri) { if (!uri) {
@ -69,7 +69,7 @@ export function buildMediaImageSourceFromValues(
export function buildMediaImageSource( export function buildMediaImageSource(
item: ContentMediaItem, item: ContentMediaItem,
accessToken: string | null, accessToken: string | null,
): ImageSource | null { ): ImageSourcePropType | null {
return buildMediaImageSourceFromValues( return buildMediaImageSourceFromValues(
item.url, item.url,
item.storage_key, item.storage_key,

View File

@ -77,7 +77,7 @@ export function DetailPageShell({ children }: DetailPageShellProps) {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
screen: { screen: {
flex: 1, flex: 1,
backgroundColor: "#FFFFFF", backgroundColor: "#F6F8F7",
}, },
body: { body: {
flex: 1, flex: 1,

View File

@ -1,6 +1,5 @@
import React from "react"; import React from "react";
import { StyleSheet, Text, View } from "react-native"; import { Image, StyleSheet, Text, View } from "react-native";
import { Image } from "expo-image";
import { ContentMediaGallery } from "../../media/ContentMediaGallery"; import { ContentMediaGallery } from "../../media/ContentMediaGallery";
import { useRelationalContentMedia } from "../../media/ContentMediaContext"; import { useRelationalContentMedia } from "../../media/ContentMediaContext";
import { asString } from "../helpers/value"; import { asString } from "../helpers/value";
@ -23,7 +22,7 @@ export function ImageGallery({ images }: { images: Record<string, unknown>[] })
return ( return (
<View key={`${path}-${index}`} style={styles.item}> <View key={`${path}-${index}`} style={styles.item}>
<View style={styles.imageFrame}> <View style={styles.imageFrame}>
<Image source={{ uri: path }} contentFit="contain" style={styles.image} /> <Image source={{ uri: path }} resizeMode="contain" style={styles.image} />
</View> </View>
{name ? <Text style={styles.caption}>{name}</Text> : null} {name ? <Text style={styles.caption}>{name}</Text> : null}
</View> </View>

View File

@ -1,6 +1,5 @@
import React, { useMemo, useState } from "react"; import React, { useMemo, useState } from "react";
import { Pressable, StyleSheet, View } from "react-native"; import { Pressable, SafeAreaView, StyleSheet, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { router } from "expo-router"; import { router } from "expo-router";
@ -131,7 +130,7 @@ export function CollectionTemplateScreen({
); );
return ( return (
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}> <SafeAreaView style={styles.screen}>
<ContentPageHeader <ContentPageHeader
title={moduleDisplay.name} title={moduleDisplay.name}
onTitlePress={() => router.push(moduleDisplay.homeRoute as never)} onTitlePress={() => router.push(moduleDisplay.homeRoute as never)}
@ -222,7 +221,7 @@ export function CollectionTemplateScreen({
const styles = StyleSheet.create({ const styles = StyleSheet.create({
screen: { screen: {
flex: 1, flex: 1,
backgroundColor: "#FFFFFF", backgroundColor: "#F6F8F7",
}, },
headerActions: { headerActions: {
flexDirection: "row", flexDirection: "row",

View File

@ -1,10 +1,10 @@
import React from "react"; import React from "react";
import { import {
Image,
Pressable, Pressable,
StyleSheet, StyleSheet,
View, View,
} from "react-native"; } from "react-native";
import { Image } from "expo-image";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { import {
moderateScale, moderateScale,
@ -28,7 +28,6 @@ export default function EditProfileAvatar({
<Image <Image
source={{ uri: imageUri }} source={{ uri: imageUri }}
style={styles.avatar} style={styles.avatar}
contentFit="cover"
/> />
) : ( ) : (
<View style={styles.avatar}> <View style={styles.avatar}>

View File

@ -1,11 +1,11 @@
import React from "react"; import React from "react";
import { import {
Image,
Pressable, Pressable,
StyleSheet, StyleSheet,
Text, Text,
View, View,
} from "react-native"; } from "react-native";
import { Image } from "expo-image";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { useRouter } from "expo-router"; import { useRouter } from "expo-router";
import { import {
@ -43,7 +43,6 @@ export default function ProfileAvatar({
<Image <Image
source={{ uri: imageUri }} source={{ uri: imageUri }}
style={styles.avatar} style={styles.avatar}
contentFit="cover"
/> />
) : ( ) : (
<View style={styles.avatar}> <View style={styles.avatar}>

View File

@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useState } from "react"; import React, { useEffect, useMemo, useState } from "react";
import { Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-native"; import { Pressable, StyleSheet, Text, TextInput, View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context"; import { SafeAreaView } from "react-native-safe-area-context";
import { Ionicons } from "@expo/vector-icons"; import { Ionicons } from "@expo/vector-icons";
import { router } from "expo-router"; import { router } from "expo-router";
@ -325,15 +325,13 @@ export default function FacetedSearchScreen({
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
safe: { flex: 1, backgroundColor: Colors.white }, safe: { flex: 1, backgroundColor: Colors.surface },
header: { header: {
minHeight: 64, height: 60,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
justifyContent: "space-between", justifyContent: "space-between",
paddingHorizontal: 16, paddingHorizontal: 16,
paddingTop: Platform.OS === "web" ? 14 : 8,
paddingBottom: 8,
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: "#ECECEC", borderBottomColor: "#ECECEC",
backgroundColor: Colors.white, backgroundColor: Colors.white,

View File

@ -1,6 +1,5 @@
import React, { useCallback, useEffect, useMemo } from "react"; import React, { useCallback, useEffect, useMemo } from "react";
import { import {
Platform,
ScrollView, ScrollView,
StyleSheet, StyleSheet,
Text, Text,
@ -120,7 +119,7 @@ export default function ModulesIndexScreen() {
); );
return ( return (
<SafeAreaView style={styles.safeArea} edges={["top", "left", "right"]}> <SafeAreaView style={styles.safeArea}>
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <View style={styles.header}>
<TouchableOpacity <TouchableOpacity
@ -248,20 +247,17 @@ export default function ModulesIndexScreen() {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
safeArea: { safeArea: {
flex: 1, flex: 1,
backgroundColor: "#FFFFFF", backgroundColor: Colors.background,
}, },
container: { container: {
flex: 1, flex: 1,
backgroundColor: Colors.background,
}, },
header: { header: {
minHeight: 64, height: 60,
flexDirection: "row", flexDirection: "row",
alignItems: "center", alignItems: "center",
justifyContent: "space-between", justifyContent: "space-between",
paddingHorizontal: moderateScale(16), paddingHorizontal: moderateScale(16),
paddingTop: Platform.OS === "web" ? 14 : moderateScale(8),
paddingBottom: moderateScale(8),
borderBottomWidth: 1, borderBottomWidth: 1,
borderBottomColor: "#ECECEC", borderBottomColor: "#ECECEC",
backgroundColor: "#FFFFFF", backgroundColor: "#FFFFFF",