Show current page in browser title

This commit is contained in:
Andrés Moya 2021-03-22 13:41:12 +01:00 committed by Andrey Antukh
parent 0008a2aa48
commit 6383dc0952
16 changed files with 202 additions and 15 deletions

View file

@ -17,7 +17,7 @@
[app.main.ui.dashboard.project-menu :refer [project-menu]]
[app.main.ui.icons :as i]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [t]]
[app.util.i18n :as i18n :refer [tr]]
[app.util.keyboard :as kbd]
[app.util.router :as rt]
[okulary.core :as l]
@ -27,7 +27,6 @@
[{:keys [team project] :as props}]
(let [local (mf/use-state {:menu-open false
:edition false})
locale (mf/deref i18n/locale)
project-id (:id project)
team-id (:id team)
@ -56,7 +55,7 @@
[:header.dashboard-header
(if (:is-default project)
[:div.dashboard-title
[:h1 (t locale "labels.drafts")]]
[:h1 (tr "labels.drafts")]]
(if (:edition @local)
[:& inline-edition {:content (:name project)
@ -77,7 +76,7 @@
:on-click toggle-pin}
i/pin]]))
[:a.btn-secondary.btn-small {:on-click on-create-clicked}
(t locale "dashboard.new-file")]]))
(tr "dashboard.new-file")]]))
(defn files-ref
[project-id]
@ -94,6 +93,10 @@
(mf/use-effect
(mf/deps (:id project))
(fn []
(dom/set-html-title (tr "title.dashboard.files"
(if (:is-default project)
(tr "labels.drafts")
(:name project))))
(st/emit! (dd/fetch-files {:project-id (:id project)})
(dd/clear-selected-files))))