This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("should add a note", async () => { | |
const { | |
getByTestId, | |
getByText | |
} = render( < PaymentLink / > ); | |
fireEvent.press(getByText("+Add")); | |
expect(getByTestId("note-title")).toBeTruthy(); | |
expect(getByTestId("note-description")).toBeTruthy(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
// On android we fall back to scroll view due to overflow 'visible' not being supported | |
// https://github.com/facebook/react-native/issues/6802 | |
import React, { Component } from 'react'; | |
import { | |
Animated, | |
Dimensions, | |
PanResponder, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Don't forget to check the complete code here ---> https://github.com/shubhnik/redux-react-navigation/tree/authFlow | |
const initialState = { isLoggedIn: false }; | |
const loginReducer = (state = initialState, action) => { | |
switch (action.type) { | |
case "LOGIN": | |
return { ...state, isLoggedIn: true }; | |
case "LOGOUT": | |
return { ...state, isLoggedIn: false }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a simple demo screen1 to demonstrate dispatching actions to update navigation state and navigate to screen2. | |
// Don not forget to check the complete code here ---> https://github.com/shubhnik/redux-react-navigation | |
class Screen1 extends Component { | |
navigate = () => { | |
const navigateToScreen2 = NavigationActions.navigate({ | |
routeName:'screen2', | |
params:{name:'Shubhnik'} | |
}) | |
// navigateToscreen2 will look like this: | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Our Navigator: | |
const AppNavigator = StackNavigator({ | |
login: { | |
screen: Login | |
}, | |
screen1: { | |
screen: Screen1 | |
}, | |
screen2: { | |
screen: Logout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AppNavigator = StackNavigator({ | |
login: { | |
screen: login | |
}, | |
screen1: { | |
screen: Screen1 | |
}, | |
screen2: { | |
screen: Logout | |
} |
NewerOlder