|
606 | 606 | (defmethod popup-body :route-part-difficulty [popup] |
607 | 607 | [route-part-difficulty {:data (:data popup)}]) |
608 | 608 |
|
609 | | -(defui itrs-segment [{:keys [data]}] |
| 609 | +(r/defc itrs-segment [{:keys [data]}] |
610 | 610 | (let [{:keys [lipas-id fid]} data |
611 | | - tr (use-subscribe [:lipas.ui.subs/translator]) |
| 611 | + tr @(rf/subscribe [:lipas.ui.subs/translator]) |
612 | 612 | locale (tr) |
613 | | - properties (use-subscribe [::subs/edit-geom-properties fid]) |
| 613 | + properties @(rf/subscribe [::subs/edit-geom-properties fid]) |
614 | 614 | technical-value (:itrs-technical properties) |
615 | 615 | exposure-value (:itrs-exposure properties)] |
616 | | - ($ Paper |
617 | | - {:sx |
618 | | - #js {:padding 2 |
619 | | - :width "350px"}} |
620 | | - ($ TextField |
621 | | - {:label (tr :map/itrs-technical) |
622 | | - :select true |
623 | | - :fullWidth true |
624 | | - :value (or technical-value "") |
625 | | - :onChange (fn [e] |
626 | | - (rf/dispatch [::events/set-itrs-technical lipas-id fid (.. e -target -value)])) |
627 | | - :sx #js {:marginBottom 2}} |
628 | | - ($ MenuItem |
629 | | - {:key "empty" |
630 | | - :value ""} |
631 | | - "-") |
632 | | - (for [[k {:keys [label description]}] activities-data/itrs-technical-options] |
633 | | - ($ MenuItem |
634 | | - {:key k |
635 | | - :value k |
636 | | - :sx #js {:flexDirection "column" |
637 | | - :alignItems "flex-start" |
638 | | - :maxWidth "350px"}} |
639 | | - ($ Typography |
640 | | - (get label locale)) |
641 | | - ($ Typography |
642 | | - {:sx #js {:fontSize "body2.fontSize" |
643 | | - :whiteSpace "normal"}} |
644 | | - (get description locale))))) |
645 | | - ($ TextField |
646 | | - {:label (tr :map/itrs-exposure) |
647 | | - :select true |
648 | | - :fullWidth true |
649 | | - :value (or exposure-value "") |
650 | | - :onChange (fn [e] |
651 | | - (rf/dispatch [::events/set-itrs-exposure lipas-id fid (.. e -target -value)]))} |
652 | | - ($ MenuItem |
653 | | - {:key "empty" |
654 | | - :value ""} |
655 | | - "-") |
656 | | - (for [[k {:keys [label description]}] activities-data/itrs-exposure-options] |
657 | | - ($ MenuItem |
658 | | - {:key k |
659 | | - :value k |
660 | | - :sx #js {:flexDirection "column" |
661 | | - :alignItems "flex-start" |
662 | | - :maxWidth "350px"}} |
663 | | - ($ Typography |
664 | | - (get label locale)) |
665 | | - ($ Typography |
666 | | - {:sx #js {:fontSize "body2.fontSize" |
667 | | - :whiteSpace "normal"}} |
668 | | - (get description locale)))))))) |
| 616 | + [:> Paper |
| 617 | + {:sx |
| 618 | + #js {:padding 2 |
| 619 | + :width "350px"}} |
| 620 | + [:> TextField |
| 621 | + {:label (tr :map/itrs-technical) |
| 622 | + :select true |
| 623 | + :fullWidth true |
| 624 | + :value (or technical-value "") |
| 625 | + :onChange (fn [e] |
| 626 | + (rf/dispatch [::events/set-itrs-technical lipas-id fid (.. e -target -value)])) |
| 627 | + :sx #js {:marginBottom 2}} |
| 628 | + [:> MenuItem |
| 629 | + {:key "empty" |
| 630 | + :value ""} |
| 631 | + "-"] |
| 632 | + (for [[k {:keys [label description]}] activities-data/itrs-technical-options] |
| 633 | + [:> MenuItem |
| 634 | + {:key k |
| 635 | + :value k |
| 636 | + :sx #js {:flexDirection "column" |
| 637 | + :alignItems "flex-start" |
| 638 | + :maxWidth "350px"}} |
| 639 | + [:> Typography |
| 640 | + (get label locale)] |
| 641 | + [:> Typography |
| 642 | + {:sx #js {:fontSize "body2.fontSize" |
| 643 | + :whiteSpace "normal"}} |
| 644 | + (get description locale)]])] |
| 645 | + [:> TextField |
| 646 | + {:label (tr :map/itrs-exposure) |
| 647 | + :select true |
| 648 | + :fullWidth true |
| 649 | + :value (or exposure-value "") |
| 650 | + :onChange (fn [e] |
| 651 | + (rf/dispatch [::events/set-itrs-exposure lipas-id fid (.. e -target -value)]))} |
| 652 | + [:> MenuItem |
| 653 | + {:key "empty" |
| 654 | + :value ""} |
| 655 | + "-"] |
| 656 | + (for [[k {:keys [label description]}] activities-data/itrs-exposure-options] |
| 657 | + [:> MenuItem |
| 658 | + {:key k |
| 659 | + :value k |
| 660 | + :sx #js {:flexDirection "column" |
| 661 | + :alignItems "flex-start" |
| 662 | + :maxWidth "350px"}} |
| 663 | + [:> Typography |
| 664 | + (get label locale)] |
| 665 | + [:> Typography |
| 666 | + {:sx #js {:fontSize "body2.fontSize" |
| 667 | + :whiteSpace "normal"}} |
| 668 | + (get description locale)]])]])) |
669 | 669 |
|
670 | 670 | (defmethod popup-body :itrs-segment [popup] |
671 | | - ($ itrs-segment {:data (:data popup)})) |
| 671 | + [itrs-segment {:data (:data popup)}]) |
672 | 672 |
|
673 | 673 | (defmethod popup-body :heatmap [popup] |
674 | 674 | (let [tr (<== [:lipas.ui.subs/translator]) |
|
0 commit comments