Browse code

Refactor short spell description

Joseph Weston authored on 05/12/2021 05:43:05
Showing 1 changed files
... ...
@@ -95,6 +95,13 @@
95 95
       (-> x :weight pounds)
96 96
       (some->> x :quantity (str "for ") parenthesize))))
97 97
 
98
+(defn- short-spell-description [spell]
99
+  (spaced
100
+    (-> spell :level ordinal)
101
+    "level"
102
+    (-> spell :school :name string/lower-case)
103
+    "spell"))
104
+
98 105
 (defn license-panel [license]
99 106
     [:article {:class (styles/license-panel)}
100 107
      [:h1 (license :license-name)]
... ...
@@ -105,13 +112,7 @@
105 112
 (defn spell-panel [spell]
106 113
       [:article {:class (styles/spell-panel)}
107 114
        (heading spell)
108
-       [:div
109
-        [:span.kind
110
-         (spaced
111
-          (-> spell :level ordinal)
112
-          "level"
113
-          (-> spell :school :name string/lower-case)
114
-          "spell")]]
115
+       [:div [:span.kind (short-spell-description spell)]]
115 116
        (property-list
116 117
         ; Refactor these so that we get the "name" from the keyword by replacing
117 118
         ; '-' and '_' and capitalizing