Storybook working
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
import '@storybook/addon-actions/register';
|
||||
import '@storybook/addon-links/register';
|
||||
@@ -0,0 +1,25 @@
|
||||
/* @flow */
|
||||
|
||||
import React from "react";
|
||||
import { View, StyleSheet } from "react-native";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
const centerColor = "white";
|
||||
const styles = StyleSheet.create({
|
||||
centered: {
|
||||
flex: 1,
|
||||
backgroundColor: centerColor,
|
||||
alignItems: "center",
|
||||
justifyContent: "center"
|
||||
}
|
||||
});
|
||||
|
||||
export class Centered extends React.Component<{ children: node }> {
|
||||
static propTypes = {
|
||||
children: PropTypes.node.isRequired
|
||||
};
|
||||
|
||||
render() {
|
||||
return <View style={styles.centered}>{this.props.children}</View>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { getStorybookUI, configure } from "@storybook/react-native";
|
||||
|
||||
import { loadStories } from "./storyLoader";
|
||||
|
||||
configure(loadStories, module);
|
||||
|
||||
const StorybookUI = getStorybookUI({ port: 7007, onDeviceUI: true });
|
||||
|
||||
export default StorybookUI;
|
||||
@@ -0,0 +1,22 @@
|
||||
|
||||
// Auto-generated file created by react-native-storybook-loader
|
||||
// Do not edit.
|
||||
//
|
||||
// https://github.com/elderfo/react-native-storybook-loader.git
|
||||
|
||||
function loadStories() {
|
||||
require('../src/regionsStyledApp/countrySelect.story');
|
||||
require('../src/regionsStyledApp/regionsTable.story');
|
||||
|
||||
}
|
||||
|
||||
const stories = [
|
||||
'../src/regionsStyledApp/countrySelect.story',
|
||||
'../src/regionsStyledApp/regionsTable.story',
|
||||
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
loadStories,
|
||||
stories,
|
||||
};
|
||||
Reference in New Issue
Block a user