Skip to content

Commit

Permalink
Inji-409: Add flipper config (#865)
Browse files Browse the repository at this point in the history
* feat(inji-344): add flipper config for mmkv and xstate

* feat(inji-409): Add flipper config file and enable devtools for all machines

* feat(inji-409): Add react-navigation to flipper config
  • Loading branch information
tilak-puli authored Oct 4, 2023
1 parent ca83cb8 commit 0dc6139
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 46 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ APPLICATION_THEME=orange

#environment can be changed if it is toggled
CREDENTIAL_REGISTRY_EDIT=true
DEBUG_MODE=false

#supported languages( en, fil, ar, hi, kn, ta)
APPLICATION_LANGUAGE=en
Expand Down
8 changes: 8 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ import {MessageOverlay} from './components/MessageOverlay';
import SecureKeystore from 'react-native-secure-keystore';
import {isCustomSecureKeystore} from './shared/cryptoutil/cryptoUtil';
import i18n from './i18n';
import mmkvFlipper from 'rn-mmkv-storage-flipper';
import {MMKV} from './shared/storage';
import {inspect} from 'react-native-flipper-xstate';

// add this line inside your App.tsx
if (__DEV__) {
mmkvFlipper(MMKV);
inspect();
}
// kludge: this is a bad practice but has been done temporarily to surface
// an occurance of a bug with minimal residual code changes, this should
// be removed once the bug cause is determined & fixed, ref: INJI-222
Expand Down
12 changes: 6 additions & 6 deletions components/GlobalContextProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React from 'react';
import { useInterpret } from '@xstate/react';
import { appMachine, logState } from '../machines/app';
import {useInterpret} from '@xstate/react';
import {appMachine, logState} from '../machines/app';

import { GlobalContext } from '../shared/GlobalContext';
import {GlobalContext} from '../shared/GlobalContext';

export const GlobalContextProvider: React.FC = (props) => {
const appService = useInterpret(appMachine);
export const GlobalContextProvider: React.FC = props => {
const appService = useInterpret(appMachine, {devTools: __DEV__});

if (__DEV__) {
appService.subscribe(logState);
}

return (
<GlobalContext.Provider value={{ appService }}>
<GlobalContext.Provider value={{appService}}>
{props.children}
</GlobalContext.Provider>
);
Expand Down
1 change: 1 addition & 0 deletions inji.flipper

Large diffs are not rendered by default.

Loading

0 comments on commit 0dc6139

Please sign in to comment.