Skip to content

Commit

Permalink
tweaks for mui v5 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
lgessler committed Nov 29, 2023
1 parent 945f774 commit 0884a92
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 25 deletions.
5 changes: 2 additions & 3 deletions src/main/glam/client/ui/admin/project/overview.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@
(mui/container {:maxWidth "md" :style {:position "relative"}}
(mui/page-title "Project Management")
(mui/arrow-breadcrumbs {}
(mui/link {:color "inherit" :href (r/route-for :admin-home) :key "admin"} "Admin Settings")
(mui/link {:color "textPrimary" :underline "none" :key "project"} "Project Management"))

(mui/link {:variant "subtitle1" :color "inherit" :href (r/route-for :admin-home) :key "admin"} "Admin Settings")
(mui/link {:variant "subtitle1" :color "textPrimary" :underline "none" :key "project"} "Project Management"))
;; add project button
(mui/dialog {:open modal-open? :onClose #(uism/trigger! this ::add-project :event/cancel)}
(mui/dialog-title {} "Create Project")
Expand Down
6 changes: 3 additions & 3 deletions src/main/glam/client/ui/admin/project/settings.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -640,9 +640,9 @@
(mui/container {:maxWidth "lg" :style {:position "relative"}}
(mui/page-title name)
(mui/arrow-breadcrumbs {}
(mui/link {:color "inherit" :href (r/route-for :admin-home) :key "admin"} "Admin Settings")
(mui/link {:color "inherit" :href (r/route-for :project-overview) :key "project"} "Project Management")
(mui/link {:color "textPrimary" :underline "none" :key id} name))
(mui/link {:variant "subtitle1" :color "inherit" :href (r/route-for :admin-home) :key "admin"} "Admin Settings")
(mui/link {:variant "subtitle1" :color "inherit" :href (r/route-for :project-overview) :key "project"} "Project Management")
(mui/link {:variant "subtitle1" :color "textPrimary" :underline "none" :key id} name))

;; add text layer modal
(mui/dialog {:open modal-open?
Expand Down
4 changes: 2 additions & 2 deletions src/main/glam/client/ui/admin/user_management.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@
(mui/container {:maxWidth "md"}
(mui/page-title "User Management")
(mui/arrow-breadcrumbs {}
(mui/link {:color "inherit" :href (r/route-for :admin-home) :key "admin"} "Admin Settings")
(mui/link {:color "textPrimary" :underline "none" :key "user"} "User Management"))
(mui/link {:variant "subtitle1" :color "inherit" :href (r/route-for :admin-home) :key "admin"} "Admin Settings")
(mui/link {:variant "subtitle1" :color "textPrimary" :underline "none" :key "user"} "User Management"))

;; add user button
(mui/dialog {:open modal-open? :onClose #(uism/trigger! this ::add-user :event/cancel)}
Expand Down
6 changes: 3 additions & 3 deletions src/main/glam/client/ui/document/document.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@
(mui/container {:maxWidth "xl"}
(mui/page-title name)
(mui/arrow-breadcrumbs {}
(mui/link {:color "inherit" :href (r/route-for :projects) :key "projects"} "Projects")
(mui/link {:color "inherit" :href (r/route-for :project {:id (:project/id project)}) :key "project"} (:project/name project))
(mui/link {:color "textPrimary" :underline "none" :key "document"} name))
(mui/link {:variant "subtitle1" :underline "none" :color "inherit" :href (r/route-for :projects) :key "projects"} "Projects")
(mui/link {:variant "subtitle1" :underline "none" :color "inherit" :href (r/route-for :project {:id (:project/id project)}) :key "project"} (:project/name project))
(mui/link {:variant "subtitle1" :color "textPrimary" :underline "none" :key "document"} name))

(mui/paper {}
(if busy?
Expand Down
4 changes: 2 additions & 2 deletions src/main/glam/client/ui/material_ui.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@
["@mui/material/Typography" :default Typography]
["@mui/material/Zoom" :default Zoom]
;; END AUTO GEN
["@mui/x-tree-view" :default TreeView]
["@mui/x-tree-view/TreeItem" :default TreeItem]
["@mui/x-tree-view/TreeView" :refer [TreeView]]
["@mui/x-tree-view/TreeItem" :refer [TreeItem]]
[glam.client.ui.material-ui-icon :as muic]
[taoensso.timbre :as log]))

Expand Down
11 changes: 2 additions & 9 deletions src/main/glam/client/ui/material_ui_icon.cljs
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
(ns glam.client.ui.material-ui-icon
"Autogenerated. Go to https://mui.com/material-ui/material-icons/ and select the parent div in devtools
Then:
let pascalNames = Array.from($0.childNodes).map(x => x.innerText)
console.log(pascalNames.map(x => ` [\"@mui/icons-material/${x}\" :default ${x}]`).join(\"\\n\"))
let pascal2kebab = (s) => s.split('').map((c, i) => c === c.toUpperCase() && i > 0 ? '-' + c.toLowerCase() : c.toLowerCase()).join('')
console.log(pascalNames.map(n => `(def ${pascal2kebab(n)} (interop/react-factory ${n}))`).join('\\n'))
"
"To add a new icon, go to https://mui.com/material-ui/material-icons/
Then add the corresponding entries in this file"
(:refer-clojure :exclude [comment compare filter list loop map print remove repeat shuffle sort update])
(:require [com.fulcrologic.fulcro.algorithms.react-interop :as interop]
["@mui/icons-material/Abc" :default Abc]
Expand Down
4 changes: 2 additions & 2 deletions src/main/glam/client/ui/project/project.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@

(mui/page-title name)
(mui/arrow-breadcrumbs {}
(mui/link {:color "inherit" :href (r/route-for :projects) :key "projects"} "Projects")
(mui/link {:color "textPrimary" :underline "none" :key "user"} name))
(mui/link {:variant "subtitle1" :color "inherit" :href (r/route-for :projects) :key "projects"} "Projects")
(mui/link {:variant "subtitle1" :color "textPrimary" :underline "none" :key "user"} name))

(mui/button
{:variant "outlined"
Expand Down
2 changes: 1 addition & 1 deletion src/main/glam/client/ui/root.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
:disabled (not session?)
:onClick #(c/transact! this [(set-open {:open? true})])}
(muic/menu {:fontSize "large"}))
((mui/styled-typography {:flex-grow 1}) {:variant "h5"} "Glam")
((mui/styled-typography {:flex-grow "1"}) {:variant "h5"} "Glam")
(logout-button this session?)))
(when session?
(ui-drawer
Expand Down

0 comments on commit 0884a92

Please sign in to comment.