Refactor user menu in dashboard

This commit is contained in:
Andrés Moya 2022-02-09 11:05:25 +01:00
parent 62a67bdb94
commit c5c331ee30
7 changed files with 60 additions and 16 deletions

View file

@ -513,22 +513,30 @@
[:li {:on-click (partial on-click :settings-profile)
:data-test "profile-profile-opt"}
[:span.icon i/user]
[:span.text (tr "labels.profile")]]
[:li {:on-click (partial on-click :settings-password)
:data-test "password-profile-opt"}
[:span.icon i/lock]
[:span.text (tr "labels.password")]]
[:li {:on-click #(on-click (du/logout) %)
:data-test "logout-profile-opt"}
[:span.icon i/exit]
[:span.text (tr "labels.logout")]]
[:span.text (tr "labels.your-account")]]
[:li.separator {:on-click #(dom/open-new-window "https://help.penpot.app")
:data-test "help-center-profile-opt"}
[:span.icon i/help]
[:span.text (tr "labels.help-center")]]
[:li {:on-click #(dom/open-new-window "https://penpot.app/libraries-templates.html")
:data-test "libraries-templates-profile-opt"}
[:span.icon i/download]
[:span.text (tr "labels.libraries-and-templates")]]
[:li {:on-click #(dom/open-new-window "https://penpot.app?no-redirect=1")
:data-test "about-penpot-profile-opt"} ;; Parameter ?no-redirect is to force stay in landing page
[:span.icon i/logo-icon] ;; instead of redirecting to app
[:span.text (tr "labels.about-penpot")]]
(when (contains? @cf/flags :user-feedback)
[:li.feedback {:on-click (partial on-click :settings-feedback)
[:li.separator {:on-click (partial on-click :settings-feedback)
:data-test "feedback-profile-opt"}
[:span.icon i/msg-info]
[:span.text (tr "labels.give-feedback")]
])]]]
[:span.text (tr "labels.give-feedback")]])
[:li.separator {:on-click #(on-click (du/logout) %)
:data-test "logout-profile-opt"}
[:span.icon i/exit]
[:span.text (tr "labels.logout")]]]]]
(when (and team profile)
[:& comments-section {:profile profile

View file

@ -64,6 +64,7 @@
(def full-screen-off (icon-xref :full-screen-off))
(def grid (icon-xref :grid))
(def grid-snap (icon-xref :grid-snap))
(def help (icon-xref :help))
(def icon-empty (icon-xref :icon-empty))
(def icon-list (icon-xref :icon-list))
(def icon-lock (icon-xref :icon-lock))

View file

@ -241,7 +241,6 @@
[:span (tr "workspace.header.menu.option.preferences")] [:span i/arrow-slide]]
(when (contains? @cf/flags :user-feedback)
[:*
[:li.separator]
[:li.feedback {:on-click (st/emitf (rt/nav :settings-feedback))}
[:span (tr "labels.give-feedback")]]])]]