diff --git a/src/components/postsList/container/postsListContainer.tsx b/src/components/postsList/container/postsListContainer.tsx index 9f5341e8b..09e5a0c01 100644 --- a/src/components/postsList/container/postsListContainer.tsx +++ b/src/components/postsList/container/postsListContainer.tsx @@ -3,7 +3,6 @@ import { get } from 'lodash'; import { FlatListProps, FlatList, RefreshControl, ActivityIndicator, View } from 'react-native'; import { useSelector } from 'react-redux'; import PostCard from '../../postCard'; -import { ThemeContainer } from '../../../containers'; import styles from '../view/postsListStyles'; export interface PostsListRef { @@ -40,6 +39,7 @@ const postsListContainer = ( const [imageHeights, setImageHeights] = useState(new Map()); const isHideImages = useSelector((state) => state.application.hidePostsThumbnails); + const isDarkTheme = useSelector((state) => state.application.isDarkThem); const posts = useSelector((state) => { return isFeedScreen ? state.posts.feedPosts : state.posts.otherPosts; }); @@ -152,48 +152,46 @@ const postsListContainer = ( ); } return e; - } + }}; return ( - - {({ isDarkTheme }) => ( - `${content.author}/${content.permlink}-${index}`} - removeClippedSubviews - onEndReachedThreshold={1} - maxToRenderPerBatch={3} - initialNumToRender={3} - windowSize={5} - extraData={imageHeights} - onEndReached={_onEndReached} - onMomentumScrollBegin={() => { - _onEndReachedCalledDuringMomentum = false; + + `${content.author}/${content.permlink}-${index}`} + removeClippedSubviews + onEndReachedThreshold={1} + maxToRenderPerBatch={3} + initialNumToRender={3} + windowSize={5} + extraData={imageHeights} + onEndReached={_onEndReached} + onMomentumScrollBegin={() => { + _onEndReachedCalledDuringMomentum = false; + }} + ListFooterComponent={_renderFooter} + refreshControl={ + { + if (onLoadPosts) { + onLoadPosts(true); + } }} - ListFooterComponent={_renderFooter} - refreshControl={ - { - if (onLoadPosts) { - onLoadPosts(true); - } - }} - progressBackgroundColor="#357CE6" - tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'} - titleColor="#fff" - colors={['#fff']} - /> - } - {...props} + progressBackgroundColor="#357CE6" + tintColor={!isDarkTheme ? '#357ce6' : '#96c0ff'} + titleColor="#fff" + colors={['#fff']} /> - )} - + } + {...props} + /> + ); }; -}; + export default forwardRef(postsListContainer); diff --git a/src/components/tabbedPosts/container/tabbedPosts.tsx b/src/components/tabbedPosts/container/tabbedPosts.tsx index d7e311053..c9a933adf 100644 --- a/src/components/tabbedPosts/container/tabbedPosts.tsx +++ b/src/components/tabbedPosts/container/tabbedPosts.tsx @@ -19,56 +19,57 @@ export const TabbedPosts = ({ stackedTabs, onTabChange, ...props -}:TabbedPostsProps) => { +}: TabbedPostsProps) => { //initialize state const [initialTabIndex] = useState(selectedOptionIndex == 0 && stackedTabs ? filterOptions.length : selectedOptionIndex) - const mainFilters = filterOptions.map((label, index)=>({ - filterKey:filterOptionsValue[index], - label - } as TabItem)); + const mainFilters = filterOptions.map((label, index) => ({ + filterKey: filterOptionsValue[index], + label + } as TabItem)); const subFilters = feedSubfilterOptions - ? feedSubfilterOptions.map((label, index)=>({ - filterKey:feedSubfilterOptionsValue[index], + ? feedSubfilterOptions.map((label, index) => ({ + filterKey: feedSubfilterOptionsValue[index], label } as TabItem)) : []; const combinedFilters = [...mainFilters, ...subFilters] - + const [selectedFilter, setSelectedFilter] = useState(combinedFilters[initialTabIndex].filterKey) - const [filterScrollRequest, createFilterScrollRequest] = useState(null) + const [filterScrollRequest, createFilterScrollRequest] = useState(null) - //components actions - const _onFilterSelect = (filter:string) => { - if(filter === selectedFilter){ - createFilterScrollRequest(selectedFilter) - }else{ - setSelectedFilter(filter) - } + //components actions + const _onFilterSelect = (filter: string) => { + if (filter === selectedFilter) { + createFilterScrollRequest(selectedFilter) + } else { + setSelectedFilter(filter) } + } - const _onScrollRequestProcessed = () => { - createFilterScrollRequest(null); - } + const _onScrollRequestProcessed = () => { + createFilterScrollRequest(null); + } //initialize first set of pages - const pages = combinedFilters.map((filter, index)=>{ - if(tabContentOverrides && tabContentOverrides.has(index)){ + const pages = combinedFilters.map((filter, index) => { + if (tabContentOverrides && tabContentOverrides.has(index)) { return tabContentOverrides.get(index); } - return ( + + return ( { return ( - + > {pages} ); diff --git a/src/screens/application/children/applicationScreen.tsx b/src/screens/application/children/applicationScreen.tsx index a6d2d9278..0ff5cd3a6 100644 --- a/src/screens/application/children/applicationScreen.tsx +++ b/src/screens/application/children/applicationScreen.tsx @@ -1,5 +1,5 @@ import React, { Component, Fragment } from 'react'; -import { StatusBar, Platform, View, Alert, Text } from 'react-native'; +import { StatusBar, Platform, View, Alert } from 'react-native'; import EStyleSheet from 'react-native-extended-stylesheet'; import { connect } from 'react-redux'; @@ -116,9 +116,7 @@ class ApplicationScreen extends Component { {!isConnected && } - {/* */} - {/* I am working though */} - {/* */} + ); } diff --git a/src/screens/feed/screen/feedScreen.tsx b/src/screens/feed/screen/feedScreen.tsx index 5141afa7e..432422ed2 100644 --- a/src/screens/feed/screen/feedScreen.tsx +++ b/src/screens/feed/screen/feedScreen.tsx @@ -1,5 +1,5 @@ import React, { Fragment, useState } from 'react'; -import { SafeAreaView } from 'react-native'; +import { View, Text } from 'react-native'; import get from 'lodash/get'; // Components @@ -36,7 +36,8 @@ const FeedScreen = () => { {({ currentAccount }) => (
- + + {lazyLoad && ( { pageType="main" /> )} - + )}