Skip to content

Commit

Permalink
remove login/register
Browse files Browse the repository at this point in the history
  • Loading branch information
its-felix committed Oct 21, 2024
1 parent ab82b67 commit 60bb524
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 5 additions & 7 deletions ui/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@ import {
import React, { useMemo, useState } from 'react';
import { PreferencesModal } from '../preferences/preferences';
import classes from './header.module.scss';
import { useAuthInfo } from '../util/context/auth-info';
import { catchNotify, useAppControls } from '../util/context/app-controls';
import { useHttpClient } from '../util/context/http-client';
import { expectSuccess } from '../../lib/api/api';
import { useSearch } from '../util/state/data';
import { useDebounce } from '../util/state/use-debounce';
import { useNavigate } from 'react-router-dom';

export default function FlightsHeader() {
const { apiClient } = useHttpClient();
const { notification } = useAppControls();

const [showPreferences, setShowPreferences] = useState(false);

/*
const [authInfo, setAuthInfo] = useAuthInfo();
function logout() {
Expand All @@ -35,6 +30,7 @@ export default function FlightsHeader() {
})()
.catch(catchNotify(notification));
}
*/

const utilities: TopNavigationProps.Utility[] = [
{
Expand All @@ -52,6 +48,7 @@ export default function FlightsHeader() {
},
];

/*
if (authInfo === undefined) {
utilities.push({
type: 'button',
Expand Down Expand Up @@ -85,6 +82,7 @@ export default function FlightsHeader() {
onClick: logout,
});
}
*/

return (
<>
Expand Down
6 changes: 3 additions & 3 deletions ui/src/components/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { SideNav } from './sidenav/sidenav';
import { AppControlsProvider } from './util/context/app-controls';
import { AuthInfoProvider, useAuthInfo } from './util/context/auth-info';
import { BrowserStoreProvider } from './util/context/browser-store';
import { HttpClientProvider, useHttpClient } from './util/context/http-client';
import { HttpClientProvider } from './util/context/http-client';
import { useMobile } from './util/state/common';
import { useHasConsent } from './util/state/use-consent';
import { usePreferences } from './util/state/use-preferences';
Expand Down Expand Up @@ -151,7 +151,6 @@ export function BaseProviders({ children }: React.PropsWithChildren) {
function InternalBaseProviders({ children }: React.PropsWithChildren) {
const queryClient = new QueryClient();

const { apiClient } = useHttpClient();
const [preferences] = usePreferences();
const [authInfo, setAuthInfo] = useState<AuthInfo | null | undefined>(undefined);
const [tools, setTools] = useState<React.ReactNode>();
Expand All @@ -172,6 +171,7 @@ function InternalBaseProviders({ children }: React.PropsWithChildren) {
applyDensity(preferences.uiDensity === UIDensity.COMFORTABLE ? Density.Comfortable : Density.Compact, document.documentElement);
}, [preferences]);

/*
useEffect(() => {
(async () => {
const resp = await apiClient.getAuthInfo();
Expand All @@ -182,7 +182,7 @@ function InternalBaseProviders({ children }: React.PropsWithChildren) {
}
})().catch(() => setAuthInfo(null));
}, [apiClient]);

*/

const appControlsState = useMemo<AppControlsState>(() => ({
tools: {
Expand Down

0 comments on commit 60bb524

Please sign in to comment.