Skip to content

Commit c39a0a5

Browse files
RobbyTiptonfscgoldenjoeeparkdavidkim7773khobread
committed
Removed unnecessary content from files.
Co-authored-by: Chris LeBrett <[email protected]> Co-authored-by: Robby Tipton <[email protected]> Co-authored-by: Joseph Park <[email protected]> Co-authored-by: David Kim <[email protected]> Co-authored-by: Kevin HoEun Lee <[email protected]>
1 parent c00a015 commit c39a0a5

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

demo-app/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
"start": "webpack-dev-server",
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
10-
"repository": {
11-
"type": "git",
12-
"url": "git+https://github.com/CodesmithLLC/typescript-module.git"
13-
},
14-
"author": "Allison Pratt ([email protected])",
15-
"license": "ISC",
16-
"bugs": {
17-
"url": "https://github.com/CodesmithLLC/typescript-module/issues"
18-
},
19-
"homepage": "https://github.com/CodesmithLLC/typescript-module#readme",
2010
"devDependencies": {
2111
"@babel/core": "^7.16.7",
2212
"@babel/preset-env": "^7.16.7",

demo-app/src/client/Components/Board.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,10 @@ class Board extends Component<{}, BoardState> {
2121
scoreboard: { X: 0, O: 0 },
2222
};
2323

24-
// these methods need to be bound to the context of `this` since
25-
// these will be passed into event handlers and called from outside the object
26-
// where the context of `this` would be otherwise different
2724
this.resetBoard = this.resetBoard.bind(this);
2825
this.handleBoxClick = this.handleBoxClick.bind(this);
2926
}
3027

31-
componentDidMount() {
32-
this.getScores();
33-
}
34-
3528
componentDidUpdate() {
3629
this.checkForWinner();
3730
}
@@ -70,7 +63,6 @@ class Board extends Component<{}, BoardState> {
7063
checkForWinner(): void {
7164
const { board, gameOver, currentPlayer } = this.state;
7265

73-
// helper function to check if board is filled
7466
const spacesLeft = (): boolean => {
7567
for (let i of board) {
7668
if (i.includes('-')) return true;
@@ -114,8 +106,6 @@ class Board extends Component<{}, BoardState> {
114106
message: `Player ${winner} wins!`,
115107
});
116108

117-
this.getScores('POST', JSON.stringify({ winner }));
118-
119109
// draw condition: no '-' remaining in board without above win condition triggering
120110
} else if (!spacesLeft()) {
121111
this.setState({
@@ -126,11 +116,6 @@ class Board extends Component<{}, BoardState> {
126116
}
127117
}
128118

129-
getScores(method?: string, winner?: string) {
130-
// If method is GET, send a GET request to api route to get scores.
131-
// If method is POST, send a POST request to api route to post the scores.
132-
}
133-
134119
handleBoxClick(row: number, column: number): void {
135120
const boardCopy: BoardContent = [
136121
[...this.state.board[0]],
@@ -143,7 +128,6 @@ class Board extends Component<{}, BoardState> {
143128
}
144129

145130
render() {
146-
// insert logic to render rows here
147131
const rows: Array<JSX.Element> = [];
148132
for (let i = 0; i < 3; i++) {
149133
rows.push(
@@ -155,7 +139,6 @@ class Board extends Component<{}, BoardState> {
155139
/>
156140
);
157141
}
158-
// Destructure scores for X and O from state so that they can individually be rendered below
159142
const { X, O }: Scoreboard = this.state.scoreboard;
160143

161144
return (

demo-app/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
export type Scoreboard = {
32
X: number,
43
O: number

0 commit comments

Comments
 (0)