From 559423f51bc7e5725d2ceeed5aa085261f1c99a8 Mon Sep 17 00:00:00 2001 From: kitsera Date: Wed, 12 Sep 2018 22:50:29 +0300 Subject: [PATCH 1/9] 1-Implemented basic view for calculator. --- .idea/calculator.iml | 11 ++ .idea/misc.xml | 7 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 + .idea/workspace.xml | 259 +++++++++++++++++++++++++++++++++++++++++++ src/App.js | 112 ++++++++++++++++--- src/index.css | 87 ++++++++++++++- src/index.js | 8 +- 8 files changed, 478 insertions(+), 20 deletions(-) create mode 100644 .idea/calculator.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/calculator.iml b/.idea/calculator.iml new file mode 100644 index 0000000..c3cd732 --- /dev/null +++ b/.idea/calculator.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..3c73ef2 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..6aa3d5c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..f486468 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + DEFINITION_ORDER + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -183,24 +204,20 @@ - - + - - + - - - - - + @@ -208,10 +225,15 @@ - + + + + + + @@ -221,39 +243,41 @@ + + + + + + + - - + + - + - - + + - - + + + + - - - - - - - \ No newline at end of file diff --git a/src/App.js b/src/App.js index 380b579..04880d5 100644 --- a/src/App.js +++ b/src/App.js @@ -1,45 +1,47 @@ import React, { Component } from 'react'; import './App.css'; -class Digit extends React.Component { +class Button extends React.Component { render() { return ( - ); } } -class Clear extends React.Component { - render() { - return ( - - ); - } -} - -class Sqreen extends React.Component { - render() { - return ( - - ); - } -} class Board extends React.Component { + constructor(props){ + super(props); + this.state = { + digits: '', + operation: '', + } + } + handleDigitClick(value){ + let digits = this.state.digits; + digits += value.toString(); + this.setState({digits: digits}); + } + handleClearClick(){ + this.setState({digits: ''}); + } + handleOperationClick(){ + + } renderDigit(i) { - return ; + return