Compare commits

..

18 Commits

Author SHA1 Message Date
osdnk
01277575f2 chore: publish
- @react-navigation/bottom-tabs@5.0.0-alpha.14
 - @react-navigation/compat@5.0.0-alpha.8
 - @react-navigation/core@5.0.0-alpha.15
 - @react-navigation/drawer@5.0.0-alpha.14
 - @react-navigation/example@5.0.0-alpha.13
 - @react-navigation/material-bottom-tabs@5.0.0-alpha.13
 - @react-navigation/material-top-tabs@5.0.0-alpha.12
 - @react-navigation/native-stack@5.0.0-alpha.1
 - @react-navigation/native@5.0.0-alpha.12
 - @react-navigation/stack@5.0.0-alpha.25
2019-10-15 16:08:48 +02:00
Michał Osadnik
386d1c0888 fix: block GH interactions in Native Stack example (#126) 2019-10-15 14:28:39 +02:00
satyajit.happy
9d9fe31f02 fix: don't ignore descriptors change 2019-10-15 14:17:49 +02:00
satyajit.happy
0a5fb3e268 fix: fix content component not rendering in drawer 2019-10-11 18:20:56 +02:00
satyajit.happy
1d7a37cd4a chore: fix minor typo 2019-10-11 18:05:32 +02:00
satyajit.happy
2b57702a62 fix: add flex: 1 to drawer content 2019-10-11 17:49:15 +02:00
satyajit.happy
c7da1e4145 fix: increase hitSlop of back button on Android 2019-10-11 13:39:29 +02:00
satyajit.happy
6a0ca90873 feat: add a headerTitleAlign option to center or left align title 2019-10-11 13:38:53 +02:00
osdnk
e9a1cfcec3 chore: bump screens 2019-10-11 13:26:52 +02:00
satyajit.happy
b71f4e52a3 fix: update supported options for native stack 2019-10-11 13:12:39 +02:00
satyajit.happy
9ce8ec59fb refactor: refresh drawer according to latest material design guidelines 2019-10-11 00:54:22 +02:00
satyajit.happy
d685e78fa9 refactor: change tintColor argument to just color 2019-10-11 00:40:39 +02:00
satyajit.happy
7a901af5b5 fix: make it possible to run the example on web 2019-10-11 00:28:38 +02:00
Michał Osadnik
ba3f718ab3 feat: initial version of native stack (#102) 2019-10-10 23:39:04 +02:00
satyajit.happy
42beb660ca fix: improve keyboard handling with bottom tab bar 2019-10-10 14:50:42 +02:00
Satyajit Sahoo
e789846692 fix: make modal presentation mode fullscreen on landscape (#124) 2019-10-08 15:50:52 +02:00
osdnk
b32cda2446 fix: interpolation in iOS modal presentation 2019-10-08 13:01:15 +02:00
satyajit.happy
708dde0e47 feat: export TransitionSpecs 2019-10-07 17:43:37 +02:00
74 changed files with 1674 additions and 664 deletions

View File

@@ -8,6 +8,7 @@
"@react-navigation/routers",
"@react-navigation/compat",
"@react-navigation/stack",
"@react-navigation/native-stack",
"@react-navigation/drawer",
"@react-navigation/bottom-tabs",
"@react-navigation/material-top-tabs",

2
.gitignore vendored
View File

@@ -5,6 +5,8 @@
.expo
.gradle
local.properties
/coverage/
/types/
/dist/

View File

@@ -41,8 +41,8 @@
"typescript": "^3.6.3"
},
"resolutions": {
"react": "16.8.3",
"react-native": "0.59.10"
"react": "~16.8.3",
"react-native": "~0.59.10"
},
"husky": {
"hooks": {

View File

@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.14](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/bottom-tabs@5.0.0-alpha.13...@react-navigation/bottom-tabs@5.0.0-alpha.14) (2019-10-15)
### Bug Fixes
* improve keyboard handling with bottom tab bar ([42beb66](https://github.com/react-navigation/navigation-ex/commit/42beb66))
* make it possible to run the example on web ([7a901af](https://github.com/react-navigation/navigation-ex/commit/7a901af))
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.13](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/bottom-tabs@5.0.0-alpha.12...@react-navigation/bottom-tabs@5.0.0-alpha.13) (2019-10-06)
**Note:** Version bump only for package @react-navigation/bottom-tabs

View File

@@ -37,8 +37,13 @@ cd ..
## Usage
```js
import { MaterialCommunityIcons } from 'react-native-vector-icons';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
const getTabBarIcon = name => ({ color, size }) => (
<MaterialCommunityIcons name={name} color={color} size={size} />
);
const BottomTabs = createBottomTabNavigator();
export default function App() {
@@ -49,7 +54,7 @@ export default function App() {
component={Article}
options={{
tabBarLabel: 'Article',
tabBarIcon: 'chrome-reader-mode',
tabBarIcon: getTabBarIcon('file-document-box'),
}}
/>
<BottomTabs.Screen
@@ -57,7 +62,7 @@ export default function App() {
component={Chat}
options={{
tabBarLabel: 'Chat',
tabBarIcon: 'chat-bubble',
tabBarIcon: getTabBarIcon('message-reply'),
}}
/>
<BottomTabs.Screen
@@ -65,7 +70,7 @@ export default function App() {
component={Contacts}
options={{
tabBarLabel: 'Contacts',
tabBarIcon: 'contacts',
tabBarIcon: getTabBarIcon('contacts'),
}}
/>
</BottomTabs.Navigator>

View File

@@ -10,7 +10,7 @@
"android",
"tab"
],
"version": "5.0.0-alpha.13",
"version": "5.0.0-alpha.14",
"license": "MIT",
"repository": {
"type": "git",
@@ -40,8 +40,8 @@
"@types/react": "^16.9.4",
"@types/react-native": "^0.60.17",
"del-cli": "^3.0.0",
"react": "16.8.3",
"react-native": "0.59.10",
"react": "~16.8.3",
"react-native": "~0.59.10",
"react-native-safe-area-context": "^0.3.6",
"typescript": "^3.6.3"
},

View File

@@ -66,26 +66,26 @@ export type BottomTabNavigationOptions = {
/**
* Title string of a tab displayed in the tab bar or React Element
* or a function that given { focused: boolean, tintColor: string } returns a React.Node, to display in tab bar.
* or a function that given { focused: boolean, color: string } returns a React.Node, to display in tab bar.
* When undefined, scene title is used. To hide, see tabBarOptions.showLabel in the previous section.
*/
tabBarLabel?:
| React.ReactNode
| ((props: {
focused: boolean;
tintColor: string;
horizontal: boolean;
color: string;
size: number;
}) => React.ReactNode);
/**
* React Element or a function that given { focused: boolean, tintColor: string } returns a React.Node, to display in the tab bar.
* React Element or a function that given { focused: boolean, color: string } returns a React.Node, to display in the tab bar.
*/
tabBarIcon?:
| React.ReactNode
| ((props: {
focused: boolean;
tintColor: string;
horizontal: boolean;
color: string;
size: number;
}) => React.ReactNode);
/**
@@ -139,7 +139,7 @@ export type BottomTabNavigationConfig = {
export type BottomTabBarOptions = {
/**
* Whether the tab bar gets hidden when the keyboard is shown.
* Whether the tab bar gets hidden when the keyboard is shown. Defaults to `false`.
*/
keyboardHidesTabBar?: boolean;
/**
@@ -220,7 +220,7 @@ export type BottomTabBarProps = BottomTabBarOptions & {
}) =>
| ((scene: {
focused: boolean;
tintColor: string;
color: string;
orientation: 'horizontal' | 'vertical';
}) => React.ReactNode | undefined)
| React.ReactNode;
@@ -228,8 +228,8 @@ export type BottomTabBarProps = BottomTabBarOptions & {
renderIcon: (props: {
route: Route<string>;
focused: boolean;
tintColor: string;
horizontal: boolean;
color: string;
size: number;
}) => React.ReactNode;
activeTintColor: string;
inactiveTintColor: string;

View File

@@ -1,5 +1,6 @@
import React from 'react';
import {
View,
Animated,
StyleSheet,
Keyboard,
@@ -32,7 +33,7 @@ const DEFAULT_MAX_TAB_ITEM_WIDTH = 125;
export default class TabBarBottom extends React.Component<Props, State> {
static defaultProps = {
keyboardHidesTabBar: true,
keyboardHidesTabBar: false,
activeTintColor: '#007AFF',
activeBackgroundColor: 'transparent',
inactiveTintColor: '#8E8E93',
@@ -82,7 +83,7 @@ export default class TabBarBottom extends React.Component<Props, State> {
this.setState({ keyboard: true }, () =>
Animated.timing(this.state.visible, {
toValue: 0,
duration: 150,
duration: 200,
useNativeDriver: true,
}).start()
);
@@ -90,10 +91,12 @@ export default class TabBarBottom extends React.Component<Props, State> {
private handleKeyboardHide = () =>
Animated.timing(this.state.visible, {
toValue: 1,
duration: 100,
duration: 250,
useNativeDriver: true,
}).start(() => {
this.setState({ keyboard: false });
}).start(({ finished }) => {
if (finished) {
this.setState({ keyboard: false });
}
});
private handleLayout = (e: LayoutChangeEvent) => {
@@ -134,7 +137,7 @@ export default class TabBarBottom extends React.Component<Props, State> {
const label = this.props.getLabelText({ route });
const horizontal = this.shouldUseHorizontalLabels();
const tintColor = focused ? activeTintColor : inactiveTintColor;
const color = focused ? activeTintColor : inactiveTintColor;
if (typeof label === 'string') {
return (
@@ -142,7 +145,7 @@ export default class TabBarBottom extends React.Component<Props, State> {
numberOfLines={1}
style={[
styles.label,
{ color: tintColor },
{ color },
showIcon && horizontal ? styles.labelBeside : styles.labelBeneath,
labelStyle,
]}
@@ -156,7 +159,7 @@ export default class TabBarBottom extends React.Component<Props, State> {
if (typeof label === 'function') {
return label({
focused,
tintColor,
color,
orientation: horizontal ? 'horizontal' : 'vertical',
});
}
@@ -191,7 +194,7 @@ export default class TabBarBottom extends React.Component<Props, State> {
return (
<TabBarIcon
route={route}
horizontal={horizontal}
size={horizontal ? 17 : 24}
activeOpacity={activeOpacity}
inactiveOpacity={inactiveOpacity}
activeTintColor={activeTintColor}
@@ -305,58 +308,59 @@ export default class TabBarBottom extends React.Component<Props, State> {
pointerEvents={
keyboardHidesTabBar && this.state.keyboard ? 'none' : 'auto'
}
onLayout={this.handleLayout}
>
{routes.map((route, index) => {
const focused = index === state.index;
const scene = { route, focused };
const accessibilityLabel = getAccessibilityLabel({
route,
});
<View style={styles.content} onLayout={this.handleLayout}>
{routes.map((route, index) => {
const focused = index === state.index;
const scene = { route, focused };
const accessibilityLabel = getAccessibilityLabel({
route,
});
const accessibilityRole = getAccessibilityRole({
route,
});
const accessibilityRole = getAccessibilityRole({
route,
});
const accessibilityStates = getAccessibilityStates(scene);
const accessibilityStates = getAccessibilityStates(scene);
const testID = getTestID({ route });
const testID = getTestID({ route });
const backgroundColor = focused
? activeBackgroundColor
: inactiveBackgroundColor;
const backgroundColor = focused
? activeBackgroundColor
: inactiveBackgroundColor;
const ButtonComponent =
getButtonComponent({ route }) ||
TouchableWithoutFeedbackWrapper;
const ButtonComponent =
getButtonComponent({ route }) ||
TouchableWithoutFeedbackWrapper;
return (
<NavigationContext.Provider
key={route.key}
value={descriptors[route.key].navigation}
>
<ButtonComponent
onPress={() => onTabPress({ route })}
onLongPress={() => onTabLongPress({ route })}
testID={testID}
accessibilityLabel={accessibilityLabel}
accessibilityRole={accessibilityRole}
accessibilityStates={accessibilityStates}
style={[
styles.tab,
{ backgroundColor },
this.shouldUseHorizontalLabels()
? styles.tabLandscape
: styles.tabPortrait,
tabStyle,
]}
return (
<NavigationContext.Provider
key={route.key}
value={descriptors[route.key].navigation}
>
{this.renderIcon(scene)}
{this.renderLabel(scene)}
</ButtonComponent>
</NavigationContext.Provider>
);
})}
<ButtonComponent
onPress={() => onTabPress({ route })}
onLongPress={() => onTabLongPress({ route })}
testID={testID}
accessibilityLabel={accessibilityLabel}
accessibilityRole={accessibilityRole}
accessibilityStates={accessibilityStates}
style={[
styles.tab,
{ backgroundColor },
this.shouldUseHorizontalLabels()
? styles.tabLandscape
: styles.tabPortrait,
tabStyle,
]}
>
{this.renderIcon(scene)}
{this.renderLabel(scene)}
</ButtonComponent>
</NavigationContext.Provider>
);
})}
</View>
</Animated.View>
)}
</SafeAreaConsumer>
@@ -375,9 +379,12 @@ const styles = StyleSheet.create({
backgroundColor: '#fff',
borderTopWidth: StyleSheet.hairlineWidth,
borderTopColor: 'rgba(0, 0, 0, .3)',
flexDirection: 'row',
elevation: 8,
},
content: {
flex: 1,
flexDirection: 'row',
},
tab: {
flex: 1,
alignItems: isIos ? 'center' : 'stretch',

View File

@@ -64,13 +64,13 @@ export default class BottomTabView extends React.Component<Props, State> {
private renderIcon = ({
route,
focused,
tintColor,
horizontal,
color,
size,
}: {
route: Route<string>;
focused: boolean;
tintColor: string;
horizontal: boolean;
color: string;
size: number;
}) => {
const { descriptors } = this.props;
const descriptor = descriptors[route.key];
@@ -78,7 +78,7 @@ export default class BottomTabView extends React.Component<Props, State> {
if (options.tabBarIcon) {
return typeof options.tabBarIcon === 'function'
? options.tabBarIcon({ focused, tintColor, horizontal })
? options.tabBarIcon({ focused, color, size })
: options.tabBarIcon;
}

View File

@@ -4,7 +4,7 @@ import { Route } from '@react-navigation/core';
type Props = {
route: Route<string>;
horizontal: boolean;
size: number;
activeOpacity: number;
inactiveOpacity: number;
activeTintColor: string;
@@ -12,8 +12,8 @@ type Props = {
renderIcon: (props: {
route: Route<string>;
focused: boolean;
tintColor: string;
horizontal: boolean;
color: string;
size: number;
}) => React.ReactNode;
style: StyleProp<ViewStyle>;
};
@@ -25,7 +25,7 @@ export default function TabBarIcon({
activeTintColor,
inactiveTintColor,
renderIcon,
horizontal,
size,
style,
}: Props) {
// We render the icon twice at the same position on top of each other:
@@ -36,16 +36,16 @@ export default function TabBarIcon({
{renderIcon({
route,
focused: true,
horizontal,
tintColor: activeTintColor,
size,
color: activeTintColor,
})}
</View>
<View style={[styles.icon, { opacity: inactiveOpacity }]}>
{renderIcon({
route,
focused: false,
horizontal,
tintColor: inactiveTintColor,
size,
color: inactiveTintColor,
})}
</View>
</View>

View File

@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.8](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/compat@5.0.0-alpha.7...@react-navigation/compat@5.0.0-alpha.8) (2019-10-15)
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.7](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/compat@5.0.0-alpha.6...@react-navigation/compat@5.0.0-alpha.7) (2019-10-06)
**Note:** Version bump only for package @react-navigation/compat

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/compat",
"description": "Compatibility layer to write navigator definitions in static configuration format",
"version": "5.0.0-alpha.7",
"version": "5.0.0-alpha.8",
"license": "MIT",
"repository": {
"type": "git",
@@ -28,12 +28,12 @@
},
"devDependencies": {
"@types/react": "^16.9.4",
"react": "^16.8.3",
"react": "~16.8.3",
"typescript": "^3.6.3"
},
"peerDependencies": {
"@react-navigation/core": "^5.0.0-alpha.0",
"react": "^16.8.3"
"react": "~16.8.3"
},
"@react-native-community/bob": {
"source": "src",

View File

@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.15](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/core@5.0.0-alpha.14...@react-navigation/core@5.0.0-alpha.15) (2019-10-15)
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.14](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/core@5.0.0-alpha.13...@react-navigation/core@5.0.0-alpha.14) (2019-10-06)
**Note:** Version bump only for package @react-navigation/core

View File

@@ -6,7 +6,7 @@
"react-native",
"react-navigation"
],
"version": "5.0.0-alpha.14",
"version": "5.0.0-alpha.15",
"license": "MIT",
"repository": {
"type": "git",
@@ -40,13 +40,13 @@
"@types/react": "^16.9.4",
"@types/shortid": "^0.0.29",
"del-cli": "^3.0.0",
"react": "^16.8.3",
"react": "~16.8.3",
"react-native-testing-library": "^1.9.1",
"react-test-renderer": "16.8.3",
"react-test-renderer": "~16.8.3",
"typescript": "^3.6.3"
},
"peerDependencies": {
"react": "^16.8.3"
"react": "~16.8.3"
},
"@react-native-community/bob": {
"source": "src",

View File

@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.14](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/drawer@5.0.0-alpha.13...@react-navigation/drawer@5.0.0-alpha.14) (2019-10-15)
### Bug Fixes
* add flex: 1 to drawer content ([2b57702](https://github.com/react-navigation/navigation-ex/commit/2b57702))
* fix content component not rendering in drawer ([0a5fb3e](https://github.com/react-navigation/navigation-ex/commit/0a5fb3e))
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.13](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/drawer@5.0.0-alpha.12...@react-navigation/drawer@5.0.0-alpha.13) (2019-10-06)
**Note:** Version bump only for package @react-navigation/drawer

View File

@@ -11,7 +11,7 @@
"material",
"drawer"
],
"version": "5.0.0-alpha.13",
"version": "5.0.0-alpha.14",
"license": "MIT",
"repository": {
"type": "git",
@@ -41,12 +41,12 @@
"@types/react": "^16.9.4",
"@types/react-native": "^0.60.17",
"del-cli": "^3.0.0",
"react": "16.8.3",
"react-native": "0.59.10",
"react": "~16.8.3",
"react-native": "~0.59.10",
"react-native-gesture-handler": "^1.3.0",
"react-native-reanimated": "^1.3.0",
"react-native-safe-area-context": "^0.3.6",
"react-native-screens": "^1.0.0-alpha.22",
"react-native-screens": "^2.0.0-alpha.3",
"typescript": "^3.6.3"
},
"peerDependencies": {
@@ -56,7 +56,7 @@
"react-native-gesture-handler": "^1.0.0",
"react-native-reanimated": "^1.0.0",
"react-native-safe-area-context": "^0.3.6",
"react-native-screens": "^1.0.0-alpha.0"
"react-native-screens": "^1.0.0-alpha.0 || ^2.0.0-alpha.3"
},
"@react-native-community/bob": {
"source": "src",

View File

@@ -8,8 +8,9 @@ export {
/**
* Views
*/
export { default as DrawerNavigatorItems } from './views/DrawerNavigatorItems';
export { default as DrawerSidebar } from './views/DrawerSidebar';
export { default as DrawerItem } from './views/DrawerItem';
export { default as DrawerItemList } from './views/DrawerItemList';
export { default as DrawerContent } from './views/DrawerContent';
export { default as DrawerView } from './views/DrawerView';
/**
@@ -23,5 +24,6 @@ export { default as DrawerGestureContext } from './utils/DrawerGestureContext';
export {
DrawerNavigationOptions,
DrawerNavigationProp,
DrawerNavigationItemsProps,
DrawerContentOptions,
DrawerContentComponentProps,
} from './types';

View File

@@ -12,16 +12,11 @@ import { PanGestureHandler } from 'react-native-gesture-handler';
export type Scene = {
route: Route<string>;
index: number;
focused: boolean;
tintColor?: string;
color?: string;
};
export type DrawerNavigationConfig = {
/**
* Custom background color for the drawer. Defaults to `white`.
*/
drawerBackgroundColor: string;
export type DrawerNavigationConfig<T = DrawerContentOptions> = {
/**
* Position of the drawer on the screen. Defaults to `left`.
*/
@@ -33,11 +28,6 @@ export type DrawerNavigationConfig = {
* - `slide`: Both the screen and the drawer slide on swipe to reveal the drawer.
*/
drawerType: 'front' | 'back' | 'slide';
/**
* Number or a function which returns the width of the drawer.
* If a function is provided, it'll be called again when the screen's dimensions change.
*/
drawerWidth: number | (() => number);
/**
* How far from the edge of the screen the swipe gesture should activate.
*/
@@ -82,49 +72,51 @@ export type DrawerNavigationConfig = {
* Custom component used to render as the content of the drawer, for example, navigation items.
* Defaults to `DrawerItems`.
*/
contentComponent: React.ComponentType<ContentComponentProps>;
contentComponent: React.ComponentType<DrawerContentComponentProps<T>>;
/**
* Options for the content component which will be passed as props.
*/
contentOptions?: object;
contentOptions?: T;
/**
* Style object for the component wrapping the screen content.
*/
sceneContainerStyle?: StyleProp<ViewStyle>;
style?: StyleProp<ViewStyle>;
/**
* Style object for the drawer component.
* You can pass a custom background color for a drawer or a custom width here.
*/
drawerStyle?: StyleProp<ViewStyle>;
};
export type DrawerNavigationOptions = {
title?: string;
drawerLabel?:
| string
| ((props: { tintColor?: string; focused: boolean }) => React.ReactElement);
| ((props: { color: string; focused: boolean }) => React.ReactNode);
drawerIcon?: (props: {
tintColor?: string;
color: string;
size: number;
focused: boolean;
}) => React.ReactElement;
}) => React.ReactNode;
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open';
};
export type ContentComponentProps = DrawerNavigationItemsProps & {
export type DrawerContentComponentProps<T = DrawerContentOptions> = T & {
state: DrawerNavigationState;
navigation: NavigationHelpers<ParamListBase>;
descriptors: { [key: string]: any };
descriptors: DrawerDescriptorMap;
/**
* Animated node which represents the current progress of the drawer's open state.
* `0` is closed, `1` is open.
*/
drawerOpenProgress: Animated.Node<number>;
progress: Animated.Node<number>;
/**
* Position of the drawer on the screen.
*/
drawerPosition: 'left' | 'right';
};
export type DrawerNavigationItemsProps = {
/**
* The array of routes, can be modified or overridden to control what's shown in the drawer.
*/
items: Route<string>[];
/**
* Route key identifying the currently active route.
*/
activeItemKey?: string | null;
export type DrawerContentOptions = {
/**
* Color for the icon and label in the active item in the drawer.
*/
@@ -141,37 +133,22 @@ export type DrawerNavigationItemsProps = {
* Background color for the inactive items in the drawer.
*/
inactiveBackgroundColor?: string;
/**
* Style object for the content section.
*/
itemsContainerStyle?: ViewStyle;
/**
* Style object for the single item, which can contain an icon and/or a label.
*/
itemStyle?: StyleProp<ViewStyle>;
/**
* Style object to overwrite `Text` style inside content section which renders a label.
* Style object to apply to the `Text` inside content section which renders a label.
*/
labelStyle?: StyleProp<TextStyle>;
/**
* Style object to overwrite `Text` style of the active label.
* Style object for the content section.
*/
activeLabelStyle?: StyleProp<TextStyle>;
contentContainerStyle?: StyleProp<ViewStyle>;
/**
* Style object to overwrite `Text` style of the inactive label.
* Style object for the wrapper view.
*/
inactiveLabelStyle?: StyleProp<TextStyle>;
/**
* Style object for the wrapper `View` of the icon.
*/
iconContainerStyle?: StyleProp<ViewStyle>;
/**
* Position of the drawer on the screen.
*/
drawerPosition: 'left' | 'right';
getLabel: (scene: Scene) => React.ReactNode;
renderIcon: (scene: Scene) => React.ReactNode;
onItemPress: (scene: { route: Route<string>; focused: boolean }) => void;
style?: StyleProp<ViewStyle>;
};
export type DrawerNavigationEventMap = {

View File

@@ -0,0 +1,36 @@
import * as React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { useSafeArea } from 'react-native-safe-area-context';
import DrawerItemList from './DrawerItemList';
import { DrawerContentComponentProps } from '../types';
export default function DrawerContent({
contentContainerStyle,
style,
drawerPosition,
...rest
}: DrawerContentComponentProps) {
const insets = useSafeArea();
return (
<ScrollView
contentContainerStyle={[
{
paddingTop: insets.top + 4,
paddingLeft: drawerPosition === 'left' ? insets.left : 0,
paddingRight: drawerPosition === 'right' ? insets.right : 0,
},
contentContainerStyle,
]}
style={[styles.container, style]}
>
<DrawerItemList {...rest} />
</ScrollView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
});

View File

@@ -0,0 +1,139 @@
import * as React from 'react';
import {
Text,
View,
StyleSheet,
StyleProp,
ViewStyle,
TextStyle,
} from 'react-native';
import TouchableItem from './TouchableItem';
type Props = {
/**
* The label text of the item.
*/
label:
| string
| ((props: { focused: boolean; color: string }) => React.ReactNode);
/**
* Icon to display for the `DrawerItem`.
*/
icon?: (props: {
focused: boolean;
size: number;
color: string;
}) => React.ReactNode;
/**
* Whether to highlight the drawer item as active.
*/
focused?: boolean;
/**
* Function to execute on press.
*/
onPress: () => void;
/**
* Color for the icon and label when the item is active.
*/
activeTintColor?: string;
/**
* Color for the icon and label when the item is inactive.
*/
inactiveTintColor?: string;
/**
* Background color for item when its active.
*/
activeBackgroundColor?: string;
/**
* Background color for item when its inactive.
*/
inactiveBackgroundColor?: string;
/**
* Style object for the label element.
*/
labelStyle?: StyleProp<TextStyle>;
/**
* Style object for the wrapper element.
*/
style?: StyleProp<ViewStyle>;
};
/**
* A component used to show an action item with an icon and a label in a navigation drawer.
*/
export default function DrawerItem({
icon,
label,
focused = false,
activeTintColor = '#6200ee',
inactiveTintColor = 'rgba(0, 0, 0, .68)',
activeBackgroundColor = 'rgba(98, 0, 238, 0.12)',
inactiveBackgroundColor = 'transparent',
style,
onPress,
...rest
}: Props) {
const { borderRadius = 4 } = StyleSheet.flatten(style || {});
const color = focused ? activeTintColor : inactiveTintColor;
const backgroundColor = focused
? activeBackgroundColor
: inactiveBackgroundColor;
const iconNode = icon ? icon({ size: 24, focused, color }) : null;
return (
<View
collapsable={false}
{...rest}
style={[styles.container, { borderRadius, backgroundColor }, style]}
>
<TouchableItem
borderless
delayPressIn={0}
onPress={onPress}
style={[styles.wrapper, { borderRadius }]}
accessibilityTraits={focused ? ['button', 'selected'] : 'button'}
accessibilityComponentType="button"
accessibilityRole="button"
accessibilityStates={focused ? ['selected'] : []}
>
<React.Fragment>
{iconNode}
{typeof label === 'function' ? (
label({ color, focused })
) : (
<Text
numberOfLines={1}
style={[
styles.label,
{
color,
fontWeight: '500',
marginLeft: iconNode ? 32 : 0,
marginVertical: 5,
},
]}
>
{label}
</Text>
)}
</React.Fragment>
</TouchableItem>
</View>
);
}
const styles = StyleSheet.create({
container: {
marginHorizontal: 10,
marginVertical: 4,
},
wrapper: {
flexDirection: 'row',
alignItems: 'center',
padding: 8,
},
label: {
marginRight: 32,
},
});

View File

@@ -0,0 +1,67 @@
import * as React from 'react';
import { CommonActions } from '@react-navigation/core';
import {
DrawerActions,
DrawerNavigationState,
} from '@react-navigation/routers';
import DrawerItem from './DrawerItem';
import {
DrawerNavigationHelpers,
DrawerDescriptorMap,
DrawerContentOptions,
} from '../types';
type Props = Omit<DrawerContentOptions, 'contentContainerStyle' | 'style'> & {
state: DrawerNavigationState;
navigation: DrawerNavigationHelpers;
descriptors: DrawerDescriptorMap;
};
/**
* Component that renders the navigation list in the drawer.
*/
export default function DrawerItemList({
state,
navigation,
descriptors,
activeTintColor,
inactiveTintColor,
activeBackgroundColor,
inactiveBackgroundColor,
itemStyle,
labelStyle,
}: Props) {
return (state.routes.map((route, i) => {
const focused = i === state.index;
const { title, drawerLabel, drawerIcon } = descriptors[route.key].options;
return (
<DrawerItem
key={route.key}
label={
drawerLabel !== undefined
? drawerLabel
: title !== undefined
? title
: route.name
}
icon={drawerIcon}
focused={focused}
activeTintColor={activeTintColor}
inactiveTintColor={inactiveTintColor}
activeBackgroundColor={activeBackgroundColor}
inactiveBackgroundColor={inactiveBackgroundColor}
labelStyle={labelStyle}
style={itemStyle}
onPress={() => {
navigation.dispatch({
...(focused
? DrawerActions.closeDrawer()
: CommonActions.navigate(route.name)),
target: state.key,
});
}}
/>
);
}) as React.ReactNode) as React.ReactElement;
}

View File

@@ -1,129 +0,0 @@
import * as React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import { useSafeArea } from 'react-native-safe-area-context';
import TouchableItem from './TouchableItem';
import { DrawerNavigationItemsProps } from '../types';
/**
* Component that renders the navigation list in the drawer.
*/
const DrawerNavigatorItems = ({
items,
activeItemKey,
activeTintColor,
activeBackgroundColor,
inactiveTintColor,
inactiveBackgroundColor,
getLabel,
renderIcon,
onItemPress,
itemsContainerStyle,
itemStyle,
labelStyle,
activeLabelStyle,
inactiveLabelStyle,
iconContainerStyle,
drawerPosition,
}: DrawerNavigationItemsProps) => {
const insets = useSafeArea();
return (
<View style={[styles.container, itemsContainerStyle]}>
{items.map((route, index: number) => {
const focused = activeItemKey === route.key;
const color = focused ? activeTintColor : inactiveTintColor;
const backgroundColor = focused
? activeBackgroundColor
: inactiveBackgroundColor;
const scene = { route, index, focused, tintColor: color };
const icon = renderIcon(scene);
const label = getLabel(scene);
const accessibilityLabel =
typeof label === 'string' ? label : undefined;
const extraLabelStyle = focused ? activeLabelStyle : inactiveLabelStyle;
return (
<TouchableItem
key={route.key}
accessible
accessibilityLabel={accessibilityLabel}
onPress={() => {
onItemPress({ route, focused });
}}
delayPressIn={0}
>
<View
style={[
{
backgroundColor,
marginLeft: drawerPosition === 'left' ? insets.left : 0,
marginRight: drawerPosition === 'right' ? insets.right : 0,
},
styles.item,
itemStyle,
]}
>
{icon ? (
<View
style={[
styles.icon,
focused ? null : styles.inactiveIcon,
iconContainerStyle,
]}
>
{icon}
</View>
) : null}
{typeof label === 'string' ? (
<Text
style={[styles.label, { color }, labelStyle, extraLabelStyle]}
>
{label}
</Text>
) : (
label
)}
</View>
</TouchableItem>
);
})}
</View>
);
};
/* Material design specs - https://material.io/guidelines/patterns/navigation-drawer.html#navigation-drawer-specs */
DrawerNavigatorItems.defaultProps = {
activeTintColor: '#2196f3',
activeBackgroundColor: 'rgba(0, 0, 0, .04)',
inactiveTintColor: 'rgba(0, 0, 0, .87)',
inactiveBackgroundColor: 'transparent',
};
const styles = StyleSheet.create({
container: {
paddingVertical: 4,
},
item: {
flexDirection: 'row',
alignItems: 'center',
},
icon: {
marginHorizontal: 16,
width: 24,
alignItems: 'center',
},
inactiveIcon: {
/*
* Icons have 0.54 opacity according to guidelines
* 100/87 * 54 ~= 62
*/
opacity: 0.62,
},
label: {
margin: 16,
fontWeight: 'bold',
},
});
export default DrawerNavigatorItems;

View File

@@ -1,128 +0,0 @@
import * as React from 'react';
import { StyleSheet, View, ViewStyle, StyleProp } from 'react-native';
import Animated from 'react-native-reanimated';
import { Route, CommonActions } from '@react-navigation/core';
import {
DrawerActions,
DrawerNavigationState,
} from '@react-navigation/routers';
import {
Scene,
ContentComponentProps,
DrawerDescriptorMap,
DrawerNavigationHelpers,
} from '../types';
type Props = {
contentComponent?: React.ComponentType<ContentComponentProps>;
contentOptions?: object;
state: DrawerNavigationState;
navigation: DrawerNavigationHelpers;
descriptors: DrawerDescriptorMap;
drawerOpenProgress: Animated.Node<number>;
drawerPosition: 'left' | 'right';
style?: StyleProp<ViewStyle>;
};
/**
* Component that renders the sidebar screen of the drawer.
*/
class DrawerSidebar extends React.PureComponent<Props> {
private getScreenOptions = (routeKey: string) => {
const descriptor = this.props.descriptors[routeKey];
if (!descriptor.options) {
throw new Error(
'Cannot access screen descriptor options from drawer sidebar'
);
}
return descriptor.options;
};
private getLabel = ({ focused, tintColor, route }: Scene) => {
const { drawerLabel, title } = this.getScreenOptions(route.key);
if (drawerLabel) {
return typeof drawerLabel === 'function'
? drawerLabel({ tintColor, focused })
: drawerLabel;
}
if (typeof title === 'string') {
return title;
}
return route.name;
};
private renderIcon = ({ focused, tintColor, route }: Scene) => {
const { drawerIcon } = this.getScreenOptions(route.key);
if (drawerIcon) {
return typeof drawerIcon === 'function'
? drawerIcon({ tintColor, focused })
: drawerIcon;
}
return null;
};
private handleItemPress = ({
route,
focused,
}: {
route: Route<string>;
focused: boolean;
}) => {
const { state, navigation } = this.props;
navigation.dispatch({
...(focused
? DrawerActions.closeDrawer()
: CommonActions.navigate(route.name)),
target: state.key,
});
};
render() {
const ContentComponent = this.props.contentComponent;
if (!ContentComponent) {
return null;
}
const { state } = this.props;
if (typeof state.index !== 'number') {
throw new Error(
'The index of the route should be state in the navigation state'
);
}
return (
<View style={[styles.container, this.props.style]}>
<ContentComponent
{...this.props.contentOptions}
navigation={this.props.navigation}
descriptors={this.props.descriptors}
drawerOpenProgress={this.props.drawerOpenProgress}
items={state.routes}
activeItemKey={
state.routes[state.index] ? state.routes[state.index].key : null
}
getLabel={this.getLabel}
renderIcon={this.renderIcon}
onItemPress={this.handleItemPress}
drawerPosition={this.props.drawerPosition}
/>
</View>
);
}
}
export default DrawerSidebar;
const styles = StyleSheet.create({
container: {
flex: 1,
},
});

View File

@@ -1,30 +1,35 @@
import * as React from 'react';
import { Dimensions, StyleSheet, I18nManager, Platform } from 'react-native';
import { SafeAreaProvider, useSafeArea } from 'react-native-safe-area-context';
import {
Dimensions,
StyleSheet,
I18nManager,
Platform,
ScaledSize,
} from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
// eslint-disable-next-line import/no-unresolved
import { ScreenContainer } from 'react-native-screens';
import { PanGestureHandler, ScrollView } from 'react-native-gesture-handler';
import { PanGestureHandler } from 'react-native-gesture-handler';
import {
DrawerNavigationState,
DrawerActions,
} from '@react-navigation/routers';
import DrawerSidebar from './DrawerSidebar';
import DrawerGestureContext from '../utils/DrawerGestureContext';
import ResourceSavingScene from './ResourceSavingScene';
import DrawerNavigatorItems from './DrawerNavigatorItems';
import DrawerContent from './DrawerContent';
import Drawer from './Drawer';
import {
DrawerDescriptorMap,
DrawerNavigationConfig,
ContentComponentProps,
DrawerNavigationHelpers,
} from '../types';
type Props = DrawerNavigationConfig & {
type Props = Omit<DrawerNavigationConfig, 'overlayColor'> & {
state: DrawerNavigationState;
navigation: DrawerNavigationHelpers;
descriptors: DrawerDescriptorMap;
overlayColor: string;
};
type State = {
@@ -32,17 +37,25 @@ type State = {
drawerWidth: number;
};
const DefaultContentComponent = (props: ContentComponentProps) => {
const insets = useSafeArea();
const getDefaultDrawerWidth = ({
height,
width,
}: {
height: number;
width: number;
}) => {
/*
* Default drawer width is screen width - header height
* with a max width of 280 on mobile and 320 on tablet
* https://material.io/guidelines/patterns/navigation-drawer.html
*/
const smallerAxisSize = Math.min(height, width);
const isLandscape = width > height;
const isTablet = smallerAxisSize >= 600;
const appBarHeight = Platform.OS === 'ios' ? (isLandscape ? 32 : 44) : 56;
const maxWidth = isTablet ? 320 : 280;
return (
<ScrollView
alwaysBounceVertical={false}
contentContainerStyle={{ marginTop: insets.top }}
>
<DrawerNavigatorItems {...props} />
</ScrollView>
);
return Math.min(smallerAxisSize - appBarHeight, maxWidth);
};
/**
@@ -51,25 +64,10 @@ const DefaultContentComponent = (props: ContentComponentProps) => {
export default class DrawerView extends React.PureComponent<Props, State> {
static defaultProps = {
lazy: true,
drawerWidth: () => {
/*
* Default drawer width is screen width - header height
* with a max width of 280 on mobile and 320 on tablet
* https://material.io/guidelines/patterns/navigation-drawer.html
*/
const { height, width } = Dimensions.get('window');
const smallerAxisSize = Math.min(height, width);
const isLandscape = width > height;
const isTablet = smallerAxisSize >= 600;
const appBarHeight = Platform.OS === 'ios' ? (isLandscape ? 32 : 44) : 56;
const maxWidth = isTablet ? 320 : 280;
return Math.min(smallerAxisSize - appBarHeight, maxWidth);
},
contentComponent: DefaultContentComponent,
contentComponent: DrawerContent,
drawerPosition: I18nManager.isRTL ? 'right' : 'left',
keyboardDismissMode: 'on-drag',
drawerBackgroundColor: 'white',
overlayColor: 'rgba(0, 0, 0, 0.5)',
drawerType: 'front',
hideStatusBar: false,
statusBarAnimation: 'slide',
@@ -88,10 +86,7 @@ export default class DrawerView extends React.PureComponent<Props, State> {
state: State = {
loaded: [this.props.state.index],
drawerWidth:
typeof this.props.drawerWidth === 'function'
? this.props.drawerWidth()
: this.props.drawerWidth,
drawerWidth: getDefaultDrawerWidth(Dimensions.get('window')),
};
componentDidMount() {
@@ -126,11 +121,8 @@ export default class DrawerView extends React.PureComponent<Props, State> {
navigation.emit({ type: 'drawerClose' });
};
private updateWidth = () => {
const drawerWidth =
typeof this.props.drawerWidth === 'function'
? this.props.drawerWidth()
: this.props.drawerWidth;
private updateWidth = ({ window }: { window: ScaledSize }) => {
const drawerWidth = getDefaultDrawerWidth(window);
if (this.state.drawerWidth !== drawerWidth) {
this.setState({ drawerWidth });
@@ -138,7 +130,23 @@ export default class DrawerView extends React.PureComponent<Props, State> {
};
private renderNavigationView = ({ progress }: any) => {
return <DrawerSidebar drawerOpenProgress={progress} {...this.props} />;
const {
state,
navigation,
descriptors,
drawerPosition,
contentComponent: ContentComponent,
} = this.props;
return (
<ContentComponent
progress={progress}
state={state}
navigation={navigation}
descriptors={descriptors}
drawerPosition={drawerPosition}
/>
);
};
private renderContent = () => {
@@ -192,9 +200,9 @@ export default class DrawerView extends React.PureComponent<Props, State> {
descriptors,
drawerType,
drawerPosition,
drawerBackgroundColor,
overlayColor,
sceneContainerStyle,
drawerStyle,
edgeWidth,
minSwipeDistance,
hideStatusBar,
@@ -202,6 +210,8 @@ export default class DrawerView extends React.PureComponent<Props, State> {
gestureHandlerProps,
} = this.props;
const { drawerWidth } = this.state;
const activeKey = state.routes[state.index].key;
const { drawerLockMode } = descriptors[activeKey].options;
@@ -228,13 +238,8 @@ export default class DrawerView extends React.PureComponent<Props, State> {
drawerType={drawerType}
drawerPosition={drawerPosition}
sceneContainerStyle={sceneContainerStyle}
drawerStyle={{
backgroundColor: drawerBackgroundColor || 'white',
width: this.state.drawerWidth,
}}
overlayStyle={{
backgroundColor: overlayColor || 'rgba(0, 0, 0, 0.5)',
}}
drawerStyle={[{ width: drawerWidth }, drawerStyle]}
overlayStyle={{ backgroundColor: overlayColor }}
swipeEdgeWidth={edgeWidth}
swipeDistanceThreshold={minSwipeDistance}
hideStatusBar={hideStatusBar}

View File

@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.13](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/example@5.0.0-alpha.12...@react-navigation/example@5.0.0-alpha.13) (2019-10-15)
### Bug Fixes
* block GH interactions in Native Stack example ([#126](https://github.com/react-navigation/navigation-ex/issues/126)) ([386d1c0](https://github.com/react-navigation/navigation-ex/commit/386d1c0))
* make it possible to run the example on web ([7a901af](https://github.com/react-navigation/navigation-ex/commit/7a901af))
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.12](https://github.com/satya164/navigation-ex/compare/@react-navigation/example@5.0.0-alpha.11...@react-navigation/example@5.0.0-alpha.12) (2019-10-06)

View File

@@ -151,6 +151,7 @@
<orderEntry type="library" name="Gradle: com.facebook.soloader:soloader:0.6.0@aar" level="project" />
<orderEntry type="library" name="Gradle: io.nlopez.smartlocation:library:3.2.11@aar" level="project" />
<orderEntry type="library" name="Gradle: com.facebook.fresco:fbcore:1.10.0@aar" level="project" />
<orderEntry type="module" module-name="react-native-screens" />
<orderEntry type="module" module-name="react-native-reanimated" />
<orderEntry type="module" module-name="react-native-gesture-handler" />
<orderEntry type="module" module-name="expo-permissions" />

View File

@@ -139,6 +139,8 @@ android {
}
dependencies {
implementation project(':react-native-safe-area-context')
implementation project(':react-native-screens')
implementation project(':react-native-reanimated')
implementation project(':react-native-gesture-handler')
implementation fileTree(dir: "libs", include: ["*.jar"])

View File

@@ -3,6 +3,8 @@ package com.reactnavigationexample;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.th3rdwave.safeareacontext.SafeAreaContextPackage;
import com.swmansion.rnscreens.RNScreensPackage;
import com.swmansion.reanimated.ReanimatedPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
@@ -39,6 +41,8 @@ public class MainApplication extends Application implements ReactApplication {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new SafeAreaContextPackage(),
new RNScreensPackage(),
new ReanimatedPackage(),
new RNGestureHandlerPackage(),
new ModuleRegistryAdapter(mModuleRegistryProvider)

View File

@@ -16,3 +16,6 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true

View File

@@ -1,8 +0,0 @@
## This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.
#
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Wed Sep 18 15:42:44 CEST 2019
sdk.dir=/Users/osdnk/Library/Android/sdk

View File

@@ -1,4 +1,8 @@
apply from: '../node_modules/react-native-unimodules/gradle.groovy'
include ':react-native-safe-area-context'
project(':react-native-safe-area-context').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-safe-area-context/android')
include ':react-native-screens'
project(':react-native-screens').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-screens/android')
include ':react-native-reanimated'
project(':react-native-reanimated').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reanimated/android')
includeUnimodulesProjects()

View File

@@ -28,6 +28,9 @@ target 'ReactNavigationExample' do
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
pod 'RNGestureHandler', :podspec => '../node_modules/react-native-gesture-handler/RNGestureHandler.podspec'
pod 'RNReanimated', :podspec => '../node_modules/react-native-reanimated/RNReanimated.podspec'
pod 'RNScreens', :podspec => '../node_modules/react-native-screens/RNScreens.podspec'
use_unimodules!
pod 'react-native-safe-area-context', :path => '../node_modules/react-native-safe-area-context'
end

View File

@@ -1,31 +1,31 @@
PODS:
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.6)
- EXAppLoaderProvider (6.0.0)
- EXConstants (6.0.0):
- EXAppLoaderProvider (7.0.0)
- EXConstants (7.0.0):
- UMConstantsInterface
- UMCore
- EXFileSystem (6.0.2):
- EXFileSystem (7.0.0):
- UMCore
- UMFileSystemInterface
- EXFont (6.0.1):
- EXFont (7.0.0):
- UMCore
- UMFontInterface
- EXKeepAwake (6.0.0):
- EXKeepAwake (7.0.0):
- UMCore
- EXLinearGradient (6.0.0):
- EXLinearGradient (7.0.0):
- UMCore
- EXLocation (6.0.0):
- EXLocation (7.0.0):
- UMCore
- UMPermissionsInterface
- UMTaskManagerInterface
- EXPermissions (6.0.0):
- EXPermissions (7.0.0):
- UMCore
- UMPermissionsInterface
- EXSQLite (6.0.0):
- EXSQLite (7.0.0):
- UMCore
- UMFileSystemInterface
- EXWebBrowser (6.0.0):
- EXWebBrowser (7.0.1):
- UMCore
- Folly (2018.10.22.00):
- boost-for-react-native
@@ -34,6 +34,8 @@ PODS:
- glog (0.3.5)
- React (0.59.10):
- React/Core (= 0.59.10)
- react-native-safe-area-context (0.3.6):
- React
- React/Core (0.59.10):
- yoga (= 0.59.10.React)
- React/CxxBridge (0.59.10):
@@ -89,23 +91,25 @@ PODS:
- React/RCTBlob
- RNGestureHandler (1.3.0):
- React
- RNReanimated (1.1.0):
- RNReanimated (1.2.0):
- React
- UMBarCodeScannerInterface (3.0.0)
- UMCameraInterface (3.0.0)
- UMConstantsInterface (3.0.0)
- UMCore (3.0.2)
- UMFaceDetectorInterface (3.0.0)
- UMFileSystemInterface (3.0.0)
- UMFontInterface (3.0.0)
- UMImageLoaderInterface (3.0.0)
- UMPermissionsInterface (3.0.0)
- UMReactNativeAdapter (3.0.0):
- RNScreens (2.0.0-alpha.4):
- React
- UMBarCodeScannerInterface (4.0.0)
- UMCameraInterface (4.0.0)
- UMConstantsInterface (4.0.0)
- UMCore (4.0.0)
- UMFaceDetectorInterface (4.0.0)
- UMFileSystemInterface (4.0.0)
- UMFontInterface (4.0.0)
- UMImageLoaderInterface (4.0.0)
- UMPermissionsInterface (4.0.0)
- UMReactNativeAdapter (5.0.0-alpha.0):
- React
- UMCore
- UMFontInterface
- UMSensorsInterface (3.0.0)
- UMTaskManagerInterface (3.0.0)
- UMSensorsInterface (4.0.0)
- UMTaskManagerInterface (4.0.0)
- yoga (0.59.10.React)
DEPENDENCIES:
@@ -122,6 +126,7 @@ DEPENDENCIES:
- EXWebBrowser (from `../node_modules/expo-web-browser/ios`)
- Folly (from `../node_modules/react-native/third-party-podspecs/Folly.podspec`)
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- React/Core (from `../node_modules/react-native`)
- React/CxxBridge (from `../node_modules/react-native`)
- React/DevSupport (from `../node_modules/react-native`)
@@ -138,6 +143,7 @@ DEPENDENCIES:
- React/RCTWebSocket (from `../node_modules/react-native`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler/RNGestureHandler.podspec`)
- RNReanimated (from `../node_modules/react-native-reanimated/RNReanimated.podspec`)
- RNScreens (from `../node_modules/react-native-screens/RNScreens.podspec`)
- UMBarCodeScannerInterface (from `../node_modules/unimodules-barcode-scanner-interface/ios`)
- UMCameraInterface (from `../node_modules/unimodules-camera-interface/ios`)
- UMConstantsInterface (from `../node_modules/unimodules-constants-interface/ios`)
@@ -147,7 +153,7 @@ DEPENDENCIES:
- UMFontInterface (from `../node_modules/unimodules-font-interface/ios`)
- UMImageLoaderInterface (from `../node_modules/unimodules-image-loader-interface/ios`)
- UMPermissionsInterface (from `../node_modules/unimodules-permissions-interface/ios`)
- "UMReactNativeAdapter (from `../node_modules/@unimodules/react-native-adapter/ios`)"
- "UMReactNativeAdapter (from `../node_modules/react-native-unimodules/node_modules/@unimodules/react-native-adapter/ios`)"
- UMSensorsInterface (from `../node_modules/unimodules-sensors-interface/ios`)
- UMTaskManagerInterface (from `../node_modules/unimodules-task-manager-interface/ios`)
- yoga (from `../node_modules/react-native/ReactCommon/yoga`)
@@ -195,10 +201,14 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
React:
:path: "../node_modules/react-native"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
RNGestureHandler:
:podspec: "../node_modules/react-native-gesture-handler/RNGestureHandler.podspec"
RNReanimated:
:podspec: "../node_modules/react-native-reanimated/RNReanimated.podspec"
RNScreens:
:podspec: "../node_modules/react-native-screens/RNScreens.podspec"
UMBarCodeScannerInterface:
:path: !ruby/object:Pathname
path: "../node_modules/unimodules-barcode-scanner-interface/ios"
@@ -228,7 +238,7 @@ EXTERNAL SOURCES:
path: "../node_modules/unimodules-permissions-interface/ios"
UMReactNativeAdapter:
:path: !ruby/object:Pathname
path: "../node_modules/@unimodules/react-native-adapter/ios"
path: "../node_modules/react-native-unimodules/node_modules/@unimodules/react-native-adapter/ios"
UMSensorsInterface:
:path: !ruby/object:Pathname
path: "../node_modules/unimodules-sensors-interface/ios"
@@ -241,35 +251,37 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: bb338842f62ab1d708ceb63ec3d999f0f3d98ecd
EXAppLoaderProvider: 7a8185228d8ba9e689a0e2d6d957fe9bdd49c8a0
EXConstants: 5d81e84ca71b9a552529889cc798b4a04e9e22b3
EXFileSystem: 091907902fcec9f9182b656fdead41a82f30986a
EXFont: c862449210fc86aa11d24a202cb22c71a0d39609
EXKeepAwake: e7cb6516675052b12a7d23291e33078b4239653a
EXLinearGradient: 40781b77e58f844c8dc4ad310dc9755b4d3792a7
EXLocation: 4eb76115832f08b1e78003b335c210e18fa60424
EXPermissions: 99e52dc3e5f8e55153f1958004f6df2a30a1f2f5
EXSQLite: 8dab6a5ab1b78be7925073d6071eb22095d4dda6
EXWebBrowser: def838b95aa9d396f9ce71ace4e614ee16e7ee30
EXAppLoaderProvider: 5d348813a9cf09b03bbe5b8b55437bc1bfbddbd1
EXConstants: 31e5318521be6175009af6ccd3e97dedf39da96a
EXFileSystem: 7e53a2c30a2eb6987ba6d5158ab908f947523228
EXFont: 71d07dc5d2153db7d1a23f1e0cc1b6341d55c432
EXKeepAwake: d4caf9a1a7691126ade4ca0b76592e93250a8f29
EXLinearGradient: ebfd46cb98a46330213e4945b96227d98f624054
EXLocation: 452a1d9edceb1b93deb86fd785236606d33742dd
EXPermissions: df10ad83df2f6b647aec304619354f8ab48d5f63
EXSQLite: ddc1e6727bd7d36e649f07590fe3ae5511c1f039
EXWebBrowser: 18924c3d2a3a1aa95d413672f058beff589c80f4
Folly: de497beb10f102453a1afa9edbf8cf8a251890de
glog: aefd1eb5dda2ab95ba0938556f34b98e2da3a60d
React: 36d0768f9e93be2473b37e7fa64f92c1d5341eef
react-native-safe-area-context: e380a6f783ccaec848e2f3cc8eb205a62362950d
RNGestureHandler: 5329a942fce3d41c68b84c2c2276ce06a696d8b0
RNReanimated: 7a52c90473b5e81c13408d40d797b98387eaddde
UMBarCodeScannerInterface: 84ea2d6b58ff0dc27ef9b68bab71286be18ee020
UMCameraInterface: 26b26005d1756a0d5f4f04f1e168e39ea9154535
UMConstantsInterface: 038bacb19de12b6fd328c589122c8dc977cccf61
UMCore: 733094f43f7244c60ce1f0592d00013ed68fa52c
UMFaceDetectorInterface: c9c3ae4cb045421283667a1698c2f31331f55e3f
UMFileSystemInterface: e9adc71027017de38eaf7d05fa58b2848ecb3797
UMFontInterface: f0c5846977ee8a93d7cfa8ae7e666772c727d195
UMImageLoaderInterface: 36e54e570acc4d720856f03ceebc441f73ea472c
UMPermissionsInterface: 938d010c74c43fcefc9bb990633a7c5a1631267e
UMReactNativeAdapter: 131ea2b944ade8035f0b54c6570c405f6000548d
UMSensorsInterface: 0ed023ce9b96f2ca6fada7bda05b7760da60b293
UMTaskManagerInterface: 8664abd37a00715727e60df9ecd65e42ba47b548
RNReanimated: 1b52415c4302f198cb581282a0166690bad62c43
RNScreens: 84be1a2369a580beb2fea0755cc62ef16b83fffe
UMBarCodeScannerInterface: d5a6fdc98ed6241225b0a8432a7f4e2b397668bc
UMCameraInterface: 68870a3197fee85bd5afca5609ba4a5b7257d19d
UMConstantsInterface: d25b8e8887ca7aaf568c06caf08f4d40734ee4ef
UMCore: 402cee150324974974f5c32b5404d8af65e4cff5
UMFaceDetectorInterface: 7b4f1a92f0c726b58b086296048efe193b570678
UMFileSystemInterface: aadb9a67aa6470d7ebc06cf04dc54fee6781ac48
UMFontInterface: 2d3c128285086bbed3d2a650f1d698323ef3b25a
UMImageLoaderInterface: 2829a7571a12d2e754c73c55ffe7e327d8402c7d
UMPermissionsInterface: b6a6e96db0f4011a25aaca14e6022529dd3d6e4e
UMReactNativeAdapter: e93109c6de5ea830d4a78d08f3a65b8d33a143a3
UMSensorsInterface: cf59dd7602764a2419e00167429be3e4be39c61d
UMTaskManagerInterface: 1e70fe58b872355f0ecb44fb81bb1a16484047f0
yoga: 684513b14b03201579ba3cee20218c9d1298b0cc
PODFILE CHECKSUM: 41592ff50a43d56f905dbf9c7eded4b358264eba
PODFILE CHECKSUM: 1276a2dd000c142ccc03272023bb8a6b2d5b9933
COCOAPODS: 1.7.5

View File

@@ -1,7 +1,7 @@
{
"name": "@react-navigation/example",
"description": "Demo app to showcase various functionality of React Navigation",
"version": "5.0.0-alpha.12",
"version": "5.0.0-alpha.13",
"private": true,
"workspaces": {
"nohoist": [
@@ -11,9 +11,11 @@
},
"scripts": {
"start": "expo start",
"web": "expo start --web",
"native": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios"
"ios": "react-native run-ios",
"postinstall": "jetify"
},
"dependencies": {
"@expo/vector-icons": "^10.0.0",
@@ -21,26 +23,29 @@
"expo": "^35.0.0",
"expo-asset": "~7.0.0",
"query-string": "^6.8.3",
"react": "^16.8.3",
"react-dom": "^16.8.3",
"react-native": "^0.59.10",
"react": "~16.8.3",
"react-dom": "~16.8.3",
"react-native": "~0.59.10",
"react-native-gesture-handler": "~1.3.0",
"react-native-paper": "^3.0.0-alpha.3",
"react-native-reanimated": "~1.2.0",
"react-native-safe-area-context": "~0.3.6",
"react-native-screens": "~1.0.0-alpha.23",
"react-native-screens": "2.0.0-alpha.4",
"react-native-tab-view": "2.10.0",
"react-native-unimodules": "^0.7.0-rc.1",
"react-native-web": "^0.11.7",
"scheduler": "^0.16.1",
"shortid": "^2.2.15",
"use-subscription": "^1.1.1"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@expo/webpack-config": "^0.7.12",
"@types/react": "^16.9.4",
"@types/react-native": "^0.60.17",
"@types/react-native": "^0.60.19",
"babel-preset-expo": "^7.0.0",
"expo-cli": "^3.1.2",
"expo-cli": "^3.3.0",
"jetifier": "^1.6.4",
"typescript": "^3.6.3"
}
}

View File

@@ -1,21 +1,24 @@
import * as React from 'react';
import { MaterialIcons } from '@expo/vector-icons';
import { MaterialCommunityIcons } from '@expo/vector-icons';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
// @ts-ignore
import TouchableBounce from 'react-native/Libraries/Components/Touchable/TouchableBounce';
import TouchableBounce from '../Shared/TouchableBounce';
import Albums from '../Shared/Albums';
import Contacts from '../Shared/Contacts';
import Chat from '../Shared/Chat';
import SimpleStackScreen from './SimpleStack';
const getTabBarIcon = (name: string) => ({
tintColor,
color,
horizontal,
}: {
tintColor: string;
color: string;
horizontal: boolean;
}) => (
<MaterialIcons name={name} color={tintColor} size={horizontal ? 17 : 24} />
<MaterialCommunityIcons
name={name}
color={color}
size={horizontal ? 17 : 24}
/>
);
type BottomTabParams = {
@@ -34,7 +37,7 @@ export default function BottomTabsScreen() {
name="article"
options={{
title: 'Article',
tabBarIcon: getTabBarIcon('chrome-reader-mode'),
tabBarIcon: getTabBarIcon('file-document-box'),
tabBarButtonComponent: TouchableBounce,
}}
>
@@ -47,7 +50,7 @@ export default function BottomTabsScreen() {
component={Chat}
options={{
title: 'Chat',
tabBarIcon: getTabBarIcon('chat-bubble'),
tabBarIcon: getTabBarIcon('message-reply'),
tabBarButtonComponent: TouchableBounce,
}}
/>
@@ -65,7 +68,7 @@ export default function BottomTabsScreen() {
component={Albums}
options={{
title: 'Albums',
tabBarIcon: getTabBarIcon('photo-album'),
tabBarIcon: getTabBarIcon('image-album'),
tabBarButtonComponent: TouchableBounce,
}}
/>

View File

@@ -24,7 +24,7 @@ export default function MaterialBottomTabsScreen() {
name="article"
options={{
tabBarLabel: 'Article',
tabBarIcon: 'chrome-reader-mode',
tabBarIcon: 'file-document-box',
tabBarColor: '#C9E7F8',
}}
>
@@ -37,7 +37,7 @@ export default function MaterialBottomTabsScreen() {
component={Chat}
options={{
tabBarLabel: 'Chat',
tabBarIcon: 'chat-bubble',
tabBarIcon: 'message-reply',
tabBarColor: '#9FD5C9',
tabBarBadge: true,
}}
@@ -56,7 +56,7 @@ export default function MaterialBottomTabsScreen() {
component={Albums}
options={{
tabBarLabel: 'Albums',
tabBarIcon: 'photo-album',
tabBarIcon: 'image-album',
tabBarColor: '#FAD4D6',
}}
/>

View File

@@ -0,0 +1,23 @@
import * as React from 'react';
import { View, Text, StyleSheet } from 'react-native';
export default function NativeStack() {
return (
<View style={styles.container}>
<Text style={styles.text}>Currently not supported on Expo :(</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#eceff1',
},
text: {
fontSize: 16,
color: '#999',
},
});

View File

@@ -0,0 +1,138 @@
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
import { Button } from 'react-native-paper';
// eslint-disable-next-line import/no-unresolved
import { useScreens } from 'react-native-screens';
import {
RouteProp,
ParamListBase,
useFocusEffect,
} from '@react-navigation/core';
import { DrawerNavigationProp } from '@react-navigation/drawer';
import { StackNavigationProp } from '@react-navigation/stack';
import {
createNativeStackNavigator,
NativeStackNavigationProp,
} from '@react-navigation/native-stack';
import Article from '../Shared/Article';
import Albums from '../Shared/Albums';
type NativeStackParams = {
article: { author: string };
album: undefined;
};
type NativeStackNavigation = NativeStackNavigationProp<NativeStackParams>;
const ArticleScreen = ({
navigation,
route,
}: {
navigation: NativeStackNavigation;
route: RouteProp<NativeStackParams, 'article'>;
}) => (
<React.Fragment>
<View style={styles.buttons}>
<Button
mode="contained"
onPress={() => navigation.push('album')}
style={styles.button}
>
Push album
</Button>
<Button
mode="outlined"
onPress={() => navigation.goBack()}
style={styles.button}
>
Go back
</Button>
</View>
<Article author={{ name: route.params.author }} />
</React.Fragment>
);
const AlbumsScreen = ({
navigation,
}: {
navigation: NativeStackNavigation;
}) => (
<React.Fragment>
<View style={styles.buttons}>
<Button
mode="contained"
onPress={() => navigation.push('article', { author: 'Babel fish' })}
style={styles.button}
>
Push article
</Button>
<Button
mode="outlined"
onPress={() => navigation.goBack()}
style={styles.button}
>
Go back
</Button>
</View>
<Albums />
</React.Fragment>
);
const NativeStack = createNativeStackNavigator<NativeStackParams>();
type Props = {
navigation: StackNavigationProp<ParamListBase>;
};
export default function NativeStackScreen({ navigation }: Props) {
navigation.setOptions({
headerShown: false,
});
useFocusEffect(
React.useCallback(() => {
const drawer = navigation.dangerouslyGetParent() as DrawerNavigationProp<
ParamListBase
>;
navigation.setOptions({ gestureEnabled: false });
drawer.setOptions({ drawerLockMode: 'locked-closed' });
return () => {
navigation.setOptions({ gestureEnabled: true });
drawer.setOptions({ drawerLockMode: 'unlocked' });
};
}, [navigation])
);
return (
<NativeStack.Navigator>
<NativeStack.Screen
name="article"
component={ArticleScreen}
options={({ route }) => ({
title: `Article by ${route.params.author}`,
})}
initialParams={{ author: 'Gandalf' }}
/>
<NativeStack.Screen
name="album"
component={AlbumsScreen}
options={{ title: 'Album' }}
/>
</NativeStack.Navigator>
);
}
// eslint-disable-next-line react-hooks/rules-of-hooks
useScreens(true);
const styles = StyleSheet.create({
buttons: {
flexDirection: 'row',
padding: 8,
},
button: {
margin: 8,
},
});

View File

@@ -5,6 +5,7 @@ import { RouteProp, ParamListBase } from '@react-navigation/core';
import {
createStackNavigator,
StackNavigationProp,
StackNavigationOptions,
} from '@react-navigation/stack';
import Article from '../Shared/Article';
import Albums from '../Shared/Albums';
@@ -77,7 +78,7 @@ const AlbumsScreen = ({
const SimpleStack = createStackNavigator<SimpleStackParams>();
type Props = {
options?: React.ComponentProps<typeof SimpleStack.Navigator>;
options?: StackNavigationOptions;
navigation: StackNavigationProp<ParamListBase>;
};

View File

@@ -28,6 +28,10 @@ export default function Albums() {
// eslint-disable-next-line react/no-array-index-key
<Image key={i} source={source} style={styles.cover} />
))}
{COVERS.map((source, i) => (
// eslint-disable-next-line react/no-array-index-key
<Image key={i + 'F'} source={source} style={styles.cover} />
))}
</ScrollView>
);
}

View File

@@ -0,0 +1,4 @@
// @ts-ignore
import TouchableBounce from 'react-native/Libraries/Components/Touchable/TouchableBounce';
export default TouchableBounce;

View File

@@ -0,0 +1,3 @@
import { TouchableOpacity } from 'react-native';
export default TouchableOpacity;

View File

@@ -1,6 +1,6 @@
import * as React from 'react';
import { ScrollView, AsyncStorage, YellowBox } from 'react-native';
import LinkingPrefixes from './LinkingPrefixes';
import { MaterialIcons } from '@expo/vector-icons';
import { Appbar, List } from 'react-native-paper';
import { Asset } from 'expo-asset';
import {
@@ -22,7 +22,9 @@ import {
StackNavigationProp,
} from '@react-navigation/stack';
import LinkingPrefixes from './LinkingPrefixes';
import SimpleStack from './Screens/SimpleStack';
import NativeStack from './Screens/NativeStack';
import ModalPresentationStack from './Screens/ModalPresentationStack';
import BottomTabs from './Screens/BottomTabs';
import MaterialTopTabsScreen from './Screens/MaterialTopTabs';
@@ -33,17 +35,19 @@ import CompatAPI from './Screens/CompatAPI';
YellowBox.ignoreWarnings(['Require cycle:', 'Warning: Async Storage']);
type RootDrawerParamList = {
root: undefined;
Root: undefined;
Another: undefined;
};
type RootStackParamList = {
home: undefined;
Home: undefined;
} & {
[P in keyof typeof SCREENS]: undefined;
};
const SCREENS = {
SimpleStack: { title: 'Simple Stack', component: SimpleStack },
NativeStack: { title: 'Native Stack', component: NativeStack },
ModalPresentationStack: {
title: 'Modal Presentation Stack',
component: ModalPresentationStack,
@@ -139,7 +143,15 @@ export default function App() {
}
>
<Drawer.Navigator>
<Drawer.Screen name="root" options={{ title: 'Examples' }}>
<Drawer.Screen
name="Root"
options={{
title: 'Examples',
drawerIcon: ({ size, color }) => (
<MaterialIcons size={size} color={color} name="folder" />
),
}}
>
{({
navigation,
}: {
@@ -147,7 +159,7 @@ export default function App() {
}) => (
<Stack.Navigator>
<Stack.Screen
name="home"
name="Home"
options={{
title: 'Examples',
headerLeft: () => (

View File

@@ -0,0 +1,50 @@
const path = require('path');
const fs = require('fs');
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
// eslint-disable-next-line import/no-extraneous-dependencies
const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
module.exports = async function(env, argv) {
const config = await createExpoWebpackConfigAsync(env, argv);
config.module.rules.push({
test: /\.(js|ts|tsx)$/,
include: /packages\/.+/,
use: 'babel-loader',
});
config.resolve.plugins = config.resolve.plugins.filter(
p => !(p instanceof ModuleScopePlugin)
);
config.resolve.alias['react'] = path.resolve(
__dirname,
'node_modules',
'react'
);
config.resolve.alias['react-native'] = path.resolve(
__dirname,
'node_modules',
'react-native-web'
);
config.resolve.alias['react-native-web'] = path.resolve(
__dirname,
'node_modules',
'react-native-web'
);
config.resolve.alias[
'@expo/vector-icons/MaterialCommunityIcons'
] = require.resolve('@expo/vector-icons/MaterialCommunityIcons');
fs.readdirSync(path.join(__dirname, '..')).forEach(name => {
config.resolve.alias[`@react-navigation/${name}`] = path.resolve(
__dirname,
'..',
name,
'src'
);
});
return config;
};

View File

@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.13](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-bottom-tabs@5.0.0-alpha.12...@react-navigation/material-bottom-tabs@5.0.0-alpha.13) (2019-10-15)
### Bug Fixes
* make it possible to run the example on web ([7a901af](https://github.com/react-navigation/navigation-ex/commit/7a901af))
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.12](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-bottom-tabs@5.0.0-alpha.11...@react-navigation/material-bottom-tabs@5.0.0-alpha.12) (2019-10-06)
**Note:** Version bump only for package @react-navigation/material-bottom-tabs

View File

@@ -27,7 +27,7 @@ export default function App() {
component={Article}
options={{
tabBarLabel: 'Article',
tabBarIcon: 'chrome-reader-mode',
tabBarIcon: 'file-document-box',
}}
/>
<MaterialBottomTabs.Screen
@@ -35,7 +35,7 @@ export default function App() {
component={Chat}
options={{
tabBarLabel: 'Chat',
tabBarIcon: 'chat-bubble',
tabBarIcon: 'message-reply',
}}
/>
<MaterialBottomTabs.Screen
@@ -51,7 +51,7 @@ export default function App() {
component={Albums}
options={{
tabBarLabel: 'Albums',
tabBarIcon: 'photo-album',
tabBarIcon: 'image-album',
}}
/>
</MaterialBottomTabs.Navigator>

View File

@@ -11,7 +11,7 @@
"material",
"tab"
],
"version": "5.0.0-alpha.12",
"version": "5.0.0-alpha.13",
"license": "MIT",
"repository": {
"type": "git",
@@ -42,8 +42,8 @@
"@types/react-native": "^0.60.17",
"@types/react-native-vector-icons": "^6.4.4",
"del-cli": "^3.0.0",
"react": "16.8.3",
"react-native": "0.59.10",
"react": "~16.8.3",
"react-native": "~0.59.10",
"react-native-paper": "^3.0.0-alpha.3",
"react-native-vector-icons": "^6.6.0",
"typescript": "^3.6.3"

View File

@@ -60,7 +60,7 @@ export type MaterialBottomTabNavigationOptions = {
/**
* String referring to an icon in the `MaterialCommunityIcons` set, or a
* function that given { focused: boolean, tintColor: string } returns a React.Node to display in the navigation bar.
* function that given { focused: boolean, color: string } returns a React.Node to display in the navigation bar.
*/
tabBarIcon?:
| string

View File

@@ -1,7 +1,7 @@
import * as React from 'react';
import { StyleSheet } from 'react-native';
import { BottomNavigation } from 'react-native-paper';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialIcons';
import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
import { Route } from '@react-navigation/core';
import { TabNavigationState, TabActions } from '@react-navigation/routers';

View File

@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.12](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-top-tabs@5.0.0-alpha.11...@react-navigation/material-top-tabs@5.0.0-alpha.12) (2019-10-15)
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.11](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/material-top-tabs@5.0.0-alpha.10...@react-navigation/material-top-tabs@5.0.0-alpha.11) (2019-10-06)
**Note:** Version bump only for package @react-navigation/material-top-tabs

View File

@@ -11,7 +11,7 @@
"material",
"tab"
],
"version": "5.0.0-alpha.11",
"version": "5.0.0-alpha.12",
"license": "MIT",
"repository": {
"type": "git",
@@ -41,8 +41,8 @@
"@types/react": "^16.9.4",
"@types/react-native": "^0.60.17",
"del-cli": "^3.0.0",
"react": "16.8.3",
"react-native": "^0.59.10",
"react": "~16.8.3",
"react-native": "~0.59.10",
"react-native-gesture-handler": "^1.3.0",
"react-native-reanimated": "^1.3.0",
"react-native-tab-view": "^2.10.0",

View File

@@ -64,19 +64,19 @@ export type MaterialTopTabNavigationOptions = {
/**
* Title string of a tab displayed in the tab bar or React Element
* or a function that given { focused: boolean, tintColor: string } returns a React.Node, to display in tab bar.
* or a function that given { focused: boolean, color: string } returns a React.Node, to display in tab bar.
* When undefined, scene title is used. To hide, see tabBarOptions.showLabel in the previous section.
*/
tabBarLabel?:
| React.ReactNode
| ((props: { focused: boolean; tintColor: string }) => React.ReactNode);
| ((props: { focused: boolean; color: string }) => React.ReactNode);
/**
* React Element or a function that given { focused: boolean, tintColor: string } returns a React.Node, to display in the tab bar.
* React Element or a function that given { focused: boolean, color: string } returns a React.Node, to display in the tab bar.
*/
tabBarIcon?:
| React.ReactNode
| ((props: { focused: boolean; tintColor: string }) => React.ReactNode);
| ((props: { focused: boolean; color: string }) => React.ReactNode);
/**
* Accessibility label for the tab button. This is read by the screen reader when the user taps the tab.
@@ -196,7 +196,7 @@ export type MaterialTopTabBarProps = MaterialTopTabBarOptions &
getLabelText: (props: {
route: Route<string>;
}) =>
| ((scene: { focused: boolean; tintColor: string }) => React.ReactNode)
| ((scene: { focused: boolean; color: string }) => React.ReactNode)
| React.ReactNode;
getAccessibilityLabel: (props: {
route: Route<string>;

View File

@@ -53,7 +53,7 @@ export default class TabBarTop extends React.PureComponent<
}
if (typeof label === 'function') {
return label({ focused, tintColor: color });
return label({ focused, color });
}
return label;
@@ -79,7 +79,7 @@ export default class TabBarTop extends React.PureComponent<
if (options.tabBarIcon !== undefined) {
const icon =
typeof options.tabBarIcon === 'function'
? options.tabBarIcon({ focused, tintColor: color })
? options.tabBarIcon({ focused, color })
: options.tabBarIcon;
return <View style={[styles.icon, iconStyle]}>{icon}</View>;

View File

@@ -0,0 +1,17 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# 5.0.0-alpha.1 (2019-10-15)
### Bug Fixes
* increase hitSlop of back button on Android ([c7da1e4](https://github.com/react-navigation/navigation-ex/commit/c7da1e4))
* update supported options for native stack ([b71f4e5](https://github.com/react-navigation/navigation-ex/commit/b71f4e5))
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))

View File

@@ -0,0 +1,64 @@
# `@react-navigation/native-stack`
Stack navigator for React Native using native primitives for navigation. Uses [`react-native-screens`](https://github.com/kmagiera/react-native-screens) under the hood.
Expo is currently not supported as it includes an older version of `react-native-screens`.
## Installation
Open a Terminal in your project's folder and run,
```sh
yarn add @react-navigation/core @react-navigation/native-stack
```
Now we need to install [`react-native-screens`](https://github.com/kmagiera/react-native-screens).
```sh
yarn add react-native-screens
```
To complete the linking on iOS, make sure you have [Cocoapods](https://cocoapods.org/) installed. Then run:
```sh
cd ios
pod install
cd ..
```
To finalize installation of `react-native-screens` for Android, add the following two lines to dependencies section in `android/app/build.gradle`:
```gradle
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
```
Make sure to enable `react-native-screens`. This needs to be done before our app renders. To do it, add the following code in your entry file (e.g. `App.js`):
```js
import { useScreens } from 'react-native-screens';
useScreens();
```
## Usage
```js
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
export default function App() {
return (
<Stack.Navigator>
<Stack.Screen name="home" component={Home} options={{ title: 'Home' }} />
<Stack.Screen name="feed" component={Feed} options={{ title: 'Feed' }} />
<Stack.Screen
name="profile"
component={Profile}
options={{ title: 'Profile' }}
/>
</Stack.Navigator>
);
}
```

View File

@@ -0,0 +1,55 @@
{
"name": "@react-navigation/native-stack",
"description": "Native stack navigator component for iOS and Android",
"keywords": [
"react",
"react-native",
"react-navigation"
],
"version": "5.0.0-alpha.1",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/react-navigation/navigation-ex.git",
"directory": "packages/native-stack"
},
"main": "lib/commonjs/index.js",
"react-native": "src/index.tsx",
"module": "lib/module/index.js",
"types": "lib/typescript/native-stack/src/index.d.ts",
"files": [
"src",
"lib"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"prepare": "bob build",
"clean": "del lib"
},
"dependencies": {
"@react-navigation/routers": "^5.0.0-alpha.9"
},
"devDependencies": {
"@react-native-community/bob": "^0.7.0",
"del-cli": "^2.0.0",
"react-native-screens": "^2.0.0-alpha.3",
"typescript": "^3.5.3"
},
"peerDependencies": {
"@react-navigation/core": "^5.0.0-alpha.0",
"react": "*",
"react-native": "*",
"react-native-screens": "^2.0.0-alpha.3"
},
"@react-native-community/bob": {
"source": "src",
"output": "lib",
"targets": [
"commonjs",
"module",
"typescript"
]
}
}

View File

@@ -0,0 +1,14 @@
/**
* Navigators
*/
export {
default as createNativeStackNavigator,
} from './navigators/createNativeStackNavigator';
/**
* Types
*/
export {
NativeStackNavigationOptions,
NativeStackNavigationProp,
} from './types';

View File

@@ -0,0 +1,52 @@
import React from 'react';
import { createNavigator, useNavigationBuilder } from '@react-navigation/core';
import {
StackRouter,
StackNavigationState,
StackRouterOptions,
} from '@react-navigation/routers';
import {
screensEnabled,
// eslint-disable-next-line import/no-unresolved
} from 'react-native-screens';
import StackView from '../views/StackView';
import {
NativeStackNavigatorProps,
NativeStackNavigationOptions,
} from '../types';
function NativeStackNavigator(props: NativeStackNavigatorProps) {
if (!screensEnabled()) {
throw new Error(
'Native stack is only available if React Native Screens is enabled.'
);
}
const { initialRouteName, children, screenOptions, ...rest } = props;
const { state, descriptors, navigation } = useNavigationBuilder<
StackNavigationState,
StackRouterOptions,
NativeStackNavigationOptions,
{}
>(StackRouter, {
initialRouteName,
children,
screenOptions,
});
return (
<StackView
state={state}
navigation={navigation}
descriptors={descriptors}
{...rest}
/>
);
}
export default createNavigator<
NativeStackNavigationOptions,
typeof NativeStackNavigator
>(NativeStackNavigator);

View File

@@ -0,0 +1,178 @@
import * as React from 'react';
import { StyleProp, ViewStyle } from 'react-native';
import {
DefaultNavigatorOptions,
Descriptor,
NavigationHelpers,
NavigationProp,
ParamListBase,
} from '@react-navigation/core';
import {
StackNavigationState,
StackRouterOptions,
} from '@react-navigation/routers';
export type NativeStackNavigationProp<
ParamList extends ParamListBase,
RouteName extends keyof ParamList = string
> = NavigationProp<
ParamList,
RouteName,
StackNavigationState,
NativeStackNavigationOptions,
{}
> & {
/**
* Push a new screen onto the stack.
*
* @param name Name of the route for the tab.
* @param [params] Params object for the route.
*/
push<RouteName extends keyof ParamList>(
...args: ParamList[RouteName] extends (undefined | any)
? [RouteName] | [RouteName, ParamList[RouteName]]
: [RouteName, ParamList[RouteName]]
): void;
/**
* Pop a screen from the stack.
*/
pop(count?: number): void;
/**
* Pop to the first route in the stack, dismissing all other screens.
*/
popToTop(): void;
};
export type NativeStackNavigationHelpers = NavigationHelpers<ParamListBase, {}>;
export type NativeStackNavigationConfig = {};
export type NativeStackNavigationOptions = {
/**
* String that can be displayed in the header as a fallback for `headerTitle`.
*/
title?: string;
/**
* String to display in the header as title. Defaults to scene `title`.
*/
headerTitle?: string;
/**
* Title to display in the back button.
* Only supported on iOS.
*
* @platform ios
*/
headerBackTitle?: string;
/**
* Whether to show the header.
*/
headerShown?: boolean;
/**
* Boolean indicating whether the navigation bar is translucent.
* Only supported on iOS.
*
* @platform ios
*/
headerTranslucent?: boolean;
/**
* Boolean to set native property to prefer large title header (like in iOS setting).
* Only supported on iOS.
*
* @platform ios
*/
headerLargeTitle?: boolean;
/**
* Function which returns a React Element to display on the right side of the header.
*/
headerRight?: () => React.ReactNode;
/**
* Tint color for the header. Changes the color of back button and title.
*/
headerTintColor?: string;
/**
* Boolean indicating whether to hide the back button in header.
* Only supported on Android.
*
* @platform android
*/
headerHideBackButton?: boolean;
/**
* Boolean indicating whether to hide the elevation shadow on the header.
* Only supported on Android.
*
* @platform android
*/
headerHideShadow?: boolean;
/**
* Style object for header title. Supported properties:
* - backgroundColor
*/
headerStyle?: {
backgroundColor?: string;
};
/**
* Style object for header title. Supported properties:
* - fontFamily
* - fontSize
* - color
*/
headerTitleStyle?: {
fontFamily?: string;
fontSize?: number;
color?: string;
};
/**
* Style object for header back title. Supported properties:
* - fontFamily
* - fontSize
*
* Only supported on iOS.
*
* @platform ios
*/
headerBackTitleStyle?: {
fontFamily?: string;
fontSize?: number;
};
/**
* Style object for the scene content.
*/
contentStyle?: StyleProp<ViewStyle>;
/**
* Whether you can use gestures to dismiss this screen. Defaults to `true`.
* Only supported on iOS.
*
* @platform ios
*/
gestureEnabled?: boolean;
/**
* How should the screen be presented.
*/
presentation?: 'modal' | 'transparentModal' | 'push';
/**
* How should the screen should be animated.
* Only supported on Android.
*
* @platform android
*/
animation?: 'default' | 'fade' | 'none';
};
export type NativeStackNavigatorProps = DefaultNavigatorOptions<
NativeStackNavigationOptions
> &
StackRouterOptions &
NativeStackNavigationConfig;
export type NativeStackDescriptor = Descriptor<
ParamListBase,
string,
StackNavigationState,
NativeStackNavigationOptions
>;
export type NativeStackDescriptorMap = {
[key: string]: NativeStackDescriptor;
};

View File

@@ -0,0 +1,68 @@
import * as React from 'react';
import {
// @ts-ignore
ScreenStackHeaderConfig,
// @ts-ignore
ScreenStackHeaderRightView,
// eslint-disable-next-line import/no-unresolved
} from 'react-native-screens';
import { Route } from '@react-navigation/core';
import { NativeStackNavigationOptions } from '../types';
type Props = NativeStackNavigationOptions & {
route: Route<string>;
};
export default function HeaderConfig(props: Props) {
const {
route,
title,
headerRight,
headerTitle,
headerBackTitle,
headerHideBackButton,
headerHideShadow,
headerTintColor,
headerLargeTitle,
headerTranslucent,
headerStyle = {},
headerTitleStyle = {},
headerBackTitleStyle = {},
headerShown,
gestureEnabled,
} = props;
return (
<ScreenStackHeaderConfig
hidden={headerShown === false}
translucent={headerTranslucent === true}
hideShadow={headerHideShadow}
hideBackButton={headerHideBackButton}
title={
headerTitle !== undefined
? headerTitle
: title !== undefined
? title
: route.name
}
titleFontFamily={headerTitleStyle.fontFamily}
titleFontSize={headerTitleStyle.fontFamily}
titleColor={
headerTitleStyle.color !== undefined
? headerTitleStyle.color
: headerTintColor
}
backTitle={headerBackTitle}
backTitleFontFamily={headerBackTitleStyle.fontFamily}
backTitleFontSize={headerBackTitleStyle.fontSize}
color={headerTintColor}
gestureEnabled={gestureEnabled === undefined ? true : gestureEnabled}
largeTitle={headerLargeTitle}
backgroundColor={headerStyle.backgroundColor}
>
{headerRight !== undefined ? (
<ScreenStackHeaderRightView>{headerRight()}</ScreenStackHeaderRightView>
) : null}
</ScreenStackHeaderConfig>
);
}

View File

@@ -0,0 +1,63 @@
import * as React from 'react';
import { View, StyleSheet, Platform } from 'react-native';
import { StackNavigationState, StackActions } from '@react-navigation/routers';
import {
// @ts-ignore
ScreenStack,
Screen,
// eslint-disable-next-line import/no-unresolved
} from 'react-native-screens';
import HeaderConfig from './HeaderConfig';
import {
NativeStackNavigationHelpers,
NativeStackDescriptorMap,
} from '../types';
type Props = {
state: StackNavigationState;
navigation: NativeStackNavigationHelpers;
descriptors: NativeStackDescriptorMap;
};
export default function StackView({ state, navigation, descriptors }: Props) {
return (
<ScreenStack style={styles.scenes}>
{state.routes.map(route => {
const { options, render: renderScene } = descriptors[route.key];
const { presentation = 'push', animation, contentStyle } = options;
return (
// @ts-ignore
<Screen
key={route.key}
style={StyleSheet.absoluteFill}
stackPresentation={presentation}
stackAnimation={animation}
onDismissed={() => {
navigation.dispatch({
...StackActions.pop(),
source: route.key,
target: state.key,
});
}}
>
<HeaderConfig {...options} route={route} />
<View style={[styles.content, contentStyle]}>{renderScene()}</View>
</Screen>
);
})}
</ScreenStack>
);
}
const styles = StyleSheet.create({
content: {
flex: 1,
backgroundColor: '#eee',
marginTop: Platform.OS === 'android' ? 56 : 0,
},
scenes: {
flex: 1,
},
});

View File

@@ -0,0 +1,3 @@
{
"extends": "../../tsconfig"
}

View File

@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.12](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/native@5.0.0-alpha.11...@react-navigation/native@5.0.0-alpha.12) (2019-10-15)
### Features
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.11](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/native@5.0.0-alpha.10...@react-navigation/native@5.0.0-alpha.11) (2019-10-06)
**Note:** Version bump only for package @react-navigation/native

View File

@@ -7,7 +7,7 @@
"ios",
"android"
],
"version": "5.0.0-alpha.11",
"version": "5.0.0-alpha.12",
"license": "MIT",
"repository": {
"type": "git",
@@ -34,8 +34,8 @@
"@types/react": "^16.9.4",
"@types/react-native": "^0.60.17",
"del-cli": "^3.0.0",
"react": "16.8.3",
"react-native": "0.59.10",
"react": "~16.8.3",
"react-native": "~0.59.10",
"typescript": "^3.6.3"
},
"peerDependencies": {

View File

@@ -3,6 +3,27 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [5.0.0-alpha.25](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/stack@5.0.0-alpha.24...@react-navigation/stack@5.0.0-alpha.25) (2019-10-15)
### Bug Fixes
* don't ignore descriptors change ([9d9fe31](https://github.com/react-navigation/navigation-ex/commit/9d9fe31))
* increase hitSlop of back button on Android ([c7da1e4](https://github.com/react-navigation/navigation-ex/commit/c7da1e4))
* interpolation in iOS modal presentation ([b32cda2](https://github.com/react-navigation/navigation-ex/commit/b32cda2))
* make modal presentation mode fullscreen on landscape ([#124](https://github.com/react-navigation/navigation-ex/issues/124)) ([e789846](https://github.com/react-navigation/navigation-ex/commit/e789846))
### Features
* add a headerTitleAlign option to center or left align title ([6a0ca90](https://github.com/react-navigation/navigation-ex/commit/6a0ca90))
* export TransitionSpecs ([708dde0](https://github.com/react-navigation/navigation-ex/commit/708dde0))
* initial version of native stack ([#102](https://github.com/react-navigation/navigation-ex/issues/102)) ([ba3f718](https://github.com/react-navigation/navigation-ex/commit/ba3f718))
# [5.0.0-alpha.24](https://github.com/react-navigation/navigation-ex/compare/@react-navigation/stack@5.0.0-alpha.23...@react-navigation/stack@5.0.0-alpha.24) (2019-10-06)

View File

@@ -1,6 +1,6 @@
# `@react-navigation/stack`
Bottom tab navigator for React Navigation following iOS design guidelines.
Stack navigator for React Navigation.
## Installation

View File

@@ -10,7 +10,7 @@
"android",
"stack"
],
"version": "5.0.0-alpha.24",
"version": "5.0.0-alpha.25",
"license": "MIT",
"repository": {
"type": "git",
@@ -41,12 +41,12 @@
"@types/react": "^16.9.4",
"@types/react-native": "^0.60.17",
"del-cli": "^3.0.0",
"react": "16.8.3",
"react-native": "0.59.10",
"react": "~16.8.3",
"react-native": "~0.59.10",
"react-native-gesture-handler": "^1.3.0",
"react-native-reanimated": "^1.3.0",
"react-native-safe-area-context": "^0.3.6",
"react-native-screens": "^1.0.0-alpha.22",
"react-native-screens": "^2.0.0-alpha.3",
"typescript": "^3.6.3"
},
"peerDependencies": {
@@ -57,7 +57,7 @@
"react-native-gesture-handler": "^1.0.0",
"react-native-reanimated": "^1.0.0",
"react-native-safe-area-context": "^0.3.6",
"react-native-screens": "^1.0.0-alpha.0"
"react-native-screens": "^1.0.0-alpha.0 || ^2.0.0-alpha.3"
},
"@react-native-community/bob": {
"source": "src",

View File

@@ -85,7 +85,8 @@ export function forModalPresentationIOS({
layouts: { screen },
insets,
}: StackCardInterpolationProps): StackCardInterpolatedStyle {
const topOffset = 10;
const isLandscape = screen.width > screen.height;
const topOffset = isLandscape ? 0 : 10;
const statusBarHeight = insets.top;
const aspectRatio = screen.height / screen.width;
@@ -101,22 +102,29 @@ export function forModalPresentationIOS({
});
const overlayOpacity = interpolate(progress, {
inputRange: [0, 1, 2],
outputRange: [0, 0.3, 1],
inputRange: [0, 1, 1.0001, 2],
outputRange: [0, 0.3, 1, 1],
});
const scale = interpolate(progress, {
inputRange: [0, 1, 2],
outputRange: [1, 1, screen.width ? 1 - (topOffset * 2) / screen.width : 1],
});
const scale = isLandscape
? 1
: interpolate(progress, {
inputRange: [0, 1, 2],
outputRange: [
1,
1,
screen.width ? 1 - (topOffset * 2) / screen.width : 1,
],
});
const borderRadius =
index === 0
? interpolate(progress, {
inputRange: [0, 1, 2],
outputRange: [0, 0, 10],
})
: 10;
const borderRadius = isLandscape
? 0
: index === 0
? interpolate(progress, {
inputRange: [0, 1, 2],
outputRange: [0, 0, 10],
})
: 10;
return {
cardStyle: {

View File

@@ -1,5 +1,6 @@
import * as CardStyleInterpolators from './TransitionConfigs/CardStyleInterpolators';
import * as HeaderStyleInterpolators from './TransitionConfigs/HeaderStyleInterpolators';
import * as TransitionSpecs from './TransitionConfigs/TransitionSpecs';
import * as TransitionPresets from './TransitionConfigs/TransitionPresets';
/**
@@ -24,7 +25,12 @@ export { default as HeaderBackButton } from './views/Header/HeaderBackButton';
/**
* Transition presets
*/
export { CardStyleInterpolators, HeaderStyleInterpolators, TransitionPresets };
export {
CardStyleInterpolators,
HeaderStyleInterpolators,
TransitionSpecs,
TransitionPresets,
};
/**
* Utilities

View File

@@ -107,6 +107,11 @@ export type StackHeaderOptions = {
* The title string is passed in `children`.
*/
headerTitle?: string | ((props: StackHeaderTitleProps) => React.ReactNode);
/**
* How to align the the header title.
* Defaults to `center` on iOS and `left` on Android.
*/
headerTitleAlign?: 'left' | 'center';
/**
* Style object for the title component.
*/

View File

@@ -170,7 +170,7 @@ class HeaderBackButton extends React.Component<Props, State> {
style={[styles.container, disabled && styles.disabled]}
hitSlop={Platform.select({
ios: undefined,
default: { top: 8, right: 8, bottom: 8, left: 8 },
default: { top: 16, right: 16, bottom: 16, left: 16 },
})}
borderless
>

View File

@@ -141,6 +141,10 @@ export default class HeaderSegment extends React.Component<Props, State> {
leftLabel: previousTitle,
onGoBack,
headerTitle,
headerTitleAlign = Platform.select({
ios: 'center',
default: 'left',
}),
headerLeft: left = onGoBack
? (props: StackHeaderLeftButtonProps) => <HeaderBackButton {...props} />
: undefined,
@@ -324,11 +328,10 @@ export default class HeaderSegment extends React.Component<Props, State> {
<Animated.View
pointerEvents="box-none"
style={[
Platform.select({
ios: null,
default: { left: leftButton ? 72 : 16 },
}),
styles.title,
headerTitleAlign === 'left' && {
position: 'absolute',
left: leftButton ? 72 : 16,
},
titleStyle,
titleContainerStyle,
]}
@@ -384,8 +387,4 @@ const styles = StyleSheet.create({
justifyContent: 'center',
alignItems: 'flex-end',
},
title: Platform.select({
ios: {},
default: { position: 'absolute' },
}),
});

View File

@@ -32,6 +32,8 @@ type State = {
routes: Route<string>[];
// Previous routes, to compare whether routes have changed or not
previousRoutes: Route<string>[];
// Previous descriptors, to compare whether descriptors have changed or not
previousDescriptors: StackDescriptorMap;
// List of routes being opened, we need to animate pushing of these new routes
openingRouteKeys: string[];
// List of routes being closed, we need to animate popping of these routes
@@ -50,6 +52,23 @@ class StackView extends React.Component<Props, State> {
) {
// If there was no change in routes, we don't need to compute anything
if (props.state.routes === state.previousRoutes && state.routes.length) {
if (props.descriptors !== state.previousDescriptors) {
const descriptors = state.routes.reduce(
(acc, route) => {
acc[route.key] =
props.descriptors[route.key] || state.descriptors[route.key];
return acc;
},
{} as StackDescriptorMap
);
return {
previousDescriptors: props.descriptors,
descriptors,
};
}
return null;
}
@@ -189,6 +208,7 @@ class StackView extends React.Component<Props, State> {
return {
routes,
previousRoutes: props.state.routes,
previousDescriptors: props.descriptors,
openingRouteKeys,
closingRouteKeys,
replacingRouteKeys,
@@ -199,6 +219,7 @@ class StackView extends React.Component<Props, State> {
state: State = {
routes: [],
previousRoutes: [],
previousDescriptors: {},
openingRouteKeys: [],
closingRouteKeys: [],
replacingRouteKeys: [],

217
yarn.lock
View File

@@ -1097,23 +1097,23 @@
mv "~2"
safe-json-stringify "~1"
"@expo/config@^2.1.6":
version "2.1.6"
resolved "https://registry.yarnpkg.com/@expo/config/-/config-2.1.6.tgz#05144899e1438d7f125f5115c473f514ad8b39b9"
integrity sha512-P2tIT9rs2ljE8nC2cOclnlJtDdAhtnDsixHal4n3vGLzWHSJ6M/Zaa/F4BwoOBRe0D/+lB11P9vs85aFYWw3uw==
"@expo/config@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@expo/config/-/config-2.2.0.tgz#48febdc56cf44bbcd7a3ccca6d246c4e66151db3"
integrity sha512-QW01ga/M3z4jXqDCqdPlUflOHoBznb2saOFNeW9kVNhiSyh4Qv0yBekXcPNTQ9xPuYoOlGxMqh/uqKBimMYyuQ==
dependencies:
"@expo/json-file" "^8.1.12"
"@expo/json-file" "^8.2.0"
find-yarn-workspace-root "^1.2.1"
fs-extra "^7.0.1"
resolve-from "^5.0.0"
slugify "^1.3.4"
"@expo/dev-tools@^0.6.5":
version "0.6.5"
resolved "https://registry.yarnpkg.com/@expo/dev-tools/-/dev-tools-0.6.5.tgz#83110b39a39b895c573a72f17df5f751bf2d161d"
integrity sha512-H6EbiAQO1OHRUehYF8OYFQfXWPBb3GEBUhYsf+EljOOKlNFB/fiVD/HAdOReMZ/yxA27wHzgwTalqyd/FarQ3w==
"@expo/dev-tools@^0.6.6":
version "0.6.6"
resolved "https://registry.yarnpkg.com/@expo/dev-tools/-/dev-tools-0.6.6.tgz#6ea36ff2ddf8d40efc68e9f235d63e446979a90c"
integrity sha512-UF6GKNSBigwmwyt9y4niHyKemcq2inChnpKwJKL9kJJ4BiPGPheqswhMxZasNeyh4ds2vQmjU8jvUjQOsKDRsw==
dependencies:
"@expo/config" "^2.1.6"
"@expo/config" "^2.2.0"
base64url "3.0.1"
express "4.16.4"
freeport-async "1.1.1"
@@ -1133,10 +1133,10 @@
optionalDependencies:
sharp-cli "1.10.0"
"@expo/json-file@^8.1.12":
version "8.1.12"
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-8.1.12.tgz#f7128f0fc63f2726efd85a27e3c2e31193148d6c"
integrity sha512-TSn31UGQ5N40c5a4uyruxw0JAY40CUjjXdH5YeUyBSX1wqOth4YujHnGCuHyKH1ViSQQ+qinN2OpT+2294GV3g==
"@expo/json-file@^8.2.0":
version "8.2.0"
resolved "https://registry.yarnpkg.com/@expo/json-file/-/json-file-8.2.0.tgz#efb82b9a4e092aadb629451e60d0893369b7689e"
integrity sha512-Kr2zkZiPmBWq19yt36G9z24CXs4L3QHhHLJtDRvIcP53ErDlZ4yj4RqCmt1T00YezOcfwk1QMOcSzbEQX1qZxA==
dependencies:
"@babel/code-frame" "^7.0.0-beta.44"
fs-extra "^8.0.1"
@@ -1278,15 +1278,15 @@
dependencies:
lodash "^4.17.4"
"@expo/webpack-config@^0.7.11":
version "0.7.11"
resolved "https://registry.yarnpkg.com/@expo/webpack-config/-/webpack-config-0.7.11.tgz#f79e89bd336495651bed776958784947440b2cce"
integrity sha512-jOvqup4MR6hCIhtaNp4hwZI7PxzKg2jWIEKYQVCg5A9Eo1K2RWgi50BRvRT7xJ5/ZyNwOUSirzp6LYg4r+YuUg==
"@expo/webpack-config@^0.7.12":
version "0.7.12"
resolved "https://registry.yarnpkg.com/@expo/webpack-config/-/webpack-config-0.7.12.tgz#5b31e51b906101df81196c8519d2b23d97fff226"
integrity sha512-FIMtCZMvmJ37wTBXIfetCcdGb/h4f4ivYfRRbfCPK9jXFuUVIyKK5+V6Oc47AmMt49eFl7uAJUnkyvhgPmG0QA==
dependencies:
"@babel/core" "^7.0.0"
"@babel/runtime" "^7.3.4"
"@expo/config" "^2.1.6"
"@expo/webpack-pwa-manifest-plugin" "^1.2.6"
"@expo/config" "^2.2.0"
"@expo/webpack-pwa-manifest-plugin" "^1.2.7"
"@types/yup" "^0.26.24"
babel-loader "^8.0.5"
brotli-webpack-plugin "^1.1.0"
@@ -1321,12 +1321,12 @@
workbox-webpack-plugin "^3.6.3"
yup "^0.27.0"
"@expo/webpack-pwa-manifest-plugin@^1.2.6":
version "1.2.6"
resolved "https://registry.yarnpkg.com/@expo/webpack-pwa-manifest-plugin/-/webpack-pwa-manifest-plugin-1.2.6.tgz#095a51bc9d69502e5436ac258c2ebfed6514666b"
integrity sha512-GO2LiqOr/dS8xlDP5lpNqbWxqh/2eUn0QJ4neX7Y+psI+Eg9kAOrxAWDNOFAtaSo+lpLfT+hB/7DzXbWZ3FWHw==
"@expo/webpack-pwa-manifest-plugin@^1.2.7":
version "1.2.7"
resolved "https://registry.yarnpkg.com/@expo/webpack-pwa-manifest-plugin/-/webpack-pwa-manifest-plugin-1.2.7.tgz#cfee555f53ccc2745f9a2ed5185803ed8735292d"
integrity sha512-TdLXFYr4i8nNj/IbbU9DsL4Nxg3D0iGaakkNIscC3rcwphO2yLXQXqsbtIIP/9NU8EIzmC3VoeBN9IqUYd1AoQ==
dependencies:
"@expo/config" "^2.1.6"
"@expo/config" "^2.2.0"
"@expo/image-utils" "^0.2.6"
is-color "^1.0.2"
mime "^2.4.0"
@@ -1344,20 +1344,20 @@
pouchdb-collections "^1.0.1"
tiny-queue "^0.2.1"
"@expo/xdl@^56.2.7":
version "56.2.7"
resolved "https://registry.yarnpkg.com/@expo/xdl/-/xdl-56.2.7.tgz#fcbae6dc2ffd67257427a0a2f4e8d5736d741491"
integrity sha512-0IqbRLYAAzHdFCitinywFf4MSLEhNHs3RnFuoDIMPEsGeYhnlobUChdkcbNZ84q2+R1bH6yDf0/m2aFubmU95A==
"@expo/xdl@^56.3.0":
version "56.3.0"
resolved "https://registry.yarnpkg.com/@expo/xdl/-/xdl-56.3.0.tgz#cd7b04b1be76f11b513a6d3322525cb195df2e0f"
integrity sha512-XCouU2dtIKRERnC46P0MRDNw7FC8Hl8J31IM2jlE2B3IDBvs9F+qyXKBYpw0Ne+XIUJzY7PefQLpbRc3O2C4eQ==
dependencies:
"@expo/bunyan" "3.0.2"
"@expo/config" "^2.1.6"
"@expo/config" "^2.2.0"
"@expo/image-utils" "^0.2.6"
"@expo/json-file" "^8.1.12"
"@expo/json-file" "^8.2.0"
"@expo/ngrok" "2.4.3"
"@expo/osascript" "^2.0.6-alpha.0"
"@expo/schemer" "^1.2.8"
"@expo/spawn-async" "1.5.0"
"@expo/webpack-config" "^0.7.11"
"@expo/webpack-config" "^0.7.12"
"@types/webpack" "^4.32.1"
"@types/webpack-dev-server" "^3.1.7"
analytics-node "3.3.0"
@@ -1381,6 +1381,7 @@
idx "2.4.0"
indent-string "3.2.0"
inquirer "5.2.0"
internal-ip "4.3.0"
invariant "2.2.4"
joi "14.0.4"
latest-version "5.1.0"
@@ -2668,6 +2669,14 @@
"@types/prop-types" "*"
"@types/react" "*"
"@types/react-native@^0.60.19":
version "0.60.19"
resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.60.19.tgz#4d58516f9e981c3f477ad48727331e31a0792aae"
integrity sha512-1Qq1EQn/bi7dnsdrZJu0f9MK18KZrEmLGMfw3V9Im5As4uwFUTCIkD4LnFJkfQtRvtJQN1cOQri6MTqT7d9fkg==
dependencies:
"@types/prop-types" "*"
"@types/react" "*"
"@types/react@*", "@types/react@^16.9.4":
version "16.9.5"
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.9.5.tgz#079dabd918b19b32118c25fd00a786bb6d0d5e51"
@@ -3401,7 +3410,7 @@ array-filter@~0.0.0:
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
integrity sha1-fajPLiZijtcygDWB/SH2fKzS7uw=
array-find-index@^1.0.1:
array-find-index@^1.0.1, array-find-index@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=
@@ -5134,7 +5143,7 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
create-react-class@^15.6.3:
create-react-class@^15.6.2, create-react-class@^15.6.3:
version "15.6.3"
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036"
integrity sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==
@@ -5203,6 +5212,14 @@ css-declaration-sorter@^4.0.1:
postcss "^7.0.1"
timsort "^0.3.0"
css-in-js-utils@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/css-in-js-utils/-/css-in-js-utils-2.0.1.tgz#3b472b398787291b47cfe3e44fecfdd9e914ba99"
integrity sha512-PJF0SpJT+WdbVVt0AOYp9C8GnuruRlL/UFW7932nLWmFLQTaWEzTBQEx7/hn4BuV+WON75iAViSUJLiU3PKbpA==
dependencies:
hyphenate-style-name "^1.0.2"
isobject "^3.0.1"
css-loader@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-2.1.1.tgz#d8254f72e412bb2238bb44dd674ffbef497333ea"
@@ -5507,6 +5524,13 @@ dedent@^0.7.0:
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=
deep-assign@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/deep-assign/-/deep-assign-3.0.0.tgz#c8e4c4d401cba25550a2f0f486a2e75bc5f219a2"
integrity sha512-YX2i9XjJ7h5q/aQ/IM9PEwEnDqETAIYbggmdDB3HLTlSgo1CxPsj6pvhPG68rq6SVE0+p+6Ywsm5fTYNrYtBWw==
dependencies:
is-obj "^1.0.0"
deep-diff@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/deep-diff/-/deep-diff-1.0.2.tgz#afd3d1f749115be965e89c63edc7abb1506b9c26"
@@ -5606,6 +5630,14 @@ define-property@^2.0.2:
is-descriptor "^1.0.2"
isobject "^3.0.1"
del-cli@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/del-cli/-/del-cli-2.0.0.tgz#e9a778398863c26796d85409b9891f98b0122cd1"
integrity sha512-IREsO6mjSTxxvWLKMMUi1G0izhqEBx7qeDkOJ6H3+TJl8gQl6x5C5hK4Sm1GJ51KodUMR6O7HuIhnF24Edua3g==
dependencies:
del "^4.1.1"
meow "^5.0.0"
del-cli@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/del-cli/-/del-cli-3.0.0.tgz#327a15d4c18d6b7e5c849a53ef0d17901bc28197"
@@ -5626,7 +5658,7 @@ del@^3.0.0:
pify "^3.0.0"
rimraf "^2.2.8"
del@^4.1.0:
del@^4.1.0, del@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4"
integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==
@@ -6572,18 +6604,18 @@ expo-asset@~7.0.0:
path-browserify "^1.0.0"
url-parse "^1.4.4"
expo-cli@^3.1.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/expo-cli/-/expo-cli-3.2.2.tgz#2b85c4167392e40fd3c2e1228376ab8f39442f3b"
integrity sha512-p4n8Hyai/IcGdDTXc2+9Ravko+StOnxGS/g/uKxymvHH2/PCRL4biE4JW+a7dcSq5xjnjTAEmgSsRjIwI5oW6A==
expo-cli@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/expo-cli/-/expo-cli-3.3.0.tgz#8ee8ff5d3addc5386b321f5534306236813c1bd3"
integrity sha512-+3XThHXJdFSnm+eG3A44Myxb+K3i39tYyvtFVPsZcGCHBWFQQ2eepBzQyJlcnjRhe5/ElDMLrACAsV+9P5XB1Q==
dependencies:
"@expo/bunyan" "3.0.2"
"@expo/config" "^2.1.6"
"@expo/dev-tools" "^0.6.5"
"@expo/json-file" "^8.1.12"
"@expo/config" "^2.2.0"
"@expo/dev-tools" "^0.6.6"
"@expo/json-file" "^8.2.0"
"@expo/simple-spinner" "1.0.2"
"@expo/spawn-async" "1.5.0"
"@expo/xdl" "^56.2.7"
"@expo/xdl" "^56.3.0"
"@types/untildify" "^3.0.0"
ansi-regex "^4.1.0"
axios "0.19.0"
@@ -8206,6 +8238,11 @@ husky@^3.0.8:
run-node "^1.0.0"
slash "^3.0.0"
hyphenate-style-name@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.3.tgz#097bb7fa0b8f1a9cf0bd5c734cf95899981a9b48"
integrity sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ==
iconv-lite@0.4.23:
version "0.4.23"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
@@ -8398,6 +8435,13 @@ init-package-json@^1.10.3:
validate-npm-package-license "^3.0.1"
validate-npm-package-name "^3.0.0"
inline-style-prefixer@^5.0.3:
version "5.1.0"
resolved "https://registry.yarnpkg.com/inline-style-prefixer/-/inline-style-prefixer-5.1.0.tgz#cb63195f9456dcda25cf59743e45c4d9815b0811"
integrity sha512-giteQHPMrApQOSjNSjteO5ZGSGMRf9gas14fRy2lg2buSc1nRnj6o6xuNds5cMTKrkncyrTu3gJn/yflFMVdmg==
dependencies:
css-in-js-utils "^2.0.0"
inquirer@5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726"
@@ -8475,7 +8519,7 @@ inquirer@^6.2.0, inquirer@^6.2.2, inquirer@^6.4.1:
strip-ansi "^5.1.0"
through "^2.3.6"
internal-ip@^4.0.0:
internal-ip@4.3.0, internal-ip@^4.0.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907"
integrity sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==
@@ -9428,7 +9472,7 @@ jest@^24.8.0:
import-local "^2.0.0"
jest-cli "^24.9.0"
jetifier@^1.0.0-beta04.2:
jetifier@^1.0.0-beta04.2, jetifier@^1.6.4:
version "1.6.4"
resolved "https://registry.yarnpkg.com/jetifier/-/jetifier-1.6.4.tgz#6159db8e275d97980d26162897a0648b6d4a3222"
integrity sha512-+f/4OLeqY8RAmXnonI1ffeY1DR8kMNJPhv5WMFehchf7U71cjMQVKkOz1n6asz6kfVoAqKNWJz1A/18i18AcXA==
@@ -11221,6 +11265,11 @@ nopt@^4.0.1:
abbrev "1"
osenv "^0.1.4"
normalize-css-color@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/normalize-css-color/-/normalize-css-color-1.0.2.tgz#02991e97cccec6623fe573afbbf0de6a1f3e9f8d"
integrity sha1-Apkel8zOxmI/5XOvu/Deah8+n40=
normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0, normalize-package-data@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8"
@@ -13018,22 +13067,22 @@ react-devtools-core@^3.6.0:
shell-quote "^1.6.1"
ws "^3.3.1"
react-dom@^16.8.3:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.10.2.tgz#4840bce5409176bc3a1f2bd8cb10b92db452fda6"
integrity sha512-kWGDcH3ItJK4+6Pl9DZB16BXYAZyrYQItU4OMy0jAkv5aNqc+mAKb4TpFtAteI6TJZu+9ZlNhaeNQSVQDHJzkw==
react-dom@~16.8.3:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.16.2"
scheduler "^0.13.6"
react-error-overlay@^6.0.1:
version "6.0.3"
resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.3.tgz#c378c4b0a21e88b2e159a3e62b2f531fd63bf60d"
integrity sha512-bOUvMWFQVk5oz8Ded9Xb7WVdEi3QGLC8tH7HmYP0Fdp4Bn3qw0tRFmr5TW6mvahzvmrK4a6bqWGfCevBflP+Xw==
react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.3, react-is@^16.8.4:
react-is@^16.7.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.10.2.tgz#984120fd4d16800e9a738208ab1fba422d23b5ab"
integrity sha512-INBT1QEgtcCCgvccr5/86CfD71fw9EPmDxgiJX4I2Ddr6ZsV6iFXsuby+qWJPtmNuMY0zByTsG4468P7nHuNWA==
@@ -13093,10 +13142,17 @@ react-native-safe-area-view@^0.12.0:
dependencies:
hoist-non-react-statics "^2.3.1"
react-native-screens@^1.0.0-alpha.22, react-native-screens@~1.0.0-alpha.23:
version "1.0.0-alpha.23"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.23.tgz#25d7ea4d11bda4fcde2d1da7ae50271c6aa636e0"
integrity sha512-tOxHGQUN83MTmQB4ghoQkibqOdGiX4JQEmeyEv96MKWO/x8T2PJv84ECUos9hD3blPRQwVwSpAid1PPPhrVEaw==
react-native-screens@2.0.0-alpha.4:
version "2.0.0-alpha.4"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-2.0.0-alpha.4.tgz#cf869bba2a5940f0b71d1dde9cf4e545cc0e97d0"
integrity sha512-/MdbyDwmvGncnyH4TVPB4JAawtGVZtyG5NOAbJ14wVmsRZhOqVABmiRP7jGO9tKOCENnoVDKspEw24u66G7EMw==
dependencies:
debounce "^1.2.0"
react-native-screens@^2.0.0-alpha.3:
version "2.0.0-alpha.3"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-2.0.0-alpha.3.tgz#af86f265b2fb4293b626cf4396db7743de5a54af"
integrity sha512-SA3uGrc3UM1V9y6gfVU1UPf1a3dMyQCj3p5J7y6g81Of8rV5Pc34s6fWzOKNAWgOiviAktZB1z7Jngdl7+acZg==
dependencies:
debounce "^1.2.0"
@@ -13150,7 +13206,23 @@ react-native-view-shot@2.6.0:
resolved "https://registry.yarnpkg.com/react-native-view-shot/-/react-native-view-shot-2.6.0.tgz#3b23675826f67658366352c4b97b59a6aded2f43"
integrity sha512-yO9vWi/11m2hEJl8FrW1SMeVzFfPtMKh20MUInGqlsL0H8Ya2JGGlFfrBzx1KiFR2hFb5OdsTLYNtcVZtJ6pLQ==
react-native@0.59.10, react-native@^0.59.10:
react-native-web@^0.11.7:
version "0.11.7"
resolved "https://registry.yarnpkg.com/react-native-web/-/react-native-web-0.11.7.tgz#d173d5a9b58db23b6d442c4bc4c81e9939adac23"
integrity sha512-w1KAxX2FYLS2GAi3w3BnEZg/IUu7FdgHnLmFKHplRnHMV3u1OPB2EVA7ndNdfu7ds4Rn2OZjSXoNh6F61g3gkA==
dependencies:
array-find-index "^1.0.2"
create-react-class "^15.6.2"
debounce "^1.2.0"
deep-assign "^3.0.0"
fbjs "^1.0.0"
hyphenate-style-name "^1.0.2"
inline-style-prefixer "^5.0.3"
normalize-css-color "^1.0.2"
prop-types "^15.6.0"
react-timer-mixin "^0.13.4"
react-native@~0.59.10:
version "0.59.10"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.59.10.tgz#352f381e382f93a0403be499c9e384bf51c2591c"
integrity sha512-guB9YW+pBqS1dnfZ4ntzjINopiCUAbdmshU2wMWD1W32fRczLAopi/7Q2iHKP8LTCdxuYZV3fa9Mew5PSuANAw==
@@ -13214,15 +13286,20 @@ react-proxy@^1.1.7:
lodash "^4.6.1"
react-deep-force-update "^1.0.0"
react-test-renderer@16.8.3:
version "16.8.3"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.3.tgz#230006af264cc46aeef94392e04747c21839e05e"
integrity sha512-rjJGYebduKNZH0k1bUivVrRLX04JfIQ0FKJLPK10TAb06XWhfi4gTobooF9K/DEFNW98iGac3OSxkfIJUN9Mdg==
react-test-renderer@~16.8.3:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1"
integrity sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw==
dependencies:
object-assign "^4.1.1"
prop-types "^15.6.2"
react-is "^16.8.3"
scheduler "^0.13.3"
react-is "^16.8.6"
scheduler "^0.13.6"
react-timer-mixin@^0.13.4:
version "0.13.4"
resolved "https://registry.yarnpkg.com/react-timer-mixin/-/react-timer-mixin-0.13.4.tgz#75a00c3c94c13abe29b43d63b4c65a88fc8264d3"
integrity sha512-4+ow23tp/Tv7hBM5Az5/Be/eKKF7DIvJ09voz5LyHGQaqqz9WV8YMs31eFvcYQs7d451LSg7kDJV70XYN/Ug/Q==
react-transform-hmr@^1.0.4:
version "1.0.4"
@@ -13232,15 +13309,15 @@ react-transform-hmr@^1.0.4:
global "^4.3.0"
react-proxy "^1.1.7"
react@16.8.3, react@^16.8.3:
version "16.8.3"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.3.tgz#c6f988a2ce895375de216edcfaedd6b9a76451d9"
integrity sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA==
react@~16.8.3:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.13.3"
scheduler "^0.13.6"
read-chunk@2.1.0:
version "2.1.0"
@@ -13952,7 +14029,7 @@ sax@~1.1.1:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.1.6.tgz#5d616be8a5e607d54e114afae55b7eaf2fcc3240"
integrity sha1-XWFr6KXmB9VOEUr65Vt+ry/MMkA=
scheduler@^0.13.3:
scheduler@^0.13.6:
version "0.13.6"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
@@ -13960,7 +14037,7 @@ scheduler@^0.13.3:
loose-envify "^1.1.0"
object-assign "^4.1.1"
scheduler@^0.16.1, scheduler@^0.16.2:
scheduler@^0.16.1:
version "0.16.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.16.2.tgz#f74cd9d33eff6fc554edfb79864868e4819132c1"
integrity sha512-BqYVWqwz6s1wZMhjFvLfVR5WXP7ZY32M/wYPo04CcuPM7XZEbV2TBNW7Z0UkguPTl0dWMA59VbNXxK6q+pHItg==
@@ -15369,7 +15446,7 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
typescript@^3.6.3:
typescript@^3.5.3, typescript@^3.6.3:
version "3.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da"
integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==