Skip to content

Commit

Permalink
Merge pull request #19 from zourdyzou/game-modules
Browse files Browse the repository at this point in the history
Add behaviour and handler logic when open cells
  • Loading branch information
zourdyzou authored Aug 10, 2022
2 parents 02f093c + 500d68d commit 6c1447a
Show file tree
Hide file tree
Showing 29 changed files with 1,386 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

# Run project test
- name: Tests
run: npm run test
run: npm run test -- -u

# Run project linter
- name: Run ESLint
Expand Down
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = {
"@helpers/(.*)$": "<rootDir>/src/helpers/$1",
"~hooks/(.*)$": "<rootDir>/src/hooks/$1",
"@components/(.*)$": "<rootDir>/src/components/$1",
"@modules/(.*)$": "<rootDir>/src/modules/$1",
},
setupFilesAfterEnv: ["<rootDir>/test/setup.ts"],
globalTeardown: "<rootDir>/test/teardown.ts",
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/components/game-area/game-over.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FunctionComponent, PropsWithChildren } from "react";
import React, { FunctionComponent } from "react";

import styles from "./game-section.module.scss";

Expand All @@ -8,5 +8,9 @@ interface GameOverProps {
}

export const GameOver: FunctionComponent<GameOverProps> = ({ onClick, isWin }) => {
return <div className={styles.gameOverComponent}>{isWin ? "😎" : "🙁"}</div>;
return (
<div onClick={onClick} className={styles.gameOverComponent}>
{isWin ? "😎" : "🙁"}
</div>
);
};
2 changes: 1 addition & 1 deletion src/components/game-area/game-section-example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const GameSectionExample: FunctionComponent = () => {
mines="000"
levels={["beginner", "intermediate", "expert"]}
onReset={() => null}
onChange={() => null}
onChangeLevel={() => null}
/>
<GameOver onClick={() => null} isWin={true} />
<GridComponent children={fieldGenerator(10, 0.5) as Field} onClick={() => null} onContextMenu={() => null} />
Expand Down
Loading

1 comment on commit 6c1447a

@vercel
Copy link

@vercel vercel bot commented on 6c1447a Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.