Merge pull request 'UI fixes' (#7) from ios-integration into main
Reviewed-on: https://10.10.0.4/AcuPedia/acupedia-mobile-ui/pulls/7 Reviewed-by: Amit Salunke <amit@noreply.localhost>
This commit is contained in:
commit
0a20b779b8
8
.env
8
.env
|
|
@ -17,9 +17,9 @@
|
|||
# old working .env file
|
||||
|
||||
# Production Dev
|
||||
# EXPO_PUBLIC_API_URL=https://api.acupedia.in/api
|
||||
# EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store
|
||||
EXPO_PUBLIC_API_URL=https://api.acupedia.in/api
|
||||
EXPO_PUBLIC_STOREFRONT_URL=https://acupedia.in/store
|
||||
|
||||
# Local Dev
|
||||
EXPO_PUBLIC_API_URL=http://localhost:8000/api
|
||||
EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000
|
||||
# EXPO_PUBLIC_API_URL=http://localhost:8000/api
|
||||
# EXPO_PUBLIC_STOREFRONT_URL=http://localhost:3000
|
||||
|
|
|
|||
7
app.json
7
app.json
|
|
@ -10,7 +10,12 @@
|
|||
"ios": {
|
||||
"bundleIdentifier": "com.anonymous.acupedia",
|
||||
"supportsTablet": true,
|
||||
"icon": "./assets/expo.icon"
|
||||
"icon": "./assets/expo.icon",
|
||||
"infoPlist": {
|
||||
"NSAppTransportSecurity": {
|
||||
"NSAllowsArbitraryLoads": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
import React from "react";
|
||||
import { Redirect } from "expo-router";
|
||||
|
||||
export default function ModulesListRoute() {
|
||||
return <Redirect href="/modules" />;
|
||||
}
|
||||
|
|
@ -180,7 +180,7 @@ export default function SubscriptionScreen() {
|
|||
};
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.safeArea}>
|
||||
<SafeAreaView style={styles.safeArea} edges={["top", "left", "right"]}>
|
||||
<View style={styles.header}>
|
||||
<TouchableOpacity onPress={() => router.back()} style={styles.backButton}>
|
||||
<Ionicons name="chevron-back" size={24} color={Colors.textPrimary} />
|
||||
|
|
@ -272,7 +272,7 @@ export default function SubscriptionScreen() {
|
|||
</>
|
||||
) : (
|
||||
<View style={styles.buttonContainer}>
|
||||
<PrimaryButton title="Back to Modules" onPress={() => router.replace("/modules/list")} />
|
||||
<PrimaryButton title="Back to Modules" onPress={() => router.replace("/modules")} />
|
||||
</View>
|
||||
)}
|
||||
</ScrollView>
|
||||
|
|
@ -281,13 +281,15 @@ export default function SubscriptionScreen() {
|
|||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
safeArea: { flex: 1, backgroundColor: Colors.background },
|
||||
safeArea: { flex: 1, backgroundColor: "#FFFFFF" },
|
||||
header: {
|
||||
height: 60,
|
||||
minHeight: 64,
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
paddingHorizontal: moderateScale(16),
|
||||
paddingTop: Platform.OS === "web" ? 14 : moderateScale(8),
|
||||
paddingBottom: moderateScale(8),
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: "#ECECEC",
|
||||
backgroundColor: "#FFFFFF",
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import React from "react";
|
|||
import {
|
||||
ActivityIndicator,
|
||||
Pressable,
|
||||
SafeAreaView,
|
||||
Text,
|
||||
View,
|
||||
} from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
|
||||
export function ScreenLoading({ message = "Loading content…" }: { message?: string }) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { type ReactNode } from "react";
|
||||
import { Pressable, StyleSheet, Text, View } from "react-native";
|
||||
import { Platform, Pressable, StyleSheet, Text, View } from "react-native";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { moderateScale } from "react-native-size-matters";
|
||||
|
|
@ -92,11 +92,13 @@ export function ContentPageHeader({
|
|||
|
||||
const styles = StyleSheet.create({
|
||||
header: {
|
||||
minHeight: 60,
|
||||
minHeight: 64,
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
paddingHorizontal: moderateScale(16),
|
||||
paddingTop: Platform.OS === "web" ? 14 : moderateScale(8),
|
||||
paddingBottom: moderateScale(8),
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: "#ECECEC",
|
||||
backgroundColor: "#FFFFFF",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import React, { memo, useEffect, useMemo, useRef, useState } from "react";
|
|||
import {
|
||||
ActivityIndicator,
|
||||
FlatList,
|
||||
Image,
|
||||
NativeScrollEvent,
|
||||
NativeSyntheticEvent,
|
||||
Pressable,
|
||||
|
|
@ -12,6 +11,7 @@ import {
|
|||
useWindowDimensions,
|
||||
View,
|
||||
} from "react-native";
|
||||
import { Image } from "expo-image";
|
||||
|
||||
import { useAuthStore } from "@/store/auth.store";
|
||||
import { Colors } from "@/theme/colors";
|
||||
|
|
@ -103,12 +103,13 @@ const GalleryImage = memo(function GalleryImage({
|
|||
<Image
|
||||
source={source}
|
||||
style={styles.image}
|
||||
resizeMode="contain"
|
||||
contentFit="contain"
|
||||
accessible
|
||||
accessibilityRole="image"
|
||||
accessibilityLabel={item.alt_text || item.caption || "Content image"}
|
||||
onLoad={() => setLoading(false)}
|
||||
onError={() => {
|
||||
onError={(error) => {
|
||||
console.warn("Failed to load GalleryImage:", source, error);
|
||||
setLoading(false);
|
||||
setFailed(true);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export function FullScreenMediaViewer({
|
|||
</Text>
|
||||
<Pressable
|
||||
onPress={onClose}
|
||||
hitSlop={12}
|
||||
hitSlop={16}
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Close image viewer"
|
||||
style={({ pressed }) => [styles.closeButton, pressed && styles.pressed]}
|
||||
|
|
@ -107,7 +107,7 @@ export function FullScreenMediaViewer({
|
|||
item={item}
|
||||
accessToken={accessToken}
|
||||
width={width}
|
||||
height={Math.max(height - 170, 320)}
|
||||
height={Math.max(height - 150, 320)}
|
||||
active={index === activeIndex}
|
||||
onZoomStateChange={index === activeIndex ? setZoomed : undefined}
|
||||
/>
|
||||
|
|
@ -128,7 +128,8 @@ export function FullScreenMediaViewer({
|
|||
const styles = StyleSheet.create({
|
||||
root: { flex: 1, backgroundColor: Colors.black },
|
||||
toolbar: {
|
||||
height: 58,
|
||||
height: 56,
|
||||
marginTop: 16,
|
||||
paddingHorizontal: 16,
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
|
|
@ -144,7 +145,12 @@ const styles = StyleSheet.create({
|
|||
backgroundColor: "rgba(255,255,255,0.12)",
|
||||
},
|
||||
pressed: { opacity: 0.65 },
|
||||
footer: { minHeight: 94, paddingHorizontal: 20, paddingTop: 12, paddingBottom: 18 },
|
||||
caption: { color: Colors.white, fontSize: 15, lineHeight: 21, textAlign: "center" },
|
||||
hint: { marginTop: 7, color: "#AFAFAF", fontSize: 12, textAlign: "center" },
|
||||
footer: {
|
||||
minHeight: 64,
|
||||
paddingHorizontal: 20,
|
||||
paddingTop: 6,
|
||||
paddingBottom: 8,
|
||||
},
|
||||
caption: { color: Colors.white, fontSize: 15, lineHeight: 20, textAlign: "center" },
|
||||
hint: { marginTop: 4, color: "#AFAFAF", fontSize: 12, textAlign: "center" },
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React, { memo, useEffect, useMemo, useState } from "react";
|
||||
import { ActivityIndicator, Image, StyleSheet, Text, View } from "react-native";
|
||||
import { ActivityIndicator, StyleSheet, Text, View } from "react-native";
|
||||
import { Image } from "expo-image";
|
||||
import { Gesture, GestureDetector } from "react-native-gesture-handler";
|
||||
import Animated, {
|
||||
runOnJS,
|
||||
|
|
@ -182,13 +183,14 @@ export const ZoomableImage = memo(function ZoomableImage({
|
|||
<Animated.View style={[styles.imageWrap, animatedStyle]}>
|
||||
<Image
|
||||
source={source}
|
||||
resizeMode="contain"
|
||||
contentFit="contain"
|
||||
style={styles.image}
|
||||
accessible
|
||||
accessibilityRole="image"
|
||||
accessibilityLabel={item.alt_text || item.caption || "Content image"}
|
||||
onLoad={() => setLoading(false)}
|
||||
onError={() => {
|
||||
onError={(error) => {
|
||||
console.warn("Failed to load ZoomableImage:", source, error);
|
||||
setLoading(false);
|
||||
setFailed(true);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { ImageSourcePropType } from "react-native";
|
||||
import type { ImageSource } from "expo-image";
|
||||
import type { ContentMediaItem } from "../types/media.types";
|
||||
|
||||
/**
|
||||
|
|
@ -44,7 +44,7 @@ export function buildMediaImageSourceFromValues(
|
|||
storageKey: string | null | undefined,
|
||||
requiresAuth: boolean | null | undefined,
|
||||
accessToken: string | null,
|
||||
): ImageSourcePropType | null {
|
||||
): ImageSource | null {
|
||||
const uri = resolveMediaUri(url, storageKey);
|
||||
|
||||
if (!uri) {
|
||||
|
|
@ -69,7 +69,7 @@ export function buildMediaImageSourceFromValues(
|
|||
export function buildMediaImageSource(
|
||||
item: ContentMediaItem,
|
||||
accessToken: string | null,
|
||||
): ImageSourcePropType | null {
|
||||
): ImageSource | null {
|
||||
return buildMediaImageSourceFromValues(
|
||||
item.url,
|
||||
item.storage_key,
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export function DetailPageShell({ children }: DetailPageShellProps) {
|
|||
const styles = StyleSheet.create({
|
||||
screen: {
|
||||
flex: 1,
|
||||
backgroundColor: "#F6F8F7",
|
||||
backgroundColor: "#FFFFFF",
|
||||
},
|
||||
body: {
|
||||
flex: 1,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React from "react";
|
||||
import { Image, StyleSheet, Text, View } from "react-native";
|
||||
import { StyleSheet, Text, View } from "react-native";
|
||||
import { Image } from "expo-image";
|
||||
import { ContentMediaGallery } from "../../media/ContentMediaGallery";
|
||||
import { useRelationalContentMedia } from "../../media/ContentMediaContext";
|
||||
import { asString } from "../helpers/value";
|
||||
|
|
@ -22,7 +23,7 @@ export function ImageGallery({ images }: { images: Record<string, unknown>[] })
|
|||
return (
|
||||
<View key={`${path}-${index}`} style={styles.item}>
|
||||
<View style={styles.imageFrame}>
|
||||
<Image source={{ uri: path }} resizeMode="contain" style={styles.image} />
|
||||
<Image source={{ uri: path }} contentFit="contain" style={styles.image} />
|
||||
</View>
|
||||
{name ? <Text style={styles.caption}>{name}</Text> : null}
|
||||
</View>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React, { useMemo, useState } from "react";
|
||||
import { Pressable, SafeAreaView, StyleSheet, View } from "react-native";
|
||||
import { Pressable, StyleSheet, View } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
|
||||
|
|
@ -130,7 +131,7 @@ export function CollectionTemplateScreen({
|
|||
);
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.screen}>
|
||||
<SafeAreaView style={styles.screen} edges={["top", "left", "right"]}>
|
||||
<ContentPageHeader
|
||||
title={moduleDisplay.name}
|
||||
onTitlePress={() => router.push(moduleDisplay.homeRoute as never)}
|
||||
|
|
@ -221,7 +222,7 @@ export function CollectionTemplateScreen({
|
|||
const styles = StyleSheet.create({
|
||||
screen: {
|
||||
flex: 1,
|
||||
backgroundColor: "#F6F8F7",
|
||||
backgroundColor: "#FFFFFF",
|
||||
},
|
||||
headerActions: {
|
||||
flexDirection: "row",
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import React from "react";
|
||||
import {
|
||||
Image,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
View,
|
||||
} from "react-native";
|
||||
import { Image } from "expo-image";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import {
|
||||
moderateScale,
|
||||
|
|
@ -28,6 +28,7 @@ export default function EditProfileAvatar({
|
|||
<Image
|
||||
source={{ uri: imageUri }}
|
||||
style={styles.avatar}
|
||||
contentFit="cover"
|
||||
/>
|
||||
) : (
|
||||
<View style={styles.avatar}>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import React from "react";
|
||||
import {
|
||||
Image,
|
||||
Pressable,
|
||||
StyleSheet,
|
||||
Text,
|
||||
View,
|
||||
} from "react-native";
|
||||
import { Image } from "expo-image";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { useRouter } from "expo-router";
|
||||
import {
|
||||
|
|
@ -43,6 +43,7 @@ export default function ProfileAvatar({
|
|||
<Image
|
||||
source={{ uri: imageUri }}
|
||||
style={styles.avatar}
|
||||
contentFit="cover"
|
||||
/>
|
||||
) : (
|
||||
<View style={styles.avatar}>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useEffect, useMemo, useState } from "react";
|
||||
import { Pressable, StyleSheet, Text, TextInput, View } from "react-native";
|
||||
import { Platform, Pressable, StyleSheet, Text, TextInput, View } from "react-native";
|
||||
import { SafeAreaView } from "react-native-safe-area-context";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
|
|
@ -325,13 +325,15 @@ export default function FacetedSearchScreen({
|
|||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
safe: { flex: 1, backgroundColor: Colors.surface },
|
||||
safe: { flex: 1, backgroundColor: Colors.white },
|
||||
header: {
|
||||
height: 60,
|
||||
minHeight: 64,
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
paddingHorizontal: 16,
|
||||
paddingTop: Platform.OS === "web" ? 14 : 8,
|
||||
paddingBottom: 8,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: "#ECECEC",
|
||||
backgroundColor: Colors.white,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import React, { useCallback, useEffect, useMemo } from "react";
|
||||
import {
|
||||
Platform,
|
||||
ScrollView,
|
||||
StyleSheet,
|
||||
Text,
|
||||
|
|
@ -119,7 +120,7 @@ export default function ModulesIndexScreen() {
|
|||
);
|
||||
|
||||
return (
|
||||
<SafeAreaView style={styles.safeArea}>
|
||||
<SafeAreaView style={styles.safeArea} edges={["top", "left", "right"]}>
|
||||
<View style={styles.container}>
|
||||
<View style={styles.header}>
|
||||
<TouchableOpacity
|
||||
|
|
@ -247,17 +248,20 @@ export default function ModulesIndexScreen() {
|
|||
const styles = StyleSheet.create({
|
||||
safeArea: {
|
||||
flex: 1,
|
||||
backgroundColor: Colors.background,
|
||||
backgroundColor: "#FFFFFF",
|
||||
},
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Colors.background,
|
||||
},
|
||||
header: {
|
||||
height: 60,
|
||||
minHeight: 64,
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
paddingHorizontal: moderateScale(16),
|
||||
paddingTop: Platform.OS === "web" ? 14 : moderateScale(8),
|
||||
paddingBottom: moderateScale(8),
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: "#ECECEC",
|
||||
backgroundColor: "#FFFFFF",
|
||||
|
|
|
|||
Loading…
Reference in New Issue