File tree Expand file tree Collapse file tree 6 files changed +10
-18
lines changed Expand file tree Collapse file tree 6 files changed +10
-18
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import logo from './logo.svg' ;
32import './App.css' ;
4- import { Card , DatePicker } from 'antd' ;
5- import MyButton from './components/MyButton' ;
6- import ProfileCard from './components/ProfileCard' ;
7- import TicTacToe from './components/TicTacToe' ;
83import Board from './components/TicTacToe/Board' ;
94
105function App ( ) {
11- const [ count , setCount ] = React . useState ( 0 ) ;
6+ // const [count, setCount] = React.useState(0);
127
13- function handleClick ( ) {
14- setCount ( count + 1 ) ;
15- console . log ( `Button clicked ${ count } times` ) ;
16- }
8+ // function handleClick(){
9+ // setCount(count+1);
10+ // console.log(`Button clicked ${count} times`);
11+ // }
1712 return (
1813 < div className = "App" >
1914 { /* <h1>Welcome to my App!</h1>
Original file line number Diff line number Diff line change 11import { Button } from 'antd' ;
2- import { MouseEventHandler , useState } from 'react' ;
2+ import { MouseEventHandler } from 'react' ;
33
44// function handleClick(count: number, setCount: Function){
55// alert("Button Clicked");
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default function ProfileCard() {
2424 let title : JSX . Element | null ;
2525 let image : JSX . Element | null ;
2626 let productsList : JSX . Element [ ] = products . map ( ( product ) => < li key = { product . id } style = { { color : product . isFruit ? 'red' : 'green' } } > { product . title } </ li > ) ;
27- if ( user . name . length != 0 ) {
27+ if ( user . name . length !== 0 ) {
2828 title = < h1 > { user . name } </ h1 > ;
2929 image = < img
3030 className = "avatar"
@@ -35,7 +35,7 @@ export default function ProfileCard() {
3535 }
3636 else {
3737 title = < h1 > John Doe</ h1 > ;
38- image = < img src = "https://www.shutterstock.com/shutterstock/photos/2061533240/display_1500/stock-photo-mountain-view-california-oct" /> ;
38+ image = < img src = "https://www.shutterstock.com/shutterstock/photos/2061533240/display_1500/stock-photo-mountain-view-california-oct" alt = "Profile" /> ;
3939 }
4040 return (
4141 < div >
Original file line number Diff line number Diff line change 11import { useState } from "react" ;
22import Square from "../Square" ;
3- import { nextTick } from "process" ;
43
54export default function Board ( ) {
65 const [ squares , setSquares ] = useState < Array < String | null > > ( Array ( 9 ) . fill ( null ) ) ;
@@ -22,7 +21,7 @@ export default function Board(){
2221 console . log ( "called" ) ;
2322 const [ a , b , c ] = lines [ i ] ;
2423
25- if ( squares [ a ] && squares [ a ] == squares [ b ] && squares [ a ] == squares [ c ] ) {
24+ if ( squares [ a ] && squares [ a ] === squares [ b ] && squares [ a ] = == squares [ c ] ) {
2625 return squares [ a ] ;
2726 }
2827
Original file line number Diff line number Diff line change 11import { Button } from 'antd' ;
2- import { MouseEventHandler , useState } from 'react' ;
2+ import { MouseEventHandler } from 'react' ;
33
44export default function Square ( { value, OnSquareClicked} : { value : String | null , OnSquareClicked : MouseEventHandler < HTMLButtonElement > } ) {
55
Original file line number Diff line number Diff line change 1- import Square from "./Square" ;
2-
31export default function TicTacToe ( ) {
42 return (
53 < >
You can’t perform that action at this time.
0 commit comments