Skip to content

Commit

Permalink
Hide job details sections until their data is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
madis committed May 13, 2024
1 parent fae235b commit a6f80af
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ui/src/ethlance/ui/page/job_detail.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
[c-loading-spinner]
component-when-loading-finished))

(defn hidden-until-data-ready
[loading-states component-when-loading-finished]
(when (every? false? loading-states)
component-when-loading-finished))

(defn c-invoice-listing
[contract-address]
(let [invoices-query [:job {:job/id contract-address}
Expand Down Expand Up @@ -665,10 +670,7 @@
[c-main-layout {:container-opts {:class :job-detail-main-container}}
[spinner-until-data-ready [loading? processing?]
[c-job-info-section results]]

(when (not (:graphql/loading? @query-results)) [c-proposals-section results])
[c-arbitrations-section contract-address]

[c-invoice-listing contract-address]

[c-employer-feedback contract-address]])))
[hidden-until-data-ready [loading? processing?] [c-proposals-section results]]
[hidden-until-data-ready [loading? processing?] [c-arbitrations-section contract-address]]
[hidden-until-data-ready [loading? processing?] [c-invoice-listing contract-address]]
[hidden-until-data-ready [loading? processing?] [c-employer-feedback contract-address]]])))

0 comments on commit a6f80af

Please sign in to comment.