From 6cd4319fcf540ef70f74cc2f10d0d4297ee7b788 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Thu, 11 Apr 2024 16:59:01 +0100 Subject: feat(gui): add base structure (#1935) * initial * ui things * cargo * update, add history refresh button * history page a bit better, add initial dotfiles page * re-org layout * bye squigglies * add dotfiles ui, show aliases * add default shell detection * put stats in a little drawer, alias import changes * use new table for aliases, add alias deleting * support adding aliases * close drawer when added, no alias autocomplete * clippy, format * attempt to ensure gdk is installed ok * sudo * no linux things on mac ffs * I forgot we build for windows too... end of day * remove tauri backend from workspace --- ui/src/App.tsx | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 ui/src/App.tsx (limited to 'ui/src/App.tsx') diff --git a/ui/src/App.tsx b/ui/src/App.tsx new file mode 100644 index 00000000..5d1cd863 --- /dev/null +++ b/ui/src/App.tsx @@ -0,0 +1,116 @@ +import "./App.css"; + +import { Fragment, useState, useEffect, ReactElement } from "react"; +import { Dialog, Transition } from "@headlessui/react"; +import { + Bars3Icon, + ChartPieIcon, + Cog6ToothIcon, + HomeIcon, + XMarkIcon, + MagnifyingGlassIcon, + ClockIcon, + WrenchScrewdriverIcon, +} from "@heroicons/react/24/outline"; +import Logo from "./assets/logo-light.svg"; + +function classNames(...classes: any) { + return classes.filter(Boolean).join(" "); +} + +import History from "./pages/History.tsx"; +import Dotfiles from "./pages/Dotfiles.tsx"; + +enum Section { + History, + Dotfiles, +} + +function renderMain(section: Section): ReactElement { + switch (section) { + case Section.History: + return ; + case Section.Dotfiles: + return ; + } +} + +function App() { + // routers don't really work in Tauri. It's not a browser! + // I think hashrouter may work, but I'd rather avoiding thinking of them as + // pages + const [section, setSection] = useState(Section.History); + + const navigation = [ + { + name: "History", + icon: ClockIcon, + section: Section.History, + }, + { + name: "Dotfiles", + icon: WrenchScrewdriverIcon, + section: Section.Dotfiles, + }, + ]; + + return ( +
+
+
+
+ Atuin +
+ +
+
+ + {renderMain(section)} +
+ ); +} + +export default App; -- cgit v1.3.1