Skip to content

Commit 19ee1a1

Browse files
fix: Splash Screen loading for Codepush (#302)
* fix: Splash Screen loading for Codepush * fix: add gitignore file * fix: more feedbacks after using
1 parent 46e7ac3 commit 19ee1a1

File tree

13 files changed

+54
-48
lines changed

13 files changed

+54
-48
lines changed

template/.gitignore renamed to template/_gitignore

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# OSX
22
#
33
.DS_Store
4-
*.pem
54

65
# Xcode
76
#
@@ -21,7 +20,7 @@ DerivedData
2120
*.hmap
2221
*.ipa
2322
*.xcuserstate
24-
**/.xcode.env.local
23+
ios/.xcode.env.local
2524

2625
# Android/IntelliJ
2726
#
@@ -57,19 +56,8 @@ yarn-error.log
5756
*.jsbundle
5857

5958
# Ruby / CocoaPods
60-
**/Pods/
59+
/ios/Pods/
6160
/vendor/bundle/
6261

6362
# Temporary files created by Metro to check the health of the file watcher
6463
.metro-health-check*
65-
66-
# testing
67-
/coverage
68-
69-
# Yarn
70-
.yarn/*
71-
!.yarn/patches
72-
!.yarn/plugins
73-
!.yarn/releases
74-
!.yarn/sdks
75-
!.yarn/versions

template/metro.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line @typescript-eslint/no-var-requires
12
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config')
23

34
/**

template/scripts/build-app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function buildApp() {
1919
function main() {
2020

2121
if [ -z $TYPE ]; then
22-
read -p 'Enter your environment (dev,staging,production): ' env
22+
read -p 'Enter your environment (development,staging,production): ' env
2323
TYPE=$env
2424
fi
2525

template/scripts/code-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function codePush() {
2020
function main() {
2121

2222
if [ -z $TYPE ]; then
23-
read -p 'Enter your environment: ' env
23+
read -p 'Enter your environment (development, staging, production): ' env
2424
TYPE=$env
2525
fi
2626

template/src/components/Toast.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,11 @@ export const Toast: React.FC = () => {
9090

9191
const dismiss = () => {
9292
animationRef.current?.stop()
93-
setState(initState)
9493
Animated.timing(animation, {
9594
toValue: 0,
9695
duration: DEFAULT_DURATION,
9796
useNativeDriver: true,
98-
}).start()
97+
}).start(() => setState(initState))
9998
}
10099

101100
useEffect(() => {

template/src/navigation/NavigationService.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const getParent = (): NavigationProp<AppStackParamList> | null =>
1919

2020
export const navigate = (
2121
name: keyof AppStackParamList,
22-
params: AppStackParamList[keyof AppStackParamList],
22+
params?: AppStackParamList[keyof AppStackParamList],
2323
) => {
2424
if (navigationRef.isReady()) {
2525
navigationRef.navigate(name as string, params as object | undefined)

template/src/navigation/StackNavigation.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {createNativeStackNavigator} from '@react-navigation/native-stack'
22
import React from 'react'
3-
import {LoginScreen, SignUpScreen} from '../screens'
4-
import HomeScreen from '../screens/HomeComponent/HomeScreen'
3+
import {HomeScreen, LoginScreen, SignUpScreen} from '../screens'
54
import RouteKey from './RouteKey'
65
import {optionsMatch} from './ScreenService'
76
import {AppStackParamList} from './types'
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {NativeStackScreenProps} from '@react-navigation/native-stack'
2-
import React, {PropsWithChildren} from 'react'
2+
import React from 'react'
33
import {ScreenContainer} from '../../components'
44
import RouteKey from '../../navigation/RouteKey'
55
import {AppStackParamList} from '../../navigation/types'
66

7-
type Props = NativeStackScreenProps<AppStackParamList, RouteKey.LoginScreen> & PropsWithChildren
7+
type Props = NativeStackScreenProps<AppStackParamList, RouteKey.LoginScreen>
88

9-
export const LoginScreen: React.FC<Props> = props => <ScreenContainer>{props.children}</ScreenContainer>
9+
export const LoginScreen: React.FC<Props> = () => <ScreenContainer />
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {NativeStackScreenProps} from '@react-navigation/native-stack'
2-
import React, {PropsWithChildren} from 'react'
2+
import React from 'react'
33
import {ScreenContainer} from '../../components'
44
import RouteKey from '../../navigation/RouteKey'
55
import {AppStackParamList} from '../../navigation/types'
66

7-
type Props = NativeStackScreenProps<AppStackParamList, RouteKey.SignUpScreen> & PropsWithChildren
7+
type Props = NativeStackScreenProps<AppStackParamList, RouteKey.SignUpScreen>
88

9-
export const SignUpScreen: React.FC<Props> = props => <ScreenContainer>{props.children}</ScreenContainer>
9+
export const SignUpScreen: React.FC<Props> = () => <ScreenContainer />
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import {NativeStackScreenProps} from '@react-navigation/native-stack'
2-
import React, {PropsWithChildren} from 'react'
2+
import React from 'react'
33
import {ScreenContainer} from '../../components'
44
import RouteKey from '../../navigation/RouteKey'
55
import {AppStackParamList} from '../../navigation/types'
66

7-
type Props = NativeStackScreenProps<AppStackParamList, RouteKey.HomeScreen> & PropsWithChildren
7+
type Props = NativeStackScreenProps<AppStackParamList, RouteKey.HomeScreen>
88

9-
const HomeScreen: React.FC<Props> = props => <ScreenContainer>{props.children}</ScreenContainer>
10-
11-
export default HomeScreen
9+
export const HomeScreen: React.FC<Props> = () => <ScreenContainer />

0 commit comments

Comments
 (0)