-
Notifications
You must be signed in to change notification settings - Fork 8
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
1 parent
1007e83
commit ff03232
Showing
38 changed files
with
21 additions
and
1,155 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,51 +3,4 @@ | |
[byf.admin.handlers :as handlers] | ||
[byf.common.views :refer [drop-down]] | ||
[byf.elements :as el] | ||
[byf.utils :as utils])) | ||
|
||
(defn add-player-form | ||
[] | ||
(let [valid-player? (rf/subscribe [::handlers/valid-player?]) | ||
player (rf/subscribe [::handlers/player]) | ||
leagues (rf/subscribe [::handlers/leagues])] | ||
|
||
(fn [] | ||
[:div.section | ||
[:div | ||
[drop-down @leagues ::handlers/league (:league_id @player) | ||
:value-fn :id | ||
:display-fn :name] | ||
|
||
[el/input | ||
[:is-fullwidth] | ||
{:type "text" | ||
:value (:name @player) | ||
:name "name" | ||
:placeholder "John Smith" | ||
:on-change (utils/set-val ::handlers/name)}] | ||
|
||
[el/input | ||
[:is-fullwidth] | ||
{:type "text" | ||
:value (:email @player) | ||
:name "email" | ||
:placeholder "[email protected]" | ||
:on-change (utils/set-val ::handlers/email)}]] | ||
|
||
[:div | ||
[el/button | ||
[:is-primary :is-fullwidth (when-not @valid-player? "disabled")] | ||
{:type "button" | ||
:name "submit-game" | ||
:on-click (if @valid-player? | ||
#(rf/dispatch [::handlers/add-player]) | ||
#(js/alert "Fill up the form first"))} | ||
|
||
"Register New Player"]]]))) | ||
|
||
(defn root | ||
[] | ||
(rf/dispatch [::handlers/load-leagues]) | ||
(fn [] | ||
[:div | ||
[add-player-form]])) | ||
[byf.utils :as utils])) |
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.