Skip to content

Commit

Permalink
support next tetromino preview
Browse files Browse the repository at this point in the history
  • Loading branch information
huoyijie committed Nov 7, 2023
1 parent 834e9a4 commit c3d8445
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Info.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Tetromino from './Tetromino';
import { useContext } from 'react';
import Context from './Context';
import { I } from '@/lib/TetrominoType';

export default function () {
const { gameOver, nextTetromino } = useContext(Context)
Expand All @@ -20,7 +21,7 @@ export default function () {
{nextTetromino && (
<div className='flex gap-6 justify-between items-center'>
<div>下一个</div>
<div className='relative'><Tetromino {...nextTetromino} x={-1} y={-1} /></div>
<div className='relative'><Tetromino {...nextTetromino} x={-1} y={nextTetromino.type == I ? 0 : -1} /></div>
</div>
)}
</div>
Expand Down

0 comments on commit c3d8445

Please sign in to comment.