Skip to content

Commit

Permalink
Link feedback slides to user profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
madis committed Nov 18, 2024
1 parent ae1751e commit c4f5de7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
20 changes: 12 additions & 8 deletions ui/src/ethlance/ui/component/carousel.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@


(defn c-feedback-slide
[{:keys [id rating author text image-url class]}]
[:div.feedback-slide
;; FIXME: use better unique key
{:key (str "feedback-" id "-" rating) :class class}
[:div.profile-image [c-profile-image {:src image-url}]]
[:div.rating [c-rating {:rating rating :color :white}]]
[:div.message text]
[:div.name author]])
[{:keys [id rating author text image-url class link-params]}]
(let [slide-content [:div.feedback-slide
;; FIXME: use better unique key
{:key (str "feedback-" id "-" rating) :class class}
[:div.profile-image [c-profile-image {:src image-url}]]
[:div.rating [c-rating {:rating rating :color :white}]]
[:div.message text]
[:div.name author]]]
(if link-params
[:a link-params slide-content]
slide-content))
)


(defn c-carousel
Expand Down
12 changes: 8 additions & 4 deletions ui/src/ethlance/ui/page/profile.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@
{:rating (:feedback/rating item)
:text (:feedback/text item)
:image-url (-> item :feedback/from-user :user/profile-image)
:author (get-in item [:feedback/from-user :user/name])})
:author (get-in item [:feedback/from-user :user/name])
:link-params (navigation/link-params {:route :route.user/profile :params {:address (get-in item [:feedback/from-user :user/id])}})})


(defn c-missing-profile-notification
Expand Down Expand Up @@ -266,7 +267,8 @@
:feedback/text
:feedback/rating
[:feedback/from-user
[:user/name
[:user/id
:user/name
:user/profile-image]]]]]]]]
results (re/subscribe [::gql/query {:queries [query]}])
name (get-in @results [:candidate :user :user/name])
Expand Down Expand Up @@ -318,7 +320,8 @@
:feedback/text
:feedback/rating
[:feedback/from-user
[:user/name
[:user/id
:user/name
:user/profile-image]]]]]]]]
results (re/subscribe [::gql/query {:queries [query]}])
name (get-in @results [:employer :user :user/name])
Expand Down Expand Up @@ -429,7 +432,8 @@
:feedback/text
:feedback/rating
[:feedback/from-user
[:user/name
[:user/id
:user/name
:user/profile-image]]]]]]]]
results (re/subscribe [::gql/query {:queries [query]}])
name (get-in @results [:arbiter :user :user/name])
Expand Down

0 comments on commit c4f5de7

Please sign in to comment.