forked from OctoWoW/OctoLauncher
5dca94a3fc
Manifest-based CDN updater and mod manager for the OctoWoW 1.12.1 client: launcher-owned realmlist, torrent-backed content sync with bundled aria2c, antivirus and Defender exclusion handling, hardware-aware render distance, optional client tweaks and mods, and the in-launcher news feed.
54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
import { useState } from 'react';
|
|
|
|
import { api } from './utils/api';
|
|
import PageBackground from './assets/background.png';
|
|
import AntivirusModal from './components/AntivirusModal';
|
|
import Header from './components/Header';
|
|
import LaunchPanel from './components/LaunchPanel';
|
|
import SelfUpdateBanner from './components/SelfUpdateBanner';
|
|
import TabsPanel, { type TabType } from './components/TabsPanel';
|
|
import TopBar from './components/TopBar';
|
|
import IconSpinner from './components/styled/IconSpinner';
|
|
import usePreventDefaultEvents from './utils/usePreventDefaultEvents';
|
|
|
|
const App = () => {
|
|
const { isLoading } = api.preferences.get.useQuery();
|
|
const { data: appVersion } = api.general.appVersion.useQuery();
|
|
|
|
const [activeTab, setActiveTab] = useState<TabType>();
|
|
|
|
usePreventDefaultEvents();
|
|
|
|
return (
|
|
<div
|
|
className="relative flex grow flex-col gap-3 overflow-hidden bg-cover bg-top bg-no-repeat p-[44px]"
|
|
style={{ backgroundImage: `url(${PageBackground})` }}
|
|
>
|
|
<TopBar />
|
|
<SelfUpdateBanner />
|
|
<Header {...{ activeTab, setActiveTab }} />
|
|
|
|
{isLoading ? (
|
|
<div className="flex flex-grow items-center justify-center">
|
|
<IconSpinner />
|
|
</div>
|
|
) : (
|
|
<>
|
|
<TabsPanel activeTab={activeTab} />
|
|
<LaunchPanel />
|
|
</>
|
|
)}
|
|
|
|
{appVersion && (
|
|
<span className="pointer-events-none absolute bottom-2 right-3 select-none font-mono text-[10px] uppercase tracking-wider text-white/40">
|
|
v{appVersion}
|
|
</span>
|
|
)}
|
|
|
|
<AntivirusModal />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default App;
|