organize
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
(ns todo.app
|
||||
(:require [reagent.core :as r]
|
||||
[re-frame.core :as rf]
|
||||
["react-native" :as rn]
|
||||
["react-native-gesture-handler" :refer [GestureHandlerRootView]]
|
||||
[expo.root :as expo-root]
|
||||
[todo.events]
|
||||
[todo.subs]
|
||||
[todo.views.main :as main]
|
||||
[todo.views.add-todo :as add-todo]))
|
||||
|
||||
(defn root []
|
||||
(let [show-form? @(rf/subscribe [:show-form?])]
|
||||
[:> GestureHandlerRootView {:style {:flex 1}}
|
||||
[:> rn/StatusBar {:bar-style "light-content" :background-color "#6200EE"}]
|
||||
[main/main-screen]
|
||||
(when show-form?
|
||||
[add-todo/add-todo-form])]))
|
||||
|
||||
(defn start
|
||||
{:dev/after-load true}
|
||||
[]
|
||||
(expo-root/render-root (r/as-element [root])))
|
||||
|
||||
(defn init []
|
||||
(rf/dispatch-sync [:initialize-db])
|
||||
(start))
|
||||
Reference in New Issue
Block a user