enhancement: minor enhancement to the no native FS API display

This commit is contained in:
Junyi Du
2023-01-31 14:21:22 +08:00
parent c0d81dd389
commit 36dde7b53d
3 changed files with 15 additions and 12 deletions

View File

@@ -4,6 +4,7 @@
[frontend.ui :as ui]
[frontend.context.i18n :refer [t]]
[frontend.components.svg :as svg]
[frontend.components.widgets :as widgets]
[frontend.handler.page :as page-handler]
[frontend.handler.route :as route-handler]
[frontend.handler.ui :as ui-handler]
@@ -96,11 +97,7 @@
[:small "Open existing directory or Create a new one"]])]]]
[:div.px-5
(ui/admonition :warning
[:p "It seems that your browser doesn't support the "
[:a {:href "https://web.dev/file-system-access/"
:target "_blank"}
"new native filesystem API"]
[:span ", please use any Chromium 86+ based browser like Chrome, Vivaldi, Edge, etc. Notice that the API doesn't support mobile browsers at the moment."]])]))]
(widgets/native-fs-api-alert))]))]
[:section.b.flex.items-center.flex-col
[:p.flex
[:i.as-flex-center (ui/icon "zoom-question" {:style {:fontSize "22px"}})]

View File

@@ -184,7 +184,9 @@
(->>
(concat repo-links
[(when (seq repo-links) {:hr true})
{:title (t :new-graph) :options {:on-click #(state/pub-event! [:graph/setup-a-repo])}}
(if (or (nfs-handler/supported?) (mobile-util/native-platform?))
{:title (t :new-graph) :options {:on-click #(state/pub-event! [:graph/setup-a-repo])}}
{:title (t :new-graph) :options {:href (rfe/href :repos)}}) ;; Brings to the repos page for showing fallback message
{:title (t :all-graphs) :options {:href (rfe/href :repos)}}
refresh-link
reindex-link

View File

@@ -9,6 +9,15 @@
[frontend.mobile.util :as mobile-util]
[frontend.state :as state]))
(rum/defc native-fs-api-alert
[]
[:p "It seems that your browser doesn't support the "
[:a {:href "https://web.dev/file-system-access/"
:target "_blank"}
"new native filesystem API"]
[:span ", please use any Chromium 86+ based browser like Chrome, Vivaldi, Edge, etc. Notice that the API doesn't support mobile browsers at the moment."]])
(rum/defc add-local-directory
[]
[:div.flex.flex-col
@@ -38,12 +47,7 @@
[:li (t :on-boarding/new-graph-desc-4)]
[:li (t :on-boarding/new-graph-desc-5)]]
(when-not nfs-supported?
(ui/admonition :warning
[:p "It seems that your browser doesn't support the "
[:a {:href "https://web.dev/file-system-access/"
:target "_blank"}
"new native filesystem API"]
[:span ", please use any Chromium 86+ based browser like Chrome, Vivaldi, Edge, etc. Notice that the API doesn't support mobile browsers at the moment."]]))]]]))])
(ui/admonition :warning (native-fs-api-alert)))]]]))])
(rum/defc android-permission-alert
[]