2019-12-12 19:50:58 +03:00
|
|
|
import React from 'react';
|
2019-10-04 18:56:22 +03:00
|
|
|
import { createSwitchNavigator } from 'react-navigation';
|
2019-12-12 19:50:58 +03:00
|
|
|
import { createBottomTabNavigator } from 'react-navigation-tabs';
|
2019-10-04 18:56:22 +03:00
|
|
|
import { createDrawerNavigator } from 'react-navigation-drawer';
|
|
|
|
import { createStackNavigator } from 'react-navigation-stack';
|
2018-10-04 05:18:36 +03:00
|
|
|
|
2019-12-12 19:50:58 +03:00
|
|
|
// Constants
|
2019-10-04 18:56:22 +03:00
|
|
|
import ROUTES from '../constants/routeNames';
|
2019-12-12 19:50:58 +03:00
|
|
|
import scalePx from '../utils/scalePx';
|
|
|
|
|
|
|
|
// Components
|
|
|
|
import { Icon, IconContainer } from '../components/icon';
|
|
|
|
import { PostButton, BottomTabBar, SideMenu } from '../components';
|
|
|
|
|
2018-10-05 06:42:27 +03:00
|
|
|
// Screens
|
2018-10-13 17:05:42 +03:00
|
|
|
import {
|
2019-01-10 12:05:58 +03:00
|
|
|
Bookmarks,
|
2019-09-04 22:17:39 +03:00
|
|
|
Boost,
|
2019-01-08 15:08:01 +03:00
|
|
|
Drafts,
|
2018-11-01 19:01:19 +03:00
|
|
|
Editor,
|
2019-12-12 19:50:58 +03:00
|
|
|
Feed,
|
2018-11-18 01:48:18 +03:00
|
|
|
Follows,
|
2018-10-31 11:54:33 +03:00
|
|
|
Login,
|
2019-12-12 19:50:58 +03:00
|
|
|
Notification,
|
2018-10-31 11:54:33 +03:00
|
|
|
Post,
|
2018-11-01 19:01:19 +03:00
|
|
|
Profile,
|
2019-09-04 22:17:39 +03:00
|
|
|
ProfileEdit,
|
|
|
|
Reblogs,
|
2019-09-12 23:01:12 +03:00
|
|
|
Redeem,
|
2020-05-02 19:35:08 +03:00
|
|
|
Register,
|
2019-09-04 22:17:39 +03:00
|
|
|
SearchResult,
|
2018-11-18 01:48:18 +03:00
|
|
|
Settings,
|
2019-12-12 23:26:38 +03:00
|
|
|
SpinGame,
|
2019-04-11 12:05:13 +03:00
|
|
|
Transfer,
|
2019-09-04 22:17:39 +03:00
|
|
|
Voters,
|
2019-12-12 19:50:58 +03:00
|
|
|
Wallet,
|
2020-03-28 15:49:59 +03:00
|
|
|
AccountBoost,
|
2020-07-14 12:38:39 +03:00
|
|
|
TagResult,
|
2020-07-15 21:11:16 +03:00
|
|
|
Community,
|
2021-01-13 20:23:16 +03:00
|
|
|
Communities,
|
2021-06-11 16:18:42 +03:00
|
|
|
WebBrowser,
|
2022-02-11 06:04:27 +03:00
|
|
|
ReferScreen,
|
2022-02-13 11:54:23 +03:00
|
|
|
CoinDetails,
|
2022-04-26 11:56:17 +03:00
|
|
|
EditHistoryScreen,
|
2018-10-13 17:05:42 +03:00
|
|
|
} from '../screens';
|
2018-10-04 05:18:36 +03:00
|
|
|
|
2019-12-12 19:50:58 +03:00
|
|
|
const bottomTabNavigator = createBottomTabNavigator(
|
2018-10-05 06:42:27 +03:00
|
|
|
{
|
2019-12-12 19:50:58 +03:00
|
|
|
[ROUTES.TABBAR.FEED]: {
|
|
|
|
screen: Feed,
|
|
|
|
navigationOptions: () => ({
|
|
|
|
tabBarIcon: ({ tintColor }) => (
|
2020-08-07 08:47:20 +03:00
|
|
|
<Icon
|
|
|
|
iconType="MaterialIcons"
|
|
|
|
style={{ padding: 15 }}
|
|
|
|
name="view-day"
|
|
|
|
color={tintColor}
|
|
|
|
size={scalePx(26)}
|
|
|
|
/>
|
2019-12-12 19:50:58 +03:00
|
|
|
),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
[ROUTES.TABBAR.NOTIFICATION]: {
|
|
|
|
screen: Notification,
|
|
|
|
navigationOptions: () => ({
|
|
|
|
tabBarIcon: ({ tintColor }) => (
|
|
|
|
<IconContainer
|
|
|
|
isBadge
|
|
|
|
badgeType="notification"
|
|
|
|
iconType="MaterialIcons"
|
2020-08-07 08:47:20 +03:00
|
|
|
style={{ padding: 15 }}
|
2019-12-12 19:50:58 +03:00
|
|
|
name="notifications"
|
|
|
|
color={tintColor}
|
|
|
|
size={scalePx(26)}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
[ROUTES.TABBAR.POST_BUTTON]: {
|
|
|
|
screen: () => null,
|
|
|
|
navigationOptions: {
|
2020-08-07 10:42:23 +03:00
|
|
|
tabBarIcon: () => <PostButton />,
|
2019-12-12 19:50:58 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
[ROUTES.TABBAR.WALLET]: {
|
|
|
|
screen: Wallet,
|
|
|
|
navigationOptions: () => ({
|
|
|
|
tabBarIcon: ({ tintColor }) => (
|
|
|
|
<Icon
|
|
|
|
iconType="MaterialIcons"
|
2020-08-07 08:47:20 +03:00
|
|
|
style={{ padding: 15 }}
|
2019-12-12 19:50:58 +03:00
|
|
|
name="account-balance-wallet"
|
|
|
|
color={tintColor}
|
|
|
|
size={scalePx(26)}
|
|
|
|
/>
|
|
|
|
),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
[ROUTES.TABBAR.PROFILE]: {
|
|
|
|
screen: Profile,
|
|
|
|
navigationOptions: () => ({
|
|
|
|
tabBarIcon: ({ tintColor }) => (
|
2020-08-07 08:47:20 +03:00
|
|
|
<Icon
|
|
|
|
iconType="MaterialIcons"
|
|
|
|
style={{ padding: 15 }}
|
|
|
|
name="person"
|
|
|
|
color={tintColor}
|
|
|
|
size={scalePx(26)}
|
|
|
|
/>
|
2019-12-12 19:50:58 +03:00
|
|
|
),
|
|
|
|
}),
|
2018-10-26 15:34:45 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-03-24 13:52:23 +03:00
|
|
|
tabBarComponent: (props) => <BottomTabBar {...props} />,
|
2019-12-12 19:50:58 +03:00
|
|
|
tabBarOptions: {
|
|
|
|
showLabel: false,
|
2020-08-07 08:47:20 +03:00
|
|
|
activeTintColor: '#357ce6',
|
2019-12-12 19:50:58 +03:00
|
|
|
inactiveTintColor: '#c1c5c7',
|
|
|
|
},
|
2018-10-26 15:34:45 +03:00
|
|
|
},
|
|
|
|
);
|
|
|
|
|
2019-12-12 19:50:58 +03:00
|
|
|
const mainNavigation = createDrawerNavigator(
|
|
|
|
{ [ROUTES.SCREENS.FEED]: { screen: bottomTabNavigator } },
|
|
|
|
{ contentComponent: SideMenu },
|
|
|
|
);
|
|
|
|
|
2019-09-26 00:31:30 +03:00
|
|
|
const stackNavigator = createStackNavigator(
|
2018-10-26 15:34:45 +03:00
|
|
|
{
|
2019-12-12 19:50:58 +03:00
|
|
|
[ROUTES.DRAWER.MAIN]: { screen: mainNavigation },
|
|
|
|
[ROUTES.SCREENS.PROFILE]: { screen: Profile },
|
|
|
|
[ROUTES.SCREENS.PROFILE_EDIT]: { screen: ProfileEdit },
|
2020-01-11 13:08:26 +03:00
|
|
|
[ROUTES.SCREENS.POST]: {
|
|
|
|
screen: Post,
|
|
|
|
navigationOptions: {
|
|
|
|
gesturesEnabled: true,
|
2020-01-30 14:53:39 +03:00
|
|
|
gestureResponseDistance: { horizontal: 70 },
|
2020-01-11 13:08:26 +03:00
|
|
|
},
|
|
|
|
},
|
2019-12-12 19:50:58 +03:00
|
|
|
[ROUTES.SCREENS.EDITOR]: { screen: Editor },
|
|
|
|
[ROUTES.SCREENS.VOTERS]: { screen: Voters },
|
|
|
|
[ROUTES.SCREENS.FOLLOWS]: { screen: Follows },
|
|
|
|
[ROUTES.SCREENS.SETTINGS]: { screen: Settings },
|
|
|
|
[ROUTES.SCREENS.DRAFTS]: { screen: Drafts },
|
|
|
|
[ROUTES.SCREENS.BOOKMARKS]: { screen: Bookmarks },
|
|
|
|
[ROUTES.SCREENS.SEARCH_RESULT]: { screen: SearchResult },
|
2020-07-14 12:38:39 +03:00
|
|
|
[ROUTES.SCREENS.TAG_RESULT]: { screen: TagResult },
|
2019-12-12 19:50:58 +03:00
|
|
|
[ROUTES.SCREENS.TRANSFER]: { screen: Transfer },
|
|
|
|
[ROUTES.SCREENS.BOOST]: { screen: Boost },
|
|
|
|
[ROUTES.SCREENS.REDEEM]: { screen: Redeem },
|
|
|
|
[ROUTES.SCREENS.REBLOGS]: { screen: Reblogs },
|
|
|
|
[ROUTES.SCREENS.SPIN_GAME]: { screen: SpinGame },
|
2020-03-28 15:49:59 +03:00
|
|
|
[ROUTES.SCREENS.ACCOUNT_BOOST]: { screen: AccountBoost },
|
2020-07-15 21:11:16 +03:00
|
|
|
[ROUTES.SCREENS.COMMUNITY]: { screen: Community },
|
2021-01-13 20:23:16 +03:00
|
|
|
[ROUTES.SCREENS.COMMUNITIES]: { screen: Communities },
|
2021-06-11 16:18:42 +03:00
|
|
|
[ROUTES.SCREENS.WEB_BROWSER]: { screen: WebBrowser },
|
2022-02-11 06:04:27 +03:00
|
|
|
[ROUTES.SCREENS.REFER]: { screen: ReferScreen },
|
2022-02-13 11:54:23 +03:00
|
|
|
[ROUTES.SCREENS.COIN_DETAILS]: { screen: CoinDetails },
|
2022-04-26 11:56:17 +03:00
|
|
|
[ROUTES.SCREENS.EDIT_HISTORY]: { screen: EditHistoryScreen },
|
2018-10-05 06:42:27 +03:00
|
|
|
},
|
2020-01-11 13:08:26 +03:00
|
|
|
{
|
|
|
|
headerMode: 'none',
|
|
|
|
},
|
2018-10-05 06:42:27 +03:00
|
|
|
);
|
2018-10-06 06:33:03 +03:00
|
|
|
|
2018-10-30 00:38:48 +03:00
|
|
|
export default createSwitchNavigator({
|
2019-09-26 00:31:30 +03:00
|
|
|
stackNavigator,
|
2020-05-02 19:35:08 +03:00
|
|
|
[ROUTES.SCREENS.REGISTER]: { screen: Register },
|
2019-07-12 11:39:25 +03:00
|
|
|
[ROUTES.SCREENS.LOGIN]: { screen: Login },
|
2018-10-06 06:33:03 +03:00
|
|
|
});
|