Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1454 from flexn-io/chore/release_sync_2
Release PRs Sync
- Loading branch information
Showing
219 changed files
with
2,987 additions
and
2,574 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ jobs: | |
run: | | ||
yarn | ||
yarn bootstrap | ||
yarn lint | ||
yarn test | ||
env: | ||
CI: true | ||
|
This file was deleted.
Oops, something went wrong.
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
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
12 changes: 9 additions & 3 deletions
12
packages/app-harness/src/components/NewModuleButton/index.native.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import React from 'react'; | ||
import { NativeModules, Button } from 'react-native'; | ||
import { useLoggerContext } from '../../context'; | ||
|
||
export const NewModuleButton = () => { | ||
const { TestNativeModule } = NativeModules; | ||
const { logDebug } = useLoggerContext(); | ||
const callback = (error: any, result: string) => { | ||
if (error) { | ||
console.log(error); | ||
logDebug(error); | ||
} else { | ||
console.log(result); | ||
logDebug(result); | ||
} | ||
}; | ||
const onPress = () => { | ||
TestNativeModule.createTestEvent('testName', 'testLocation', callback); | ||
if (TestNativeModule) { | ||
TestNativeModule.createTestEvent('testName', 'testLocation', callback); | ||
} else { | ||
logDebug('NativeModules not supported for this platform'); | ||
} | ||
}; | ||
return <Button title="Click to invoke native module!" color="#841584" onPress={onPress} />; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import React from 'react'; | ||
import { Button } from 'react-native'; | ||
import { useLoggerContext } from '../../context'; | ||
|
||
export const NewModuleButton = () => { | ||
const { logDebug } = useLoggerContext(); | ||
const onPress = () => { | ||
console.log('NativeModules not supported in web'); | ||
logDebug('NativeModules not supported in web'); | ||
}; | ||
return <Button title="Click to invoke native module!" color="#841584" onPress={onPress} />; | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
export const addNotificationListeners = () => { | ||
console.log('addNotificationListeners not supported on this platform'); | ||
import { NotificationCallback } from '../types'; | ||
|
||
export const addNotificationListeners = (callback: NotificationCallback) => { | ||
callback('addNotificationListeners not supported on this platform'); | ||
}; | ||
|
||
export const removeNotificationListeners = () => { | ||
console.log('removeNotificationListeners not supported on this platform'); | ||
export const removeNotificationListeners = (callback: NotificationCallback) => { | ||
callback('removeNotificationListeners not supported on this platform'); | ||
}; |
4 changes: 1 addition & 3 deletions
4
packages/app-harness/src/components/Permissions/index.mobile.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
import { request, PERMISSIONS } from 'react-native-permissions'; | ||
|
||
export const requestPermissions = () => { | ||
request(PERMISSIONS.IOS.CONTACTS).then((result) => { | ||
console.log(result); | ||
}); | ||
return request(PERMISSIONS.IOS.CONTACTS); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const requestPermissions = () => { | ||
console.log('requestPermissions not supported on this platform'); | ||
return 'requestPermissions not supported on this platform'; | ||
}; |
4 changes: 3 additions & 1 deletion
4
packages/app-harness/src/components/SplashScreen/index.mobile.ts
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import SplashScreen from 'react-native-splash-screen'; | ||
|
||
export { SplashScreen }; | ||
export function useSplashScreen() { | ||
return { SplashScreen }; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
const SplashScreen = { | ||
import { useEffect } from 'react'; | ||
import { NotificationCallback } from '../types'; | ||
import { useLoggerContext } from '../../context'; | ||
|
||
const SplashScreen = (callback: NotificationCallback) => ({ | ||
hide: () => { | ||
console.log('SplashScreen.hide not supported on this platform'); | ||
callback('SplashScreen.hide not supported on this platform'); | ||
}, | ||
show: () => { | ||
console.log('SplashScreen.show not supported on this platform'); | ||
callback('SplashScreen.show not supported on this platform'); | ||
}, | ||
}; | ||
}); | ||
|
||
export { SplashScreen }; | ||
export function useSplashScreen() { | ||
const { logDebug } = useLoggerContext(); | ||
useEffect(() => { | ||
//TODO: We could also cache SplashScreen here | ||
}, []); | ||
return { SplashScreen: SplashScreen(logDebug) }; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export type SplashscreenType = { | ||
hide: () => void; | ||
show: () => void; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export type NotificationCallback = (message: string) => void; | ||
export type NotificationError = { message: string; code: number; details: any }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { createContext, useContext, useState, ReactNode, FC } from 'react'; | ||
|
||
type LogMessage = string; | ||
|
||
type LoggerContextType = { | ||
logs: LogMessage[]; | ||
logDebug: (...msg: LogMessage[]) => void; | ||
}; | ||
type LoggerProviderProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
const LoggerContext = createContext<LoggerContextType>({} as LoggerContextType); | ||
|
||
export const LoggerProvider: FC<LoggerProviderProps> = ({ children }) => { | ||
const [logs, setLogs] = useState<LogMessage[]>([]); | ||
const logDebug = (...msg: LogMessage[]) => { | ||
setLogs((prevLogs) => prevLogs.concat(msg)); | ||
console.log(...msg); | ||
}; | ||
|
||
return <LoggerContext.Provider value={{ logs, logDebug }}>{children}</LoggerContext.Provider>; | ||
}; | ||
|
||
export const useLoggerContext = (): LoggerContextType => useContext(LoggerContext); |
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
Oops, something went wrong.