-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
1,258 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
if pgrep -f 'shadow-cljs watch mobile' > /dev/null; then | ||
echo "Error: make run-clojure is already running in another terminal" >&2 | ||
echo "Please close that terminal before running this command." >&2 | ||
exit 1 | ||
fi | ||
|
||
if pgrep -f 'react-native start' > /dev/null; then | ||
echo "Error: make run-metro is already running in another terminal" >&2 | ||
echo "Please close that terminal before running this command." >&2 | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(ns dev.component-preview.events | ||
(:require | ||
[quo.core :as quo] | ||
[re-frame.core :as re-frame])) | ||
|
||
(def preview-screen-name :dev-component-preview) | ||
|
||
(when js/goog.DEBUG | ||
(re-frame/reg-event-fx :dev/preview-component | ||
(fn [{:keys [db]} [[component-tag props & args]]] | ||
(let [view-id (:view-id db) | ||
;; NOTE: re-render on every evaluation e.g. reset component state without changes | ||
component (into [component-tag (assoc props :key (random-uuid))] args) | ||
navigate? (not= view-id preview-screen-name)] | ||
(cond-> {:db (assoc db :dev/previewed-component component)} | ||
navigate? (assoc :fx [[:dispatch [:navigate-to preview-screen-name]]])))))) | ||
|
||
;; Usage example | ||
(comment | ||
(re-frame/dispatch [:dev/preview-component | ||
[quo/slide-button | ||
{:track-icon :face-id | ||
:track-text ":debug-component example" | ||
:customization-color :blue | ||
:on-complete identity}]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
(ns dev.component-preview.view | ||
(:require | ||
[react-native.core :as rn] | ||
[utils.re-frame :as rf])) | ||
|
||
(def ^:private container-style | ||
{:flex 1 | ||
:padding-horizontal 20 | ||
:padding-top 80 | ||
:align-items :center}) | ||
|
||
(defn view | ||
[] | ||
(let [component (rf/sub [:dev/previewed-component])] | ||
[rn/view {:style container-style} | ||
(when component component)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(ns quo.components.colors.color.constants) | ||
|
||
(def ^:const IPHONE_11_PRO_VIEWPORT_WIDTH 375) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.