-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/6298-publish-storybook
- Loading branch information
Showing
13 changed files
with
2,244 additions
and
1,122 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/App.tsx | ||
tsconfig.json |
Binary file not shown.
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
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
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,10 @@ | ||
// Import components here so they can be exported through npm | ||
import { registerRootComponent } from 'expo' | ||
import App from './main' | ||
|
||
import App from './App' | ||
const expoApp = App.default | ||
|
||
const storybookEnabled = process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === 'true' | ||
|
||
if (storybookEnabled) { | ||
// registerRootComponent calls AppRegistry.registerComponent('main', () => App); | ||
// It also ensures that whether you load the app in Expo Go or in a native build, | ||
// the environment is set up appropriately | ||
registerRootComponent(App) | ||
if (expoApp && App.initiateExpo) { | ||
App.initiateExpo(expoApp) | ||
} | ||
|
||
|
||
export { MyButton } from 'components/Button/Button' | ||
export { SegmentedControl } from 'components/SegmentedControl/SegmentedControl' | ||
// Export components here so they are exported through npm | ||
export { SegmentedControl } from './components/SegmentedControl/SegmentedControl' |
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,17 @@ | ||
/** | ||
* Module to set App environment: | ||
* - Standalone Expo App (Storybook environment) | ||
* - Component wrapper environment as part of NPM package/within external app (App = null) | ||
*/ | ||
export type AppType = { | ||
default: JSX.Element | null | ||
initiateExpo: ((expoApp: JSX.Element | null) => void) | null | ||
} | ||
|
||
let App: AppType | ||
try { | ||
App = require('./App.tsx') | ||
} catch { | ||
App = require('./wrapper.tsx') | ||
} | ||
export default App |
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,31 +1,30 @@ | ||
import * as RNLocalize from 'expo-localization' | ||
import { initReactI18next } from 'react-i18next' | ||
import RNLanguageDetector from '@os-team/i18next-react-native-language-detector' | ||
import i18n from 'i18next' | ||
|
||
import * as enTranslation from './en.json' | ||
|
||
const fallbackLanguage = { languageTag: 'en', isRTL: false } | ||
const defaultLanguage = RNLocalize.getLocales()[0] || fallbackLanguage | ||
|
||
export const resources = { | ||
en: { translation: enTranslation }, | ||
} | ||
|
||
// Initialize the internationalization library | ||
i18n.use(initReactI18next).init({ | ||
lng: defaultLanguage.languageTag, | ||
resources, | ||
keySeparator: false, | ||
fallbackLng: 'en', | ||
compatibilityJSON: 'v3', | ||
debug: true, | ||
interpolation: { | ||
escapeValue: false, | ||
formatSeparator: ',', | ||
}, | ||
react: { | ||
useSuspense: true, | ||
}, | ||
}) | ||
i18n | ||
.use(RNLanguageDetector) | ||
.use(initReactI18next) | ||
.init({ | ||
resources, | ||
keySeparator: false, | ||
fallbackLng: 'en', | ||
compatibilityJSON: 'v3', | ||
debug: true, | ||
interpolation: { | ||
escapeValue: false, | ||
formatSeparator: ',', | ||
}, | ||
react: { | ||
useSuspense: true, | ||
}, | ||
}) | ||
|
||
export default i18n |
Oops, something went wrong.