mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-21 06:59:17 -04:00
* begin better onboarding * added input and altered text * better router & text + database icon Co-authored-by: maxichrome <maxichrome@users.noreply.github.com> * work on privacy screen + radio buttons * fix video extension bug and alter screens * add pending schema and location manager helper * functional onboarding * added secure temp store and started creating library loading screen * fix secure temp keystore + api * better onboarding * added location settings and some overview concept, all WIP * fix switch * prep * fix location router * added backend settings * attempted to fix form * begin indexer rules editor, plus tweaks * indexer rules coming soon * fix onboarding img size * cleanup * clone is needed here, but clippy no like * sike * whole bunch of fixes * clippy + ts * Removing some TODOs from api/libraries.rs and fixing db size calculation * moved object kind to client, added half functionality for appearance settings * fix RadioGroup helper * fix type issues * cargo fmt * fix creating library error handling + invalidate location list on update * forgot to switch back to onError * Invalidating getStatistics query on library creation and introducing the concept of waiting for a job on FileCopierJob * F* cargo fmt * fix RadioGroup interactivity * wipe all migrations * put back COLLATE NOCASE on extension columns * update core.ts * remove unused device component * fix typeerror in mobile --------- Co-authored-by: maxichrome <maxichrome@users.noreply.github.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com> Co-authored-by: Ericson Soares <ericson.ds999@gmail.com> Co-authored-by: Utku Bakir <74243531+utkubakir@users.noreply.github.com>
76 lines
2.4 KiB
TypeScript
76 lines
2.4 KiB
TypeScript
import {
|
|
Dedupe as DedupeIntegration,
|
|
HttpContext as HttpContextIntegration,
|
|
init
|
|
} from '@sentry/browser';
|
|
import '@fontsource/inter/variable.css';
|
|
import { QueryClientProvider, defaultContext } from '@tanstack/react-query';
|
|
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
|
|
import dayjs from 'dayjs';
|
|
import advancedFormat from 'dayjs/plugin/advancedFormat';
|
|
import duration from 'dayjs/plugin/duration';
|
|
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
import { MemoryRouter, useLocation, useNavigate } from 'react-router-dom';
|
|
import { LibraryContextProvider, queryClient, useDebugState } from '@sd/client';
|
|
import { Dialogs } from '@sd/ui';
|
|
import { AppRouter } from './AppRouter';
|
|
import { ErrorFallback } from './ErrorFallback';
|
|
import './style.scss';
|
|
|
|
dayjs.extend(advancedFormat);
|
|
dayjs.extend(relativeTime);
|
|
dayjs.extend(duration);
|
|
|
|
init({
|
|
dsn: 'https://2fb2450aabb9401b92f379b111402dbc@o1261130.ingest.sentry.io/4504053670412288',
|
|
environment: import.meta.env.MODE,
|
|
defaultIntegrations: false,
|
|
integrations: [new HttpContextIntegration(), new DedupeIntegration()]
|
|
});
|
|
|
|
export default function SpacedriveInterface() {
|
|
return (
|
|
<ErrorBoundary FallbackComponent={ErrorFallback}>
|
|
<QueryClientProvider client={queryClient} contextSharing={true}>
|
|
<Devtools />
|
|
<MemoryRouter>
|
|
<AppRouterWrapper />
|
|
</MemoryRouter>
|
|
</QueryClientProvider>
|
|
</ErrorBoundary>
|
|
);
|
|
}
|
|
|
|
function Devtools() {
|
|
const debugState = useDebugState();
|
|
|
|
// The `context={defaultContext}` part is required for this to work on Windows. Why, idk, don't question it
|
|
return debugState.reactQueryDevtools !== 'disabled' ? (
|
|
<ReactQueryDevtools
|
|
position="bottom-right"
|
|
context={defaultContext}
|
|
toggleButtonProps={{
|
|
className: debugState.reactQueryDevtools === 'invisible' ? 'opacity-0' : ''
|
|
}}
|
|
/>
|
|
) : null;
|
|
}
|
|
|
|
// This can't go in `<SpacedriveInterface />` cause it needs the router context but it can't go in `<AppRouter />` because that requires this context
|
|
function AppRouterWrapper() {
|
|
const navigate = useNavigate();
|
|
const { pathname } = useLocation();
|
|
return (
|
|
<LibraryContextProvider
|
|
onNoLibrary={() => {
|
|
// only redirect to onboarding flow if path doesn't already include onboarding
|
|
if (!pathname.includes('onboarding')) navigate('/onboarding');
|
|
}}
|
|
>
|
|
<AppRouter />
|
|
<Dialogs />
|
|
</LibraryContextProvider>
|
|
);
|
|
}
|