From e5021187e96b78b53203bd95d08d6818aea47d17 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Wed, 14 Jul 2021 15:10:31 +0200
Subject: New Ignite 7.0.6 app

---
 storybook/storybook.tsx | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 storybook/storybook.tsx

(limited to 'storybook/storybook.tsx')

diff --git a/storybook/storybook.tsx b/storybook/storybook.tsx
new file mode 100644
index 0000000..0479d4e
--- /dev/null
+++ b/storybook/storybook.tsx
@@ -0,0 +1,31 @@
+import React, { useEffect } from "react"
+import { getStorybookUI, configure } from "@storybook/react-native"
+import { initFonts } from "../app/theme/fonts"
+
+declare let module
+
+configure(() => {
+  require("./storybook-registry")
+}, module)
+
+const StorybookUI = getStorybookUI({
+  port: 9001,
+  host: "localhost",
+  onDeviceUI: true,
+  asyncStorage: require("@react-native-async-storage/async-storage").default || null,
+})
+
+export function StorybookUIRoot() {
+  useEffect(() => {
+    ;(async () => {
+      await initFonts() // expo only
+      if (typeof __TEST__ === "undefined" || !__TEST__) {
+        const Reactotron = require("../app/services/reactotron")
+        const reactotron = new Reactotron.Reactotron()
+        reactotron.setup()
+      }
+    })()
+  }, [])
+
+  return <StorybookUI />
+}
-- 
cgit v1.2.3

