remove tricky codes

This commit is contained in:
Ren Amamiya
2023-05-03 16:29:39 +07:00
parent 0721bd52dd
commit 648b0fc4e8
5 changed files with 33 additions and 27 deletions

View File

@@ -2,14 +2,16 @@ import ArrowLeftIcon from '@lume/shared/icons/arrowLeft';
import ArrowRightIcon from '@lume/shared/icons/arrowRight';
import RefreshIcon from '@lume/shared/icons/refresh';
let platformName = 'darwin';
import useSWR from 'swr';
if (typeof window !== 'undefined') {
const fetcher = async () => {
const { platform } = await import('@tauri-apps/api/os');
platformName = await platform();
}
return await platform();
};
export default function AppHeader() {
const { data: platform } = useSWR('platform', fetcher);
const goBack = () => {
window.history.back();
};
@@ -24,7 +26,7 @@ export default function AppHeader() {
return (
<div data-tauri-drag-region className="flex h-full w-full flex-1 items-center px-2">
<div className={`flex h-full items-center gap-2 ${platformName === 'darwin' ? 'pl-[68px]' : ''}`}>
<div className={`flex h-full items-center gap-2 ${platform === 'darwin' ? 'pl-[68px]' : ''}`}>
<button
onClick={() => goBack()}
className="group inline-flex h-6 w-6 items-center justify-center rounded-md hover:bg-zinc-900"