Skip to content

Commit

Permalink
0.2.6 status-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
flexsurfer committed Jun 5, 2020
1 parent b928599 commit d92ff53
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A Clojure library with a few functions-steroids for react native app, **can be u
## Usage

```clojure
{:dependencies [[rn-shadow-steroid "0.2.5"]]}
{:dependencies [[rn-shadow-steroid "0.2.6"]]}
```

Register root reagent component in app registry
Expand Down Expand Up @@ -42,7 +42,7 @@ shadow-cljs.edn
```clojure
{:source-paths ["src"]

:dependencies [[rn-shadow-steroid "0.2.5"]]
:dependencies [[rn-shadow-steroid "0.2.6"]]

:builds {:dev
{:target :react-native
Expand Down Expand Up @@ -90,7 +90,17 @@ platform/platform platform/os platform/version platform/android? platform/ios?
#### Other components
```clojure
[steroid.rn.components.other :as other]
other/activity-indicator other/alert other/dimensions other/keyboard-avoiding-view other/modal other/refresh-control other/status-bar
other/activity-indicator other/alert other/dimensions other/keyboard-avoiding-view other/modal other/refresh-control
```

#### StatusBar components
```clojure
[steroid.rn.components.status-bar :as status-bar]
(status-bar/set-bar-style bar-style)
(status-bar/set-background-color background-color)
(status-bar/set-hidden hidden)
(status-bar/set-network-activity-indicator-visible network-activity-indicator-visible)
(status-bar/set-translucent translucent)
```

#### Picker component
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject rn-shadow-steroid "0.2.5"
(defproject rn-shadow-steroid "0.2.6"
:description "React Native with shadow-cljs on steroids"
:url "https://github.com/flexsurfer/rn-shadow-steroid"
:license {:name "Eclipse Public License"
Expand Down
1 change: 0 additions & 1 deletion src/steroid/rn/components/other.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
(def keyboard-avoiding-view (reagent/adapt-react-class rn/KeyboardAvoidingView))
(def modal (reagent/adapt-react-class rn/Modal))
(def refresh-control (reagent/adapt-react-class rn/RefreshControl))
(def status-bar (reagent/adapt-react-class rn/StatusBar))
21 changes: 21 additions & 0 deletions src/steroid/rn/components/status_bar.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(ns steroid.rn.components.status-bar
(:require ["react-native" :as rn]))

(def status-bar rn/StatusBar)

(defn set-bar-style [bar-style]
(.setBarStyle ^js status-bar (clj->js bar-style)))

(defn set-background-color [background-color]
(.setBackgroundColor ^js status-bar (clj->js background-color)))

(defn set-hidden [hidden]
(.setHidden ^js status-bar (clj->js hidden)))

(defn set-network-activity-indicator-visible [network-activity-indicator-visible]
(.setNetworkActivityIndicatorVisible
^js status-bar
(clj->js network-activity-indicator-visible)))

(defn set-translucent [translucent]
(.setTranslucent ^js status-bar (clj->js translucent)))

0 comments on commit d92ff53

Please sign in to comment.