|
@@ -7,7 +7,7 @@ import {
|
|
Image,
|
|
Image,
|
|
Linking,
|
|
Linking,
|
|
} from 'react-native';
|
|
} from 'react-native';
|
|
-import React, {useCallback} from 'react';
|
|
|
|
|
|
+import React, { useCallback } from 'react';
|
|
import NewscoutTitleHeader from '../../components/molecules/Header/NewscoutTitleHeader';
|
|
import NewscoutTitleHeader from '../../components/molecules/Header/NewscoutTitleHeader';
|
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
|
|
import MaterialIcon from 'react-native-vector-icons/MaterialIcons';
|
|
import colors from '../../constants/colors';
|
|
import colors from '../../constants/colors';
|
|
@@ -41,10 +41,12 @@ import ButtonWrapper from '../../components/atoms/Buttons/ButtonWrapper';
|
|
import images from '../../assets/images/images';
|
|
import images from '../../assets/images/images';
|
|
import SectionHeader from '../../components/molecules/Header/SectionHeader';
|
|
import SectionHeader from '../../components/molecules/Header/SectionHeader';
|
|
import VerticalNewsCard from '../../components/molecules/Cards/VerticalNewsCard';
|
|
import VerticalNewsCard from '../../components/molecules/Cards/VerticalNewsCard';
|
|
|
|
+import { TextInput } from 'react-native-paper';
|
|
|
|
+import FormTextInput from '../../components/atoms/Input/FormTextInput';
|
|
|
|
|
|
const NewsDetailPage = props => {
|
|
const NewsDetailPage = props => {
|
|
- const {navigation, route} = props;
|
|
|
|
- const {id, slug} = route.params;
|
|
|
|
|
|
+ const { navigation, route } = props;
|
|
|
|
+ const { id, slug } = route.params;
|
|
|
|
|
|
const [isLoading, setLoading] = React.useState(true);
|
|
const [isLoading, setLoading] = React.useState(true);
|
|
const [article, setArticle] = React.useState({});
|
|
const [article, setArticle] = React.useState({});
|
|
@@ -99,8 +101,8 @@ const NewsDetailPage = props => {
|
|
});
|
|
});
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
const styles = StyleSheet.create({
|
|
- container: {backgroundColor: colors().dominant, minHeight: '100%'},
|
|
|
|
- newsContainer: {paddingHorizontal: horizontalScale(16)},
|
|
|
|
|
|
+ container: { backgroundColor: colors().dominant, minHeight: '100%' },
|
|
|
|
+ newsContainer: { paddingHorizontal: horizontalScale(16) },
|
|
newsTitle: {
|
|
newsTitle: {
|
|
fontFamily: fonts.type.semibold,
|
|
fontFamily: fonts.type.semibold,
|
|
color: colors().recessive,
|
|
color: colors().recessive,
|
|
@@ -155,12 +157,17 @@ const NewsDetailPage = props => {
|
|
width: 42,
|
|
width: 42,
|
|
borderRadius: 32,
|
|
borderRadius: 32,
|
|
marginRight: horizontalScale(16),
|
|
marginRight: horizontalScale(16),
|
|
|
|
+ marginVertical: verticalScale(8),
|
|
|
|
+ backgroundColor: colors().primaryColor
|
|
},
|
|
},
|
|
commentInput: {
|
|
commentInput: {
|
|
- paddingVertical: verticalScale(16),
|
|
|
|
- alignItems: 'center',
|
|
|
|
- justifyContent: 'flex-start',
|
|
|
|
|
|
+ marginVertical: verticalScale(16),
|
|
|
|
+ alignItems:'stretch',
|
|
|
|
+ // backgroundColor: colors().black_variant,
|
|
flexDirection: 'row',
|
|
flexDirection: 'row',
|
|
|
|
+ flex: 1
|
|
|
|
+ // paddingVertical: verticalScale(16)
|
|
|
|
+ // width:'100%'
|
|
},
|
|
},
|
|
utilButtons: {
|
|
utilButtons: {
|
|
flexDirection: 'row',
|
|
flexDirection: 'row',
|
|
@@ -222,7 +229,7 @@ const NewsDetailPage = props => {
|
|
<Text style={styles.newsDescriptor}>{article.source}</Text>
|
|
<Text style={styles.newsDescriptor}>{article.source}</Text>
|
|
</View>
|
|
</View>
|
|
<View style={styles.imagesContainer}>
|
|
<View style={styles.imagesContainer}>
|
|
- <Image source={{uri: article.cover_image}} style={styles.image} />
|
|
|
|
|
|
+ <Image source={{ uri: article.cover_image }} style={styles.image} />
|
|
</View>
|
|
</View>
|
|
<View style={styles.utilButtons}>
|
|
<View style={styles.utilButtons}>
|
|
<TouchableWithoutFeedback onPress={handlePresentModalPress}>
|
|
<TouchableWithoutFeedback onPress={handlePresentModalPress}>
|
|
@@ -237,7 +244,7 @@ const NewsDetailPage = props => {
|
|
</Text>
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
</TouchableWithoutFeedback>
|
|
</TouchableWithoutFeedback>
|
|
- <View style={{flexDirection: 'row'}}>
|
|
|
|
|
|
+ <View style={{ flexDirection: 'row' }}>
|
|
<BookmarkButton
|
|
<BookmarkButton
|
|
buttonStyle={styles.buttonStyle}
|
|
buttonStyle={styles.buttonStyle}
|
|
iconSize={20}
|
|
iconSize={20}
|
|
@@ -273,8 +280,8 @@ const NewsDetailPage = props => {
|
|
minHeight: '100%',
|
|
minHeight: '100%',
|
|
}}
|
|
}}
|
|
handleStyle={{
|
|
handleStyle={{
|
|
- backgroundColor: colors().dominant_variant,
|
|
|
|
-
|
|
|
|
|
|
+ backgroundColor: colors().dominant,
|
|
|
|
+
|
|
}}>
|
|
}}>
|
|
<BottomSheetScrollView>
|
|
<BottomSheetScrollView>
|
|
<BottomSheetView
|
|
<BottomSheetView
|
|
@@ -298,13 +305,44 @@ const NewsDetailPage = props => {
|
|
/>
|
|
/>
|
|
</ButtonWrapper>
|
|
</ButtonWrapper>
|
|
</BottomSheetView>
|
|
</BottomSheetView>
|
|
- <View style={styles.commentInput}>
|
|
|
|
|
|
+ <BottomSheetView style={styles.commentInput}>
|
|
<Image
|
|
<Image
|
|
source={images.imageCard}
|
|
source={images.imageCard}
|
|
style={[styles.profileImage]}
|
|
style={[styles.profileImage]}
|
|
/>
|
|
/>
|
|
- <Text>Comment Text Input</Text>
|
|
|
|
- </View>
|
|
|
|
|
|
+ {/* <View style={{}}> */}
|
|
|
|
+ <TextInput
|
|
|
|
+ multiline
|
|
|
|
+ mode="outlined"
|
|
|
|
+ placeholder='Add your Comment Here'
|
|
|
|
+ placeholderTextColor={colors().grayShade_400}
|
|
|
|
+ dense
|
|
|
|
+ style={{
|
|
|
|
+ backgroundColor: colors().dominant,
|
|
|
|
+ height: verticalScale(64),
|
|
|
|
+ // justifyContent:'',
|
|
|
|
+ flexGrow: 1
|
|
|
|
+
|
|
|
|
+ }}
|
|
|
|
+ contentStyle={{
|
|
|
|
+ color: colors().recessive,
|
|
|
|
+ fontFamily: fonts.type.regular,
|
|
|
|
+ fontSize: moderateScale(16),
|
|
|
|
+
|
|
|
|
+ }}
|
|
|
|
+ outlineStyle={{
|
|
|
|
+ borderRadius: moderateScale(16),
|
|
|
|
+ borderColor: colors().secondaryColor
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // borderColor: colors().dominant,
|
|
|
|
+ }}
|
|
|
|
+ cursorColor={colors().primaryColor}
|
|
|
|
+ />
|
|
|
|
+ {/* <FormTextInput/> */}
|
|
|
|
+ {/* </View> */}
|
|
|
|
+
|
|
|
|
+ </BottomSheetView>
|
|
<>
|
|
<>
|
|
<Text
|
|
<Text
|
|
style={{
|
|
style={{
|
|
@@ -315,7 +353,7 @@ const NewsDetailPage = props => {
|
|
View all Comments({comments.results.length})
|
|
View all Comments({comments.results.length})
|
|
</Text>
|
|
</Text>
|
|
</>
|
|
</>
|
|
- <BottomSheetView style={{gap: moderateScale(16)}}>
|
|
|
|
|
|
+ <BottomSheetView style={{ gap: moderateScale(16) }}>
|
|
{comments.results.length <= 0 ? (
|
|
{comments.results.length <= 0 ? (
|
|
<LoadingScreen />
|
|
<LoadingScreen />
|
|
) : (
|
|
) : (
|
|
@@ -332,11 +370,11 @@ const NewsDetailPage = props => {
|
|
<ScrollView
|
|
<ScrollView
|
|
horizontal
|
|
horizontal
|
|
contentContainerStyle={styles.recommendationContainer}
|
|
contentContainerStyle={styles.recommendationContainer}
|
|
- style={{flexDirection: 'row'}}
|
|
|
|
|
|
+ style={{ flexDirection: 'row' }}
|
|
showsHorizontalScrollIndicator={false}>
|
|
showsHorizontalScrollIndicator={false}>
|
|
{recommendations.map(item => (
|
|
{recommendations.map(item => (
|
|
<VerticalNewsCard
|
|
<VerticalNewsCard
|
|
- image={{uri: item.cover_image}}
|
|
|
|
|
|
+ image={{ uri: item.cover_image }}
|
|
headline={item.title}
|
|
headline={item.title}
|
|
onPress={() => navigateToArticle(navigation, item.id, item.slug)}
|
|
onPress={() => navigateToArticle(navigation, item.id, item.slug)}
|
|
/>
|
|
/>
|