mattermost-mobile/storybook/index.ts
Daniel Espino García 4c8594d330
Add linter rules for import order and type member delimiters (#5514)
* Add linter rules for import order and type member delimiters

* Remove unneeded group

* Group all app/* imports before the internal imports

* Move app/ imports before parent imports

* Separate @node_modules imports into a different group

* Substitute app paths by aliases

* Fix @node_modules import order and add test related modules

* Add aliases for types and test, and group import types
2021-07-23 11:06:04 +02:00

33 lines
1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {getStorybookUI, configure} from '@storybook/react-native';
import {Platform} from 'react-native';
import {STORYBOOK_HOST, STORYBOOK_PORT} from '@env';
// load react-native addons for storybook rn
import '@storybook/addon-ondevice-knobs/register';
import {loadStories} from './storyLoader';
// import stories
configure(() => {
loadStories();
}, module);
// this seems to be required to get react-native-dotenv to load the env variables
// properly. Possibly something related to babel-loader
const port = STORYBOOK_PORT;
const host = STORYBOOK_HOST;
// Refer to https://github.com/storybookjs/storybook/tree/master/app/react-native#start-command-parameters
// To find allowed options for getStorybookUI
const StorybookUIRoot = getStorybookUI({
port: port || 7007,
host: host || (Platform.OS === 'ios' ? 'localhost' : '10.0.2.2'),
onDeviceUI: true,
resetStorybook: true,
});
export default StorybookUIRoot;