2 Commits f0620fe0bd ... e26dc1c689

Author SHA1 Message Date
  Savio Fernando e26dc1c689 Display recommendations if only available 10 months ago
  Savio Fernando 24c41b408b Altered Horizontal Scroll Zone for Smooth Scrolling 10 months ago

+ 1 - 1
src/components/organisms/Sections/TrendingSection.js

@@ -110,7 +110,7 @@ const TrendingSection = props => {
               parallaxScrollingOffset: 1,
               parallaxScrollingOffset: 1,
             }}
             }}
             panGestureHandlerProps={{
             panGestureHandlerProps={{
-              activeOffsetX: [-50, 1050],
+              activeOffsetX: [0, 200],
             }}
             }}
             pagingEnabled
             pagingEnabled
             onSnapToItem={index => updateCurrentIndex(index)}
             onSnapToItem={index => updateCurrentIndex(index)}

+ 27 - 27
src/screens/News/NewsDetailPage.js

@@ -174,7 +174,7 @@ const NewsDetailPage = props => {
     commentInput: {
     commentInput: {
       marginVertical: verticalScale(16),
       marginVertical: verticalScale(16),
       alignItems: 'flex-start',
       alignItems: 'flex-start',
-      justifyContent:'space-between',
+      justifyContent: 'space-between',
       flexDirection: 'row',
       flexDirection: 'row',
       maxWidth: '100%',
       maxWidth: '100%',
     },
     },
@@ -217,7 +217,7 @@ const NewsDetailPage = props => {
   return (
   return (
     <BottomSheetModalProvider>
     <BottomSheetModalProvider>
       <ScrollView ref={mainPageRef} contentContainerStyle={styles.container}>
       <ScrollView ref={mainPageRef} contentContainerStyle={styles.container}>
-        <NewscoutTitleHeader headerStyle={{elevation: 0}}
+        <NewscoutTitleHeader headerStyle={{ elevation: 0 }}
           backButtonShown
           backButtonShown
           onBackClick={() => navigation.goBack()}>
           onBackClick={() => navigation.goBack()}>
           <TouchableWithoutFeedback onPress={() => navigation.toggleDrawer()}>
           <TouchableWithoutFeedback onPress={() => navigation.toggleDrawer()}>
@@ -324,22 +324,22 @@ const NewsDetailPage = props => {
                           }}>
                           }}>
                           {comments.results.length}
                           {comments.results.length}
                         </Text>
                         </Text>
-                        </BottomSheetView>
-                        <ButtonWrapper onPress={handleCloseModalPress}>
-                          <IonIcon
-                            name="close-sharp"
-                            size={moderateScale(20)}
-                            color={colors().recessive}
-                          />
-                        </ButtonWrapper>
-                      
+                      </BottomSheetView>
+                      <ButtonWrapper onPress={handleCloseModalPress}>
+                        <IonIcon
+                          name="close-sharp"
+                          size={moderateScale(20)}
+                          color={colors().recessive}
+                        />
+                      </ButtonWrapper>
+
                     </BottomSheetView>
                     </BottomSheetView>
                     <View style={styles.commentInput}>
                     <View style={styles.commentInput}>
                       <Image
                       <Image
                         source={images.imageCard}
                         source={images.imageCard}
                         style={[styles.profileImage]}
                         style={[styles.profileImage]}
                       />
                       />
-                      
+
                       <TextInput
                       <TextInput
                         multiline
                         multiline
                         mode="outlined"
                         mode="outlined"
@@ -389,21 +389,21 @@ const NewsDetailPage = props => {
             </>
             </>
           </View>
           </View>
         )}
         )}
-        <SectionHeader label={'Recommendations'} isButtonShown={false}/>
-        <ScrollView
-          horizontal
-          contentContainerStyle={styles.recommendationContainer}
-          style={{ flexDirection: 'row' }}
-          showsHorizontalScrollIndicator={false}>
-          { recommendations.length > 0 ? recommendations.map(item => (
-            <VerticalNewsCard
-              image={{ uri: item.cover_image }}
-              headline={item.title}
-              timestamp={item.published_on}
-              onPress={() => navigateToArticle(navigation, item.id, item.slug)}
-            />
-          )) : <LoadingScreen containerHeight={verticalScale(240)} containerWidth={screenWidth}/>}
-        </ScrollView>
+        {recommendations.length > 0 ? <><SectionHeader label={'Recommendations'} isButtonShown={false} />
+          <ScrollView
+            horizontal
+            contentContainerStyle={styles.recommendationContainer}
+            style={{ flexDirection: 'row' }}
+            showsHorizontalScrollIndicator={false}>
+            {recommendations.map(item => (
+              <VerticalNewsCard
+                image={{ uri: item.cover_image }}
+                headline={item.title}
+                timestamp={item.published_on}
+                onPress={() => navigateToArticle(navigation, item.id, item.slug)}
+              />
+            ))}
+          </ScrollView></> : <></>}
       </ScrollView>
       </ScrollView>
     </BottomSheetModalProvider>
     </BottomSheetModalProvider>
   );
   );