Selaa lähdekoodia

Add editor topbar for more UI mimicry

Eric Zhang 4 vuotta sitten
vanhempi
commit
efcc9591ff
1 muutettua tiedostoa jossa 36 lisäystä ja 12 poistoa
  1. 36 12
      src/App.tsx

+ 36 - 12
src/App.tsx

@@ -17,7 +17,14 @@ import {
   Text,
   Text,
   useToast,
   useToast,
 } from "@chakra-ui/react";
 } from "@chakra-ui/react";
-import { VscAccount, VscCircleFilled, VscRemote } from "react-icons/vsc";
+import {
+  VscAccount,
+  VscChevronRight,
+  VscCircleFilled,
+  VscFolderOpened,
+  VscGist,
+  VscRemote,
+} from "react-icons/vsc";
 import Editor from "@monaco-editor/react";
 import Editor from "@monaco-editor/react";
 import { editor } from "monaco-editor/esm/vs/editor/editor.api";
 import { editor } from "monaco-editor/esm/vs/editor/editor.api";
 import Rustpad from "./rustpad";
 import Rustpad from "./rustpad";
@@ -183,17 +190,34 @@ function App() {
             </Text>
             </Text>
           </Container>
           </Container>
         </Flex>
         </Flex>
-        <Box flex={1} minW={0} h="100%">
-          <Editor
-            theme="vs"
-            language={language}
-            options={{
-              automaticLayout: true,
-              fontSize: 14,
-            }}
-            onMount={(editor) => setEditor(editor)}
-          />
-        </Box>
+        <Flex flex={1} minW={0} h="100%" direction="column" overflow="hidden">
+          <HStack
+            h={6}
+            spacing={1}
+            color="gray.500"
+            fontWeight="medium"
+            fontSize="13px"
+            px={3.5}
+            flexShrink={0}
+          >
+            <Icon as={VscFolderOpened} fontSize="md" color="blue.600" />
+            <Text>documents</Text>
+            <Icon as={VscChevronRight} fontSize="md" />
+            <Icon as={VscGist} fontSize="md" color="purple.600" />
+            <Text>{id}</Text>
+          </HStack>
+          <Box flex={1} minH={0}>
+            <Editor
+              theme="vs"
+              language={language}
+              options={{
+                automaticLayout: true,
+                fontSize: 13,
+              }}
+              onMount={(editor) => setEditor(editor)}
+            />
+          </Box>
+        </Flex>
       </Flex>
       </Flex>
       <Flex h="22px" bgColor="#0071c3" color="white">
       <Flex h="22px" bgColor="#0071c3" color="white">
         <Flex
         <Flex