Skip to content

Commit

Permalink
fix: enable numpad numbers and change color of highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
TN1ck committed Jul 25, 2024
1 parent c724396 commit 2f64f48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/pages/Game/Sudoku/Sudoku.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export const GridCellNumber = ({
}}
className={clsx("pointer-events-none absolute z-20 -translate-x-1/2 -translate-y-1/2 text-lg font-bold", {
"text-black": initial,
"text-teal-500": highlight && !conflict && !conflict,
"text-amber-600": highlight && !conflict && !conflict,
"text-teal-600": !initial && !highlight && !conflict,
"text-red-600": conflict && !initial,
})}
Expand Down
5 changes: 3 additions & 2 deletions src/components/pages/Game/shortcuts/GridShortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ class GameKeyboardShortcuts extends React.Component<
});

SUDOKU_NUMBERS.forEach((n) => {
hotkeys(String(n), ShortcutScope.Game, () => {
const keys = [String(n), `num_${n}`].join(",");
hotkeys(keys, ShortcutScope.Game, () => {
if (!this.props.activeCell.initial) {
if (this.props.notesMode) {
const conflicting = SudokuGame.conflictingFields(this.props.sudoku);
Expand All @@ -129,7 +130,7 @@ class GameKeyboardShortcuts extends React.Component<
});
});

hotkeys("backspace", ShortcutScope.Game, () => {
hotkeys("backspace,num_subtract", ShortcutScope.Game, () => {
if (!this.props.activeCell.initial) {
this.props.clearNumber(this.props.activeCell);
}
Expand Down

0 comments on commit 2f64f48

Please sign in to comment.