Created
May 30, 2020 23:24
-
-
Save geraldodev/a9b60dd611d1628f9413dd6de6c3c974 to your computer and use it in GitHub Desktop.
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
(ns app.renderer.core | |
(:require | |
["@material-ui/core" :refer [AppBar Toolbar Badge Hidden IconButton]] | |
["@material-ui/core/Button" :default Button] | |
["@material-ui/core/styles" :refer [createMuiTheme makeStyles ThemeProvider]] | |
["react-dom" :as rdom] | |
[app.renderer.myhelix :refer [defnc]] | |
[helix.core :as hx :refer [$ <>]] | |
[helix.dom :as d] | |
)) | |
(enable-console-print!) | |
(def useStyles | |
(makeStyles | |
(fn [theme] | |
(clj->js | |
{:root | |
{"boxShadow" "none"} | |
:flexGrow | |
{:flexGrow 1} | |
:signOutButton | |
{:maginLeft ((.-spacing theme) 1)}})))) | |
(defnc Topbar | |
[{:keys [class on-sidebar-open] | |
:as props}] | |
(let [classes (useStyles) | |
props ( -> props | |
(dissoc :on-sidebar-open) | |
(assoc :class | |
(str (.-root classes) " " class)) ) | |
] | |
($ ^:native | |
AppBar | |
{:& props} | |
($ ^:native | |
Toolbar | |
(d/div {:class (.-flexGrow classes) | |
:name "Toolbar"}))))) | |
(def theme (createMuiTheme #js {})) | |
(defnc App | |
[] | |
($ ^:native | |
ThemeProvider {:theme theme} | |
(d/div | |
($ Topbar {}) | |
(d/label "teste") | |
($ ^:native | |
Button {:variant "contained" | |
:color "primary" | |
:on-click (fn [e] | |
(.log js/console "oi"))} | |
"Oia ae Felipão")))) | |
(defn start! [] | |
(rdom/render ($ App) (js/document.getElementById "app-container"))) | |
(comment | |
; (js/console.log "root " (.-root classes)) | |
; (js/console.log "props " props) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For future reference, reading through helix's Slack chat I found this:
clojurians.slack.com - helix