Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

import React from 'react'
import PropTypes from 'prop-types'
import { StyleSheet, ImageBackground } from 'react-native'
const BackgroundPage = ({ background, children }) => (
<ImageBackground source={background} style={styles.imageBackground}>
{children}
</ImageBackground>
)
import React, { useCallback } from 'react'
import { Image, View, Text } from 'react-native'
import PropTypes from 'prop-types'
import { useFocusEffect } from '@react-navigation/native'
import TouchableWrapper from '../../components/global/layout/TouchableWrapper'
import DefaultPage from '../../components/DefaultPage'
import AbeLogo from '../../../assets/AllBitsEqual_logo_light.png'
const SceneSplash = ({ navigation }) => {
useFocusEffect(
<TouchableWrapper handlePress={() => navigation.navigate('Login')}>
<DefaultPage>
<Image
style={{ width: 150, height: 120 }}
source={AbeLogo}
/>
<View>
<Text style={{ fontSize: 23, marginTop: 80 }}>
by Konrad Abe
</Text>
import React, { useEffect } from 'react'
import { Text } from 'react-native'
import PropTypes from 'prop-types'
import TouchableWrapper from '../../components/global/layout/TouchableWrapper'
import DefaultPage from '../../components/DefaultPage'
const SceneSplash = ({ navigation }) => {
useEffect(() => {
setTimeout(() => {
navigation.navigate('Login')
import React from 'react'
import { TouchableWithoutFeedback, StyleSheet, View } from 'react-native'
import PropTypes from 'prop-types'
const TouchableWrapper = ({ handlePress, children }) => (
<TouchableWithoutFeedback
style={styles.touchableWrapper}
onPress={() => handlePress()}
>
<View style={styles.touchableWrapperHelper}>
import React from 'react'
import { Button, Text } from 'react-native'
import PropTypes from 'prop-types'
import DefaultPage from '../../components/DefaultPage'
const SceneSettings = ({ navigation }) => (
<DefaultPage>
<Text>
Settings
</Text>
import React from 'react'
import { Text, Button } from 'react-native'
import PropTypes from 'prop-types'
import DefaultPage from '../../components/DefaultPage'
const SceneHome = ({ navigation }) => (
<DefaultPage>
<Text>
Home
</Text>
import * as React from 'react'
export const navigationRef = React.createRef()
export function navigate(name, params) {
navigationRef.current.navigate(name, params)
}
import { USER_LOGIN } from '../../actions/user.actions'
import * as RootNavigation from '../../../navigation/RootNavigation'
const fakeLoginCheck = () => true // It's an older code, sir, but it checks out.
const userMiddleware = () => (next) => (action) => {
if (action.type === USER_LOGIN) {
if (fakeLoginCheck()) {
next(action) // continue with the login
import React, { useState } from 'react'
import { Text, TextInput, Button } from 'react-native'
import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import DefaultPage from '../../components/DefaultPage'
import { userLogin } from '../../redux/actions/user.actions'
const SceneLogin = ({ loginUser, isUserLoggedIn, storedUserName }) => {
const [name, setName] = useState('')