Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { useNavigation } from '@react-navigation/native';
import React from 'react';
import React, { useState, useEffect } from 'react';
import { Image, View } from 'react-native';
import Animated, {
useSharedValue,
useAnimatedStyle,
withTiming,
} from 'react-native-reanimated';
import { SafeAreaView } from 'react-native-safe-area-context';
import { strings } from '../../../../../../locales/i18n';
import ButtonBase from '../../../../../component-library/components/Buttons/Button/foundation/ButtonBase';
Expand Down Expand Up @@ -33,12 +38,25 @@ const PredictGTMModal = () => {
const { trackEvent, createEventBuilder } = useMetrics();
const { navigate } = useNavigation();
const theme = useTheme();
const [imageLoaded, setImageLoaded] = useState(false);
const opacity = useSharedValue(0);

const titleText = strings('predict.gtm_content.title');
const subtitleText = strings('predict.gtm_content.title_description');

const styles = createStyles(theme);

// Animate content fade-in when image loads
useEffect(() => {
if (imageLoaded) {
opacity.value = withTiming(1, { duration: 500 });
}
}, [imageLoaded, opacity]);

const animatedStyle = useAnimatedStyle(() => ({
opacity: opacity.value,
}));

const handleClose = async () => {
await StorageWrapper.setItem(PREDICT_GTM_MODAL_SHOWN, 'true');

Expand Down Expand Up @@ -81,9 +99,16 @@ const PredictGTMModal = () => {
};

return (
<View style={styles.pageContainer} testID="predict-gtm-modal-container">
<Animated.View
style={[styles.pageContainer, animatedStyle]}
testID="predict-gtm-modal-container"
>
{/* Background Image - Full Screen */}
<Image source={PredictMarketingImage} style={styles.backgroundImage} />
<Image
source={PredictMarketingImage}
style={styles.backgroundImage}
onLoad={() => setImageLoaded(true)}
/>

{/* Content Overlay */}
<SafeAreaView style={styles.contentContainer}>
Expand Down Expand Up @@ -142,7 +167,7 @@ const PredictGTMModal = () => {
/>
</View>
</SafeAreaView>
</View>
</Animated.View>
);
};

Expand Down
Loading