add type hints

This commit is contained in:
Artur Tamborski 2020-11-15 09:05:32 +01:00
parent 5b3a051229
commit 6bf0c531ba
6 changed files with 18 additions and 29 deletions

View File

@ -1,21 +1,11 @@
{ {
"short_name": "React App", "short_name": "crosski",
"name": "Create React App Sample", "name": "Play crosski online!",
"icons": [ "icons": [
{ {
"src": "favicon.ico", "src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16", "sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon" "type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
} }
], ],
"start_url": ".", "start_url": ".",

View File

@ -5,7 +5,7 @@ import Board from '../Board/Board';
import './App.css'; import './App.css';
function App() { export default function App(): JSX.Element {
return ( return (
<div className="App"> <div className="App">
<Logo /> <Logo />
@ -13,5 +13,3 @@ function App() {
</div> </div>
); );
} }
export default App;

View File

@ -13,8 +13,8 @@
font-size: larger; font-size: larger;
padding: 20px; padding: 20px;
background: ghostwhite; background: ghostwhite;
border-radius: 25px; border-radius: 1rem;
border-color: #E5E5EA; border-color: #e5e5ea;
color: brown; color: brown;
cursor: pointer; cursor: pointer;
} }

View File

@ -1,8 +1,13 @@
import React, { Component } from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import './Board.css'; import './Board.css';
class Board extends Component { export default class Board extends React.Component {
static propTypes = {
clickHandler: PropTypes.func,
};
genSquares() { genSquares() {
let squares = []; let squares = [];
@ -22,12 +27,12 @@ class Board extends Component {
return squares; return squares;
} }
onMouseDown() { onMouseMove() {
console.log("down") return 1;
} }
onMouseMove() { onMouseDown() {
console.log("move") return 1;
} }
render() { render() {
@ -42,5 +47,3 @@ class Board extends Component {
); );
} }
} }
export default Board;

View File

@ -3,12 +3,10 @@ import React from 'react';
import Wide from './crosski_wide.svg' import Wide from './crosski_wide.svg'
import './Logo.css'; import './Logo.css';
function Logo() { export default function Logo(): JSX.Element {
return ( return (
<div className="Logo"> <div className="Logo">
<img alt="Logo" src={Wide} className="Logo-wide"/> <img alt="Logo" src={Wide} className="Logo-wide"/>
</div> </div>
); );
} }
export default Logo;

View File

@ -12,7 +12,6 @@
"allowSyntheticDefaultImports": true, "allowSyntheticDefaultImports": true,
"strict": true, "strict": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "node",
"resolveJsonModule": true, "resolveJsonModule": true,
@ -23,6 +22,7 @@
"declaration": true, "declaration": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"incremental": true "incremental": true
}, },
"include": [ "include": [