|
51 | 51 |
|
52 | 52 | (defn- display-error [{:keys [exception message data]} position] |
53 | 53 | ^{:key position} |
54 | | - [:div {:class "flex flex-col gap-2"} |
55 | | - [:div {:class "bg-red-100 border-l-4 border-red-500 text-red-700 p-4"} |
| 54 | + [:div {:class "flex flex-col gap-1 sm:gap-2"} |
| 55 | + [:div {:class "bg-red-100 border-l-4 border-red-500 text-red-700 p-2 sm:p-4"} |
56 | 56 | [:p {:class "font-bold"} (str "Error: " exception)] |
57 | 57 | [:p {:class "whitespace-pre-wrap font-mono"} |
58 | 58 | (->> (str/split message #"(?:\r\n|\r|\n)") |
|
64 | 64 | [:p (pr-str data)]])]]) |
65 | 65 |
|
66 | 66 | (defn- display-warnings [warnings] |
67 | | - [:div {:class "flex flex-col gap-2"} |
68 | | - [:div {:class "bg-amber-500 border-l-4 border-amber-600 text-gray-500 p-4"} |
| 67 | + [:div {:class "flex flex-col gap-1 sm:gap-2"} |
| 68 | + [:div {:class "bg-amber-500 border-l-4 border-amber-600 text-gray-500 p-2 sm:p-4"} |
69 | 69 | [:p {:class "font-bold"} "Warnings:"] |
70 | 70 | [:p {:class "whitespace-pre-wrap font-mono"} |
71 | 71 | (->> warnings |
|
258 | 258 | (when (or @loading? |
259 | 259 | @show-results?) |
260 | 260 | ^{:key position} |
261 | | - [:div {:class (str half-window-col-class |
262 | | - "grow h-auto max-h-none border overflow-x-auto overflow-y-hidden")} |
| 261 | + [:div {:class (str "sm:mx-0 flex flex-col " |
| 262 | + "sm:flex-1 md:max-w-[48vw] lg:max-w-[49vw] " |
| 263 | + "border overflow-x-auto")} |
263 | 264 | (if @loading? |
264 | 265 | [spinner] |
265 | 266 | (let [{::run/keys [results failure response?]} @results-or-failure] |
|
281 | 282 | (fn [idx {:keys [result error warnings timing-ms]}] |
282 | 283 | ^{:key idx} |
283 | 284 | [:div {:class (if (pos? idx) |
284 | | - "border-t-2 border-gray-100 py-2" |
285 | | - "py-2")} |
| 285 | + "border-t-2 border-gray-100 py-0 sm:py-1" |
| 286 | + "py-0 sm:py-1")} |
286 | 287 | (cond |
287 | 288 | (not response?) initial-message |
288 | 289 | (seq error) [display-error error (str position "-" idx)] |
|
299 | 300 | (when (seq warnings) |
300 | 301 | [display-warnings warnings]) |
301 | 302 | (when timing-ms |
302 | | - [:div {:class "text-right text-xs text-gray-500 pr-4 pb-2"} |
| 303 | + [:div {:class "text-right text-xs text-gray-500 pr-4 pb-1"} |
303 | 304 | (str timing-ms " ms")])]) |
304 | 305 | the-result))]))))]))) |
305 | 306 |
|
|
313 | 314 | [:dispatch [:update-url]]]])}]]) |
314 | 315 |
|
315 | 316 | (defn- add-statement-button [] |
316 | | - [:div {:class "flex flex-col sm:flex-row pb-4"} |
| 317 | + [:div {:class "flex flex-col sm:flex-row pb-2 sm:pb-4"} |
317 | 318 | [:div {:class "flex-col flex-1"} |
318 | 319 | [:div {:class "flex flex-row justify-center"} |
319 | 320 | [:button {:class "w-10 h-10 bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 rounded-full" |
|
336 | 337 | (swap! tx-refs conj ref) |
337 | 338 | ^{:key id} |
338 | 339 | [:<> |
339 | | - [:div {:class "flex flex-col sm:flex-row gap-y-2"} |
| 340 | + [:div {:class "flex flex-col sm:flex-row gap-y-1 sm:gap-y-2"} |
340 | 341 | [:div {:class (str half-window-col-class |
341 | 342 | " grow h-fit overflow-visible sm:overflow-y-auto sm:pr-4 ")} |
342 | 343 | (when (< 1 (count statements)) |
|
356 | 357 | (fn [] |
357 | 358 | [:div {:class "flex flex-col min-h-screen w-full"} |
358 | 359 | [header @tx-type global-tx-refs] |
359 | | - [:div {:class "py-2 sm:px-4 flex-grow flex flex-row gap-2"} |
| 360 | + [:div {:class "py-1 sm:py-2 sm:px-4 flex-grow flex flex-row gap-2"} |
360 | 361 | (let [ctx {:editor (editor/default-editor @tx-type) |
361 | 362 | :tx-refs global-tx-refs}] |
362 | | - [:div {:class "flex flex-col gap-4 sm:gap-2 w-full"} |
| 363 | + [:div {:class "flex flex-col gap-1 sm:gap-2 w-full"} |
363 | 364 | [statements ctx] |
364 | 365 | mobile-gap])] |
365 | 366 | [footer]]))) |
0 commit comments