feat: a few settings

This commit is contained in:
TrèsAbhi committed 2024-04-18 19:11:50 -05:00
1 parent 7eda4825ea
commit c656d31618
7 files changed
+82 -23

No files matched your search

-41
View File
@@ -1,41 +0,0 @@
import { blackA } from '@radix-ui/colors';
import { Flex, Spinner, Text } from '@radix-ui/themes';
import { theme } from '../../../stitches.config';
const NAV_HEIGHT = 52.65;
interface LoaderProps {
naked?: boolean;
progress?: number;
}
export function Loader({ naked, progress }: LoaderProps) {
const animation = (
<Flex align="center" gap="2">
<Spinner />
{progress !== undefined && (
<Text color="gray">{Math.round(progress * 100)}%</Text>
)}
</Flex>
);
if (naked) return animation;
return (
<Flex
style={{
backgroundColor: blackA.blackA10,
position: 'fixed',
top: NAV_HEIGHT,
left: 0,
width: '100%',
height: `calc(100% - ${NAV_HEIGHT}px)`,
padding: theme.spaces.paddingMajor,
}}
align="center"
justify="center"
>
{animation}
</Flex>
);
}
+2 -11
View File
@@ -2,10 +2,9 @@
import Link from 'next/link';
import { usePathname } from 'next/navigation';
import { ReactNode, Suspense } from 'react';
import { ReactNode } from 'react';
import { TOOLS } from '../../constants/tools';
import { theme } from '../../stitches.config';
import { Loader } from './components/Loader';
interface ToolsLayoutProps {
children: ReactNode;
@@ -90,15 +89,7 @@ export default function ToolsLayout({ children }: ToolsLayoutProps) {
</div>
)}
<Suspense
fallback={
<div style={{ flex: 1 }}>
<Loader />
</div>
}
>
{children}
</Suspense>
{children}
</>
);
}
@@ -1,5 +1,5 @@
import { Html, useProgress } from '@react-three/drei';
import { Loader } from '../../../../../components/Loader';
import { Loader } from '../../../../../../../components/Loader';
export function ModelLoader() {
const { progress } = useProgress();