mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-18 10:52:16 +03:00
using default and map funcitons instead of raw imports
This commit is contained in:
parent
e0a3dddd3a
commit
acf4fab4bf
@ -11,7 +11,7 @@ import CommunityContainer from '../container/communityContainer';
|
||||
// Styles
|
||||
import styles from './communityStyles';
|
||||
|
||||
import { COMMUNITY_SCREEN_FILTER_MAP } from '../../../constants/options/filters';
|
||||
import { getDefaultFilters, getFilterMap } from '../../../constants/options/filters';
|
||||
import { useAppSelector } from '../../../hooks';
|
||||
|
||||
const CommunityScreen = ({ navigation }) => {
|
||||
@ -20,8 +20,8 @@ const CommunityScreen = ({ navigation }) => {
|
||||
|
||||
const intl = useIntl();
|
||||
|
||||
const communityTabs = useAppSelector((state) => state.customTabs.communityTabs);
|
||||
const filterOptions = communityTabs.map((key) => COMMUNITY_SCREEN_FILTER_MAP[key]);
|
||||
const communityTabs = useAppSelector((state) => state.customTabs.communityTabs || getDefaultFilters('community'));
|
||||
const filterOptions = communityTabs.map((key) => getFilterMap('community')[key]);
|
||||
|
||||
const _getSelectedIndex = () => {
|
||||
if (filter) {
|
||||
|
@ -13,15 +13,15 @@ import { AccountContainer } from '../../../containers';
|
||||
import styles from './feedStyles';
|
||||
|
||||
import {
|
||||
FEED_SCREEN_FILTER_MAP,
|
||||
DEFAULT_FEED_FILTERS,
|
||||
getDefaultFilters, getFilterMap,
|
||||
} from '../../../constants/options/filters';
|
||||
|
||||
import { useAppSelector } from '../../../hooks';
|
||||
|
||||
const FeedScreen = () => {
|
||||
|
||||
const mainTabs = useAppSelector((state) => state.customTabs.mainTabs || DEFAULT_FEED_FILTERS);
|
||||
const filterOptions = mainTabs.map((key) => FEED_SCREEN_FILTER_MAP[key]);
|
||||
const mainTabs = useAppSelector((state) => state.customTabs.mainTabs || getDefaultFilters('main'));
|
||||
const filterOptions = mainTabs.map((key) => getFilterMap('main')[key]);
|
||||
|
||||
return (
|
||||
<AccountContainer>
|
||||
|
Loading…
Reference in New Issue
Block a user