Redesign the frontend with a dark-tech theme: add Tailwind + PostCSS, design tokens, and shadcn-style primitives (Button/Card/Input/Dialog/ DropdownMenu/Tabs/ScrollArea/etc.); restyle the app shell, navigation, sidebar tree, content view, markdown rendering, editors, modals and settings panels. Behavior/props unchanged; Font Awesome replaced with lucide-react. Add the patch cards feature UI: patch-queries hooks and a PatchCards component rendered below the markdown body, with an Add Patch button and create/edit dialog. Fix tree expandability: folders with an index page now expand on name click (and navigate), and the chevron+folder icon is one larger toggle. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
63 lines
1.8 KiB
JavaScript
63 lines
1.8 KiB
JavaScript
import React from "react";
|
|
import ReactDOM from "react-dom/client";
|
|
import App from "./App";
|
|
import AuthProvider, {AuthContext} from "./AuthProvider";
|
|
import "bulma/css/bulma.min.css";
|
|
import "./globals.css";
|
|
import {QueryClient, QueryClientProvider} from "@tanstack/react-query"
|
|
import ConfigProvider from "./ConfigProvider";
|
|
import ControlledReactQueryDevtools from "./components/Debug/ControlledReactQueryDevtools";
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
retry: 2,
|
|
refetchOnWindowFocus: false,
|
|
staleTime: 5 * 60 * 1000,
|
|
onError: (error) => {
|
|
if (error.message === "Unauthorized"){
|
|
const {logout} = queryClient
|
|
.getQueryCache()
|
|
.getAll()
|
|
.find(query => query.queryKey.includes("auth"))?.state?.context || {};
|
|
if (logout) {
|
|
logout();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
mutations: {
|
|
retry: 1,
|
|
}
|
|
}
|
|
});
|
|
|
|
|
|
const EnhancedAuthProvider = ({children}) => {
|
|
const auth = React.useContext(AuthContext);
|
|
const logout = () => {
|
|
auth.logout();
|
|
};
|
|
|
|
React.useEffect(() => {
|
|
queryClient.setQueryDefaults(["auths"], {
|
|
context: {logout}
|
|
});
|
|
}, [logout]);
|
|
return children;
|
|
}
|
|
|
|
const root = ReactDOM.createRoot(document.getElementById("root"));
|
|
root.render(
|
|
<ConfigProvider>
|
|
<QueryClientProvider client={queryClient}>
|
|
<AuthProvider>
|
|
<EnhancedAuthProvider>
|
|
<App />
|
|
<ControlledReactQueryDevtools />
|
|
</EnhancedAuthProvider>
|
|
</AuthProvider>
|
|
</QueryClientProvider>
|
|
</ConfigProvider>
|
|
);
|