diff --git a/ui/src/ethlance/ui/component/token_info.cljs b/ui/src/ethlance/ui/component/token_info.cljs index a449a04c..8aba3df0 100644 --- a/ui/src/ethlance/ui/component/token_info.cljs +++ b/ui/src/ethlance/ui/component/token_info.cljs @@ -10,12 +10,12 @@ (defn token-info-str [token-amount token-detail] (let [token-type (:token-detail/type token-detail) - token-name (:token-detail/name token-detail) + token-symbol (:token-detail/symbol token-detail) decimals (:token-detail/decimals token-detail)] (str (util.tokens/human-amount token-amount token-type decimals) " " - (if token-name - token-name + (if token-symbol + (name token-symbol) (clojure.string/upper-case (name (or token-type :?))))))) diff --git a/ui/src/ethlance/ui/page/job_detail.cljs b/ui/src/ethlance/ui/page/job_detail.cljs index aaa82697..b01026ab 100644 --- a/ui/src/ethlance/ui/page/job_detail.cljs +++ b/ui/src/ethlance/ui/page/job_detail.cljs @@ -28,29 +28,6 @@ [re-frame.core :as re])) -(defn c-token-values - [{:keys [token-type token-amount token-address token-id disabled? token-symbol token-name]}] - (let [token-type (keyword token-type) - step (if (= token-type :eth) 0.001 1)] - (cond - (= :erc721 token-type) - [:div "The payment will be NFT (ERC721)"] - - (#{:eth :erc1155 :erc20} token-type) - [:div.amount-input - [c-text-input - {:placeholder "Token amount" - :step step - :type :number - :default-value nil - :disabled disabled? - :value token-amount - :on-change #(re/dispatch [:page.job-detail/set-proposal-token-amount (js/parseFloat %)])}] - [:a {:href (token-utils/address->token-info-url token-address) :target "_blank"} - [:label token-symbol] - [:label (str "(" (or token-name (name token-type)) ")")]]]))) - - (defn c-invoice-listing [contract-address] (let [invoices-query [:job {:job/id contract-address} diff --git a/ui/src/ethlance/ui/page/profile.cljs b/ui/src/ethlance/ui/page/profile.cljs index 49a70093..248eb465 100644 --- a/ui/src/ethlance/ui/page/profile.cljs +++ b/ui/src/ethlance/ui/page/profile.cljs @@ -7,7 +7,7 @@ [district.ui.router.events :as router-events] [district.ui.router.subs :as router-subs] [ethlance.shared.utils :refer [ilike=]] - [ethlance.ui.component.button :refer [c-button c-button-label c-button-icon-label]] + [ethlance.ui.component.button :refer [c-button c-button-label]] [ethlance.ui.component.carousel :refer [c-carousel c-feedback-slide]] [ethlance.ui.component.main-layout :refer [c-main-layout]] [ethlance.ui.component.pagination :refer [c-pagination-ends]] @@ -19,6 +19,7 @@ [ethlance.ui.component.tabular-layout :refer [c-tabular-layout]] [ethlance.ui.component.tag :refer [c-tag c-tag-label]] [ethlance.ui.component.textarea-input :refer [c-textarea-input]] + [ethlance.ui.component.token-info :as token-info] [ethlance.ui.page.profile.events :as profile-events] [ethlance.ui.page.profile.subscriptions] [ethlance.ui.util.dates :as util.dates] @@ -94,7 +95,7 @@ [arbitration] {:title (get-in arbitration [:job :job/title]) :start-date (get arbitration :arbitration/date-arbiter-accepted) ; - :fee (str (get arbitration :arbitration/fee) " " (get arbitration :arbitration/fee-currency-id)) + :fee (token-info/token-info-str (get arbitration :arbitration/fee) (get arbitration :fee-token-details)) :status (get arbitration :arbitration/status)}) @@ -114,8 +115,13 @@ [:id :arbitration/date-arbiter-accepted :arbitration/fee - :arbitration/fee-currency-id :arbitration/status + [:fee-token-details + [:token-detail/id + :token-detail/type + :token-detail/name + :token-detail/symbol + :token-detail/decimals]] [:job [:job/title]]]]]]]] results @(re/subscribe [::gql/query {:queries [query]} {:refetch-on #{::profile-events/invite-arbiter-tx-success}}]) @@ -398,8 +404,9 @@ (defn c-arbiter-profile [] - (let [user-address (re/subscribe [:page.profile/viewed-user-address]) - query [:arbiter {:user/id @user-address} + (let [viewed-user-address (re/subscribe [:page.profile/viewed-user-address]) + logged-in-user-address (:user/id @(re/subscribe [:ethlance.ui.subscriptions/active-session])) + query [:arbiter {:user/id @viewed-user-address} [:arbiter/professional-title :arbiter/bio :arbiter/rating @@ -409,7 +416,9 @@ [:user/name :user/profile-image :user/country - :user/languages]] + :user/languages + :user/is-registered-employer + :user/is-registered-arbiter]] [:arbiter/feedback [:total-count [:items @@ -428,7 +437,8 @@ languages (get-in @results [:arbiter :user :user/languages]) feedback-list (map prepare-feedback-cards (get-in @results [:arbiter :arbiter/feedback :items])) rating {:average (get-in @results [:arbiter :arbiter/rating]) :count (count feedback-list)} - has-arbiter-profile? (not (nil? biography))] + has-arbiter-profile? (get-in @results [:arbiter :user :user/is-registered-arbiter]) + viewing-own-profile? (ethlance.shared.utils/ilike= @viewed-user-address logged-in-user-address)] [:<> (if has-arbiter-profile? [:div.arbiter-profile @@ -444,7 +454,7 @@ [c-tag-list "Languages" languages]]] [c-missing-profile-notification :arbiter]) - (when has-arbiter-profile? [c-invite-arbiter]) + (when (and has-arbiter-profile? (not viewing-own-profile?)) [c-invite-arbiter]) (when has-arbiter-profile? (c-arbitration-activity)) (c-feedback-listing professional-title feedback-list)]))