mirror of
https://github.com/logseq/logseq.git
synced 2026-02-01 22:47:36 +00:00
enhance: move add new graph to switch graph
This commit is contained in:
@@ -9,8 +9,7 @@ const config: CapacitorConfig = {
|
||||
webDir: 'static/capacitor',
|
||||
loggingBehavior: 'debug',
|
||||
server: {
|
||||
url: "https://192.168.10.208:3002",
|
||||
cleartext: true
|
||||
androidScheme: 'http',
|
||||
},
|
||||
plugins: {
|
||||
StatusBar: {
|
||||
|
||||
@@ -36,29 +36,29 @@
|
||||
"Select a Graph")]
|
||||
[:<>
|
||||
(ionic/ion-button
|
||||
{:fill "clear" :mode "ios"
|
||||
:class "border-none w-full rounded-lg font-semibold pt-2"
|
||||
{:fill "clear"
|
||||
:mode "ios"
|
||||
:class "border-none w-full rounded-lg"
|
||||
:on-click (fn []
|
||||
(ui/open-modal! "Switch graph"
|
||||
{:type :action-sheet
|
||||
:buttons (for [repo graphs]
|
||||
{:text (some-> (:url repo) (string/replace #"^logseq_db_" ""))
|
||||
:role (:url repo)})
|
||||
:inputs []
|
||||
:on-action (fn [e]
|
||||
(when-let [url (:role e)]
|
||||
(when (string/starts-with? url "logseq_db_")
|
||||
(fstate/pub-event! [:graph/switch url]))))}))}
|
||||
short-repo-name)
|
||||
|
||||
(ionic/ion-button
|
||||
{:class "relative -left-2 pt-1.5 opacity-50"
|
||||
:on-click (fn []
|
||||
(when-let [db-name (js/prompt "Create new db")]
|
||||
(when-not (string/blank? db-name)
|
||||
(-> (repo-handler/new-db! db-name)
|
||||
(p/then #())))))}
|
||||
(ionic/tabler-icon "plus" {:size 24}))]))
|
||||
(let [buttons (concat
|
||||
(for [repo graphs]
|
||||
{:text (some-> (:url repo) (string/replace #"^logseq_db_" ""))
|
||||
:role (:url repo)})
|
||||
[{:text "Add new graph"
|
||||
:role "add-new-graph"}])]
|
||||
(ui/open-modal! "Switch graph"
|
||||
{:type :action-sheet
|
||||
:buttons buttons
|
||||
:inputs []
|
||||
:on-action (fn [e]
|
||||
(when-let [role (:role e)]
|
||||
(if (= "add-new-graph" role)
|
||||
(when-let [db-name (js/prompt "Create new db")]
|
||||
(when-not (string/blank? db-name)
|
||||
(repo-handler/new-db! db-name)))
|
||||
(when (string/starts-with? role "logseq_db_")
|
||||
(fstate/pub-event! [:graph/switch role])))))})))}
|
||||
short-repo-name)]))
|
||||
|
||||
(rum/defc bottom-tabs
|
||||
[]
|
||||
@@ -157,14 +157,14 @@
|
||||
(let [val (.-value (.-detail e))]
|
||||
(apply-date! val)
|
||||
(close!)))}))))))}
|
||||
[:span {:slot "icon-only"} (ionic/tabler-icon "calendar-month" {:size 26})])
|
||||
[:span {:slot "icon-only"} (ionic/tabler-icon "calendar-month" {:size 24})])
|
||||
|
||||
(ionic/ion-button {:fill "clear"}
|
||||
(ionic/ion-nav-link
|
||||
{:routerDirection "forward"
|
||||
:class "w-full"
|
||||
:component settings/page}
|
||||
[:span {:slot "icon-only"} (ionic/tabler-icon "dots-circle-horizontal" {:size 26})])))))
|
||||
[:span {:slot "icon-only"} (ionic/tabler-icon "dots" {:size 24})])))))
|
||||
|
||||
;; main content
|
||||
(if db-restoring?
|
||||
|
||||
@@ -133,4 +133,5 @@ ion-textarea {
|
||||
|
||||
:root {
|
||||
--ls-page-title-size: 26px;
|
||||
--ion-color-primary: #000000;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user