From d66497fc8b0a1bf6e460fa4e1dc265f900d19a76 Mon Sep 17 00:00:00 2001 From: Stuart Hanberg Date: Sat, 20 Aug 2022 16:12:45 -0400 Subject: [PATCH 1/9] feat: block in quick capture routte --- src/cljs/athens/router.cljs | 1 + src/cljs/athens/views/pages/core.cljs | 3 + .../athens/views/pages/quick_capture.cljs | 8 +++ src/js/components/Quick/QuickCapture.tsx | 67 +++++++++++++++++++ 4 files changed, 79 insertions(+) create mode 100644 src/cljs/athens/views/pages/quick_capture.cljs create mode 100644 src/js/components/Quick/QuickCapture.tsx diff --git a/src/cljs/athens/router.cljs b/src/cljs/athens/router.cljs index ebc2a84d9d..3943195fe3 100644 --- a/src/cljs/athens/router.cljs +++ b/src/cljs/athens/router.cljs @@ -156,6 +156,7 @@ (def routes ["/" ["" {:name :home}] + ["quick-capture" {:name :quickcapture}] ["settings" {:name :settings}] ["pages" {:name :pages}] ["page-t/:title" {:name :page-by-title}] diff --git a/src/cljs/athens/views/pages/core.cljs b/src/cljs/athens/views/pages/core.cljs index 8c39b43c09..7906e83476 100644 --- a/src/cljs/athens/views/pages/core.cljs +++ b/src/cljs/athens/views/pages/core.cljs @@ -4,6 +4,7 @@ [athens.views.hoc.perf-mon :as perf-mon] [athens.views.pages.all-pages :as all-pages] [athens.views.pages.daily-notes :as daily-notes] + [athens.views.pages.quick-capture :as quick-capture] [athens.views.pages.graph :as graph] [athens.views.pages.page :as page] [re-frame.core :as rf])) @@ -20,6 +21,8 @@ :title "Reconnecting to server..."}))) [:<> (case @route-name + :quickcapture [perf-mon/hoc-perfmon-no-new-tx {:span-name "quick-capture"} + [quick-capture/quick-capture]] :pages [perf-mon/hoc-perfmon-no-new-tx {:span-name "pages/all-pages"} [all-pages/page]] :page [perf-mon/hoc-perfmon {:span-name "pages/page"} diff --git a/src/cljs/athens/views/pages/quick_capture.cljs b/src/cljs/athens/views/pages/quick_capture.cljs new file mode 100644 index 0000000000..3176a355b7 --- /dev/null +++ b/src/cljs/athens/views/pages/quick_capture.cljs @@ -0,0 +1,8 @@ +(ns athens.views.pages.quick-capture + (:require + ["/components/Quick/QuickCapture" :refer [QuickCapture]])) + +(defn quick-capture + [] + (let [] + [:> QuickCapture "hello this is quick capture"])) \ No newline at end of file diff --git a/src/js/components/Quick/QuickCapture.tsx b/src/js/components/Quick/QuickCapture.tsx new file mode 100644 index 0000000000..2055ec7fbf --- /dev/null +++ b/src/js/components/Quick/QuickCapture.tsx @@ -0,0 +1,67 @@ +import React from 'react' +import { FormControl, Button, Box, HStack, Text, Textarea, VStack, Flex, FormLabel } from "@chakra-ui/react" +import { LayoutContext } from '@/Layout/useLayoutState' + +const FloatingInput = (props) => { + const { onSubmit } = props + const [string, setString] = React.useState("") + const inputRef = React.useRef(null) + + React.useEffect(() => { + inputRef.current.focus() + }, []) + + return + + {/* Capture a thought */} +