From 0f5050ac5ea9ea3cdf0c0e960d5672e0a91d7c1c Mon Sep 17 00:00:00 2001 From: Redrock912 Date: Thu, 31 Oct 2019 19:37:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B9=98=ED=82=A8=20=EA=B0=80=EA=B2=A9=20,=20?= =?UTF-8?q?=EA=B5=AD=EB=B0=A5=EA=B0=80=EA=B2=A9=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=20=ED=91=9C=EC=8B=9C,=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EC=9D=80=20=ED=95=84=EC=9A=94=EA=B0=80=20?= =?UTF-8?q?=EC=97=86=EC=96=B4=EC=A0=B8=EC=84=9C=20=EB=A6=AC=EC=85=8B?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=EC=9C=BC=EB=A1=9C=20=EB=B0=94=EA=BF=A8?= =?UTF-8?q?=EC=8A=B5=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.css | 10 ++++--- src/components/Description.jsx | 26 +++++++++++++----- src/components/PriceForm.jsx | 49 +++++++++++++++++----------------- src/jsconfig.json | 5 ++++ 4 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 src/jsconfig.json diff --git a/src/App.css b/src/App.css index 43a0dd4..3866309 100644 --- a/src/App.css +++ b/src/App.css @@ -9,15 +9,19 @@ body { text-align: center; margin: 0; padding: 0; - + font-weight: normal; margin-top: 20em; background-image: url("http://www.powerkoream.co.kr/news/photo/201412/1102039_1308_2456.jpg"); background-repeat: no-repeat; background-size: 100%; } -h2 { +h2, +h3 { + font-size: 30px; font-weight: normal; + color: rgb(187, 187, 255); + -webkit-text-stroke: 1px black; } .vignette { @@ -50,7 +54,7 @@ label { input[type="text"] { width: 20%; - font-size: 50px; + font-size: 40px; color: white; border: 1px solid #ccc; box-sizing: border-box; diff --git a/src/components/Description.jsx b/src/components/Description.jsx index 7abb3d7..5764bcd 100644 --- a/src/components/Description.jsx +++ b/src/components/Description.jsx @@ -1,7 +1,7 @@ -import React, {Component} from "react"; -import {inject, observer} from "mobx-react"; +import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; -@inject('userInput') +@inject("userInput") @observer class Description extends Component { constructor(props) { @@ -10,9 +10,23 @@ class Description extends Component { } render() { - const {userInput} = this.props; - return (

당신의 돈 국밥으로 환산해보셨습니까?

-

당신이 알고싶은 국밥가 : {userInput.price}

); + const { userInput } = this.props; + let gookbab = userInput.price / 5000; + let chicken = userInput.price / 16000; + return ( +
+

당신의 돈 국밥으로 환산해보셨습니까?

+

당신이 알고싶은 국밥가 : {gookbab}

+

+ 고것은{" "} + + {" "} + {chicken}{" "} + {" "} + 치킨이구연{" "} +

+
+ ); } } diff --git a/src/components/PriceForm.jsx b/src/components/PriceForm.jsx index cc3af2d..907b121 100644 --- a/src/components/PriceForm.jsx +++ b/src/components/PriceForm.jsx @@ -1,8 +1,8 @@ -import {userInput} from "../store"; -import {inject, observer} from "mobx-react/dist/mobx-react"; -import React, {Component} from "react"; +import { userInput } from "../store"; +import { inject, observer } from "mobx-react/dist/mobx-react"; +import React, { Component } from "react"; -@inject('userInput') +@inject("userInput") @observer class PriceForm extends Component { constructor(props) { @@ -13,36 +13,35 @@ class PriceForm extends Component { } handleChange(event) { - const {userInput} = this.props; + const { userInput } = this.props; userInput.setPrice(event.target.value); } handleSubmit(event) { - const {userInput} = this.props; - let gookbabCount = parseInt(userInput.price, 10); - - const converted = gookbabCount / 5000; - alert("고것은 " + converted + " 국밥이네요."); + const { userInput } = this.props; + userInput.price = ""; event.preventDefault(); } render() { - const {userInput} = this.props; - return (
-
- - -
-
) + const { userInput } = this.props; + return ( +
+
+ + +
+
+ ); } } -export default PriceForm; \ No newline at end of file +export default PriceForm; diff --git a/src/jsconfig.json b/src/jsconfig.json new file mode 100644 index 0000000..504cd64 --- /dev/null +++ b/src/jsconfig.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "experimentalDecorators": true + } +}