Skip to content

Commit

Permalink
๐ŸŽจ Chore/cleanup config (#7)
Browse files Browse the repository at this point in the history
* ๐ŸŽจ Tailwind.css ๋ณ„๋„ ๋ถ„๋ฆฌ

* ๐ŸŽจ Use absolute path, named export
  • Loading branch information
thisisWooyeol authored Nov 22, 2024
1 parent 46f5a61 commit 9b7c483
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
10 changes: 0 additions & 10 deletions src/App.css

This file was deleted.

25 changes: 12 additions & 13 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import './App.css';
import './reset.css';
import './tailwind.css';

import { useCallback, useEffect, useState } from 'react';

import { GameBoard } from './components/GameBoard';
import { GameInstructions } from './components/GameInstructions';
import { GameStatusOverlay } from './components/GameStatusOverlay';
import { Header } from './components/Header';
import { useKeyPress } from './hooks/useKeyPress';
import { loadGameState, saveGameState } from './utils/localStorage';
import { GameBoard } from '@/components/GameBoard';
import { GameInstructions } from '@/components/GameInstructions';
import { GameStatusOverlay } from '@/components/GameStatusOverlay';
import { Header } from '@/components/Header';
import { useKeyPress } from '@/hooks/useKeyPress';
import { loadGameState, saveGameState } from '@/utils/localStorage';
import {
addRandomBlock,
getCellColor,
Expand All @@ -17,9 +18,9 @@ import {
moveMapIn2048Rule,
resetMap,
stringDirectionMap,
} from './utils/Map2048';
} from '@/utils/Map2048';

function App() {
export const App = () => {
const rowLength: number = 4;
const columnLength: number = 4;

Expand Down Expand Up @@ -90,7 +91,7 @@ function App() {
useKeyPress(keyPressHandler);

return (
<div className="flex items-center justify-center min-h-screen">
<div className="flex items-center justify-center h-dvh max-w-7xl p-8">
<div className="grid grid-flow-row gap-5 max-w-lg w-full">
<Header score={score} bestScore={bestScore} />
<GameInstructions newGameButton={newGameButton('New Game')} />
Expand All @@ -114,6 +115,4 @@ function App() {
</div>
</div>
);
}

export default App;
};
4 changes: 1 addition & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import './reset.css';

import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/react';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import App from './App.tsx';
import { App } from '@/App';

const root = document.getElementById('root');

Expand Down
3 changes: 3 additions & 0 deletions src/tailwind.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"verbatimModuleSyntax": true
"verbatimModuleSyntax": true,
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src", "vite.config.ts"]
}
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import { defineConfig } from 'vite';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: { alias: { '@': '/src' } },
});

0 comments on commit 9b7c483

Please sign in to comment.