Merge pull request #3668 from penpot/juan-redesign-dashboard

💄 Add new dashboard UI look and feel
This commit is contained in:
Aitor Moreno 2023-09-28 10:38:58 +02:00 committed by GitHub
commit bf623338ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 952 additions and 30 deletions

View file

@ -138,18 +138,19 @@
(mf/defc dashboard
[{:keys [route profile] :as props}]
(let [section (get-in route [:data :name])
params (parse-params route)
(let [new-css-system (mf/use-ctx ctx/new-css-system)
section (get-in route [:data :name])
params (parse-params route)
project-id (:project-id params)
team-id (:team-id params)
search-term (:search-term params)
project-id (:project-id params)
team-id (:team-id params)
search-term (:search-term params)
teams (mf/deref refs/teams)
team (get teams team-id)
teams (mf/deref refs/teams)
team (get teams team-id)
projects (mf/deref refs/dashboard-projects)
project (get projects project-id)]
projects (mf/deref refs/dashboard-projects)
project (get projects project-id)]
(hooks/use-shortcuts ::dashboard sc/shortcuts)
@ -177,7 +178,9 @@
;; components on team change. Many components assumes that the
;; team is already set so don't put the team into mf/deps.
(when team
[:main.dashboard-layout {:key (:id team)}
[:main {:class (dom/classnames :dashboard-layout (not new-css-system)
:dashboard-layout-refactor new-css-system)
:key (:id team)}
[:& sidebar
{:team team
:projects projects

View file

@ -8,6 +8,7 @@
(:require
[app.main.refs :as refs]
[app.main.store :as st]
[app.main.ui.context :as ctx]
[app.main.ui.settings.access-tokens :refer [access-tokens-page]]
[app.main.ui.settings.change-email]
[app.main.ui.settings.delete-account]
@ -16,6 +17,7 @@
[app.main.ui.settings.password :refer [password-page]]
[app.main.ui.settings.profile :refer [profile-page]]
[app.main.ui.settings.sidebar :refer [sidebar]]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]]
[app.util.router :as rt]
[rumext.v2 :as mf]))
@ -29,7 +31,8 @@
(mf/defc settings
[{:keys [route] :as props}]
(let [section (get-in route [:data :name])
(let [new-css-system (mf/use-ctx ctx/new-css-system)
section (get-in route [:data :name])
profile (mf/deref refs/profile)
locale (mf/deref i18n/locale)]
@ -37,27 +40,28 @@
#(when (nil? profile)
(st/emit! (rt/nav :auth-login))))
[:section.dashboard-layout
[:& sidebar {:profile profile
:locale locale
:section section}]
[:section {:class (dom/classnames :dashboard-layout (not new-css-system)
:dashboard-layout-refactor new-css-system)}
[:& sidebar {:profile profile
:locale locale
:section section}]
[:div.dashboard-content
[:& header]
[:section.dashboard-container
(case section
:settings-profile
[:& profile-page {:locale locale}]
[:div.dashboard-content
[:& header]
[:section.dashboard-container
(case section
:settings-profile
[:& profile-page {:locale locale}]
:settings-feedback
[:& feedback-page]
:settings-feedback
[:& feedback-page]
:settings-password
[:& password-page {:locale locale}]
:settings-password
[:& password-page {:locale locale}]
:settings-options
[:& options-page {:locale locale}]
:settings-options
[:& options-page {:locale locale}]
:settings-access-tokens
[:& access-tokens-page])]]]))
:settings-access-tokens
[:& access-tokens-page])]]]))