Skip to content

Commit

Permalink
♻️ refactor: refactor layout and styles
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Jun 25, 2023
1 parent b9046f1 commit 438cd1f
Show file tree
Hide file tree
Showing 48 changed files with 2,923 additions and 1,592 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_CONTEXT=DEV
VITE_CONTEXT=DEV
1,351 changes: 1,066 additions & 285 deletions javascript/main.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Index from '@/pages';
import formatPrompt from '@/script/formatPrompt';
import promptBracketChecker from '@/script/promptBracketChecker';
import setupHead from '@/script/setupHead';
import Loading from '@/slots/Loading';
import { useAppStore } from '@/store';

const App = memo(() => {
Expand All @@ -23,7 +24,7 @@ const App = memo(() => {
});
}, []);

return <Layout>{!loading && <Index />}</Layout>;
return <Layout>{loading ? <Loading /> : <Index />}</Layout>;
});

export default App;
7 changes: 5 additions & 2 deletions src/pages/Header/Logo.tsx → src/components/Logo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { type CSSProperties, memo } from 'react';

import { ImgProps } from '@/types/index';

import { darkLogo, lightLogo } from './style';

interface LogoProps {
export interface LogoProps extends ImgProps {
size?: number;
style?: CSSProperties;
themeMode: 'dark' | 'light';
}

const Logo = memo<LogoProps>(({ size = 20, style, themeMode }) => {
const Logo = memo<LogoProps>(({ size = 20, style, themeMode, ...props }) => {
return (
<img
alt="logo"
src={themeMode === 'dark' ? darkLogo : lightLogo}
style={{ height: size, ...style }}
{...props}
/>
);
});
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as Logo, type LogoProps } from './Logo';
298 changes: 0 additions & 298 deletions src/layouts/GlobalStyle.ts

This file was deleted.

Loading

0 comments on commit 438cd1f

Please sign in to comment.