Skip to content

Commit

Permalink
11/01
Browse files Browse the repository at this point in the history
  • Loading branch information
djan2003 committed Jan 11, 2021
1 parent f97bdd2 commit 4487ab2
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"C:\\it\\exam01\\my-app\\src\\App.tsx":"1","C:\\it\\exam01\\my-app\\src\\components\\display\\display.tsx":"2","C:\\it\\exam01\\my-app\\src\\components\\button\\button.tsx":"3","C:\\it\\exam01\\my-app\\src\\components\\button\\Button.tsx":"4","C:\\it\\exam01\\my-app\\src\\components\\button2\\button2.tsx":"5","C:\\it\\counter-1-exam\\src\\index.tsx":"6","C:\\it\\counter-1-exam\\src\\components\\display\\display.tsx":"7","C:\\it\\counter-1-exam\\src\\App.tsx":"8","C:\\it\\counter-1-exam\\src\\components\\button\\Button.tsx":"9","C:\\it\\counter-1-exam\\src\\components\\button2\\button2.tsx":"10"},{"size":575,"mtime":1609606851120,"results":"11","hashOfConfig":"12"},{"size":496,"mtime":1609608347151,"results":"13","hashOfConfig":"12"},{"size":0,"mtime":1609603508379,"results":"14","hashOfConfig":"12"},{"size":513,"mtime":1609606319534,"results":"15","hashOfConfig":"12"},{"size":489,"mtime":1609606796761,"results":"16","hashOfConfig":"12"},{"size":500,"mtime":1607449531791,"results":"17","hashOfConfig":"18"},{"size":496,"mtime":1609944020532,"results":"19","hashOfConfig":"18"},{"size":1453,"mtime":1609944076413,"results":"20","hashOfConfig":"18"},{"size":574,"mtime":1609941200153,"results":"21","hashOfConfig":"18"},{"size":550,"mtime":1609941445004,"results":"22","hashOfConfig":"18"},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1lv5dv7",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"88izi9",{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\it\\exam01\\my-app\\src\\App.tsx",[],"C:\\it\\exam01\\my-app\\src\\components\\display\\display.tsx",[],"C:\\it\\exam01\\my-app\\src\\components\\button\\button.tsx",[],"C:\\it\\exam01\\my-app\\src\\components\\button\\Button.tsx",[],"C:\\it\\exam01\\my-app\\src\\components\\button2\\button2.tsx",[],"C:\\it\\counter-1-exam\\src\\index.tsx",[],"C:\\it\\counter-1-exam\\src\\components\\display\\display.tsx",[],"C:\\it\\counter-1-exam\\src\\App.tsx",[],"C:\\it\\counter-1-exam\\src\\components\\button\\Button.tsx",[],"C:\\it\\counter-1-exam\\src\\components\\button2\\button2.tsx",[]]
[{"C:\\it\\counter-1-exam\\src\\components\\button\\Button.tsx":"1","C:\\it\\counter-1-exam\\src\\App.tsx":"2","C:\\it\\counter-1-exam\\src\\index.tsx":"3","C:\\it\\counter-1-exam\\src\\components\\display\\display.tsx":"4","C:\\it\\counter-1-exam\\src\\Display2\\Display2.tsx":"5"},{"size":455,"mtime":1610121100264,"results":"6","hashOfConfig":"7"},{"size":2084,"mtime":1610122327560,"results":"8","hashOfConfig":"7"},{"size":500,"mtime":1607449531791,"results":"9","hashOfConfig":"7"},{"size":498,"mtime":1610123075055,"results":"10","hashOfConfig":"7"},{"size":252,"mtime":1610122883894,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"88izi9",{"filePath":"14","messages":"15","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\it\\counter-1-exam\\src\\components\\button\\Button.tsx",[],"C:\\it\\counter-1-exam\\src\\App.tsx",["22","23"],"C:\\it\\counter-1-exam\\src\\index.tsx",[],"C:\\it\\counter-1-exam\\src\\components\\display\\display.tsx",[],"C:\\it\\counter-1-exam\\src\\Display2\\Display2.tsx",[],{"ruleId":"24","severity":1,"message":"25","line":8,"column":9,"nodeType":"26","messageId":"27","endLine":8,"endColumn":24},{"ruleId":"24","severity":1,"message":"28","line":9,"column":9,"nodeType":"26","messageId":"27","endLine":9,"endColumn":24},"@typescript-eslint/no-unused-vars","'titleForButton1' is assigned a value but never used.","Identifier","unusedVar","'titleForButton2' is assigned a value but never used."]
57 changes: 39 additions & 18 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,31 @@ import React, {useState} from 'react';
import './App.css';
import Display from "./components/display/display";
import Button1 from "./components/button/Button";
import Button2 from "./components/button2/button2";
import Display2 from "./Display2/Display2";

function App() {

let titleForButton1 = "plus one"
let titleForButton2 = "reset"
let checkButton1 = () => {
let check = count;
if (check < 5) {
return false
}
if (check >= 5) {
return true
}
return false
}
let checkButton2 = () => {
let check2 = count;
if (check2 > 0) {
return false
}
if (check2 < 1) {
return true
}
}
const [count, setCount] = useState(0)

function plus() {
Expand All @@ -24,27 +46,26 @@ function App() {
<Display count={count}/>
<div className="forButton">
<Button1
plus={plus}
count={count}
titleForButton="plus one"
callBackForOnClick={plus}
forDisabled={checkButton1}
/></div>
<div className="forButton">
<Button2
reset={reset}
count={count}
/></div>
<Button1
titleForButton="reset"
callBackForOnClick={reset}
forDisabled={checkButton2}
/>
</div>
</div>
<div className="block2">
<Display count={count}/>
<div className="forButton">
<Button1
plus={plus}
count={count}
/></div>
<div className="forButton">
<Button2
reset={reset}
count={count}
/></div>
<Display2/>
<div className="forButton">
<Button1
titleForButton="plus one"
callBackForOnClick={plus}
forDisabled={checkButton1}
/></div>
</div>
</div>
</div>
Expand Down
15 changes: 15 additions & 0 deletions src/Display2/Display2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from "react";
import s from "./display2.module.css"


const Display2=()=> {

return (
<div className={s.display}>
<textarea/>
<textarea/>
</div>
);
}

export default Display2;
5 changes: 5 additions & 0 deletions src/Display2/display2.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.display{
height: 200px;
width: 200px;
background-color: darkmagenta;
}
27 changes: 10 additions & 17 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
import React from "react";
import s from "./button.module.css"
type PropsTypeB1={
plus:any
count:number
titleForButton:string
callBackForOnClick:any
forDisabled:any

}

function Button1(props:PropsTypeB1) {
function checkButton1() {
let check = props.count;
if (check<5){
return false
}
if(check >=5){
return true
}
return false
return (
<div>
<button className={s.button1} disabled={props.forDisabled()} onClick={props.callBackForOnClick}>{props.titleForButton}</button>
</div>
);
}
return (
<div>
<button className={s.button1} disabled={checkButton1()} onClick={props.plus}>Добавить 1</button>
</div>
);
}


export default Button1;
13 changes: 2 additions & 11 deletions src/components/button2/button2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@ import s from "./button2.module.css"
type PropsTypeB2={
reset:any
count:number
checkButton2:any
}
function Button2(props:PropsTypeB2) {
function checkButton2() {
let check2 = props.count;
if (check2 > 0){
return false
}
if(check2 <1){
return true
}
}

return (
<div>
<button className={s.button2} disabled={checkButton2()} onClick={props.reset}>Обнулить</button>
<button className={s.button2} disabled={props.checkButton2()} onClick={props.reset}>Обнулить</button>
</div>
);
}
Expand Down
1 change: 0 additions & 1 deletion src/components/button3/button3.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/components/display/display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function Display(props:PropsType) {
return s.display2
}


}
return (
<div className={chancheCount()}>
Expand Down

0 comments on commit 4487ab2

Please sign in to comment.