Skip to content

Commit

Permalink
Merge pull request #310 from eNotchy/patch-2
Browse files Browse the repository at this point in the history
[sample.fizzbuzz] Fix null error and work around rendering bug
  • Loading branch information
dupuchba authored May 13, 2024
2 parents 9b25553 + d704362 commit 16b4c3b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions samples/fizzbuzz/src/sample/fizzbuzz.cljd
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
(m/Column .mainAxisAlignment m/MainAxisAlignment.center .crossAxisAlignment m/CrossAxisAlignment.stretch)
.children
[(f/widget
:watch [n s1]
:watch [n s1
:default 0]
(m/Text (str n) .textAlign m/TextAlign.center .style text-style))
(f/widget
:watch [n (f/sub [s1 s3] (fn [[n n3]] (if (= n n3) "Fizz" "")))
; default opts to f
:sub/opts [{:default 777} {:default 888}]]
:watch [n (f/sub [s1 s3] (fn [[n n3]] (if (= n n3) "Fizz" " ")))
:default " "]
(m/Text n .textAlign m/TextAlign.center .style (.apply text-style .color m/Colors.red.shade200)))
(f/widget
:watch [n (f/sub [s1 s5] (fn [[n n5]] (if (= n n5) "Buzz" "")))]
:watch [n (f/sub [s1 s5] (fn [[n n5]] (if (= n n5) "Buzz" " ")))
:default " "]
(m/Text n .textAlign m/TextAlign.center .style (.apply text-style .color m/Colors.green.shade200)))]))

0 comments on commit 16b4c3b

Please sign in to comment.