diff --git a/wax-questions-service/src/NumericalAnswerService/components/ExactAnswerComponent.js b/wax-questions-service/src/NumericalAnswerService/components/ExactAnswerComponent.js index 1fc6c59f6ca99727ccf07b2463f62ece177e679d..070b6156956e6a8ad04fe804545de613414ce072 100644 --- a/wax-questions-service/src/NumericalAnswerService/components/ExactAnswerComponent.js +++ b/wax-questions-service/src/NumericalAnswerService/components/ExactAnswerComponent.js @@ -1,7 +1,7 @@ import React, { useRef, useState } from 'react'; import styled from 'styled-components'; -const ExactAnswerContainer = styled.div` +const AnswerContainer = styled.div` display: flex; flex-direction: row; width: 100%; @@ -41,7 +41,7 @@ const ExactAnswerComponent = () => { }; return ( - <ExactAnswerContainer> + <AnswerContainer> <ValueContainer> <label htmlFor="exactAnswer"> <ValueInnerContainer> @@ -70,7 +70,7 @@ const ExactAnswerComponent = () => { </ValueInnerContainer> </label> </ValueContainer> - </ExactAnswerContainer> + </AnswerContainer> ); }; diff --git a/wax-questions-service/src/NumericalAnswerService/components/PreciseAnswerComponent.js b/wax-questions-service/src/NumericalAnswerService/components/PreciseAnswerComponent.js index 08da4a4c3e2ed7b527ab7af7ddcce044100c9366..2ab9c1a5ff0467e798aac4b760c333fd2bd9c19d 100644 --- a/wax-questions-service/src/NumericalAnswerService/components/PreciseAnswerComponent.js +++ b/wax-questions-service/src/NumericalAnswerService/components/PreciseAnswerComponent.js @@ -1,8 +1,57 @@ -import React from 'react'; +import React, { useRef, useState } from 'react'; import styled from 'styled-components'; +const AnswerContainer = styled.div` + display: flex; + flex-direction: row; + width: 100%; +`; + +const ValueContainer = styled.div` + display: flex; + flex-direction: column; + margin-right: 25px; + label { + font-size: 12px; + } + + input:focus { + outline: none; + } +`; + +const ValueInnerContainer = styled.div` + display: flex; + flex-direction: column; +`; + const PreciseAnswerComponent = () => { - return <>Precise Answer Selected</>; + const [precise, setPrecise] = useState(''); + + const preciseRef = useRef(null); + + const onChangePrecice = () => { + setPrecise(preciseRef.current.value); + }; + + return ( + <AnswerContainer> + <ValueContainer> + <label htmlFor="preciseAnswer"> + <ValueInnerContainer> + <span>Precise Answer</span> + <input + name="preciseAnswer" + onChange={onChangePrecice} + ref={preciseRef} + type="text" + value={precise} + /> + </ValueInnerContainer> + </label> + </ValueContainer> + </AnswerContainer> + ); }; export default PreciseAnswerComponent; diff --git a/wax-questions-service/src/NumericalAnswerService/components/RangeAnswerComponent.js b/wax-questions-service/src/NumericalAnswerService/components/RangeAnswerComponent.js index 20a4cd402deea2a7f379be0f8a2da5f796f776e9..8b98b87a1f4e5e00fc6b57fa247bec302df202f8 100644 --- a/wax-questions-service/src/NumericalAnswerService/components/RangeAnswerComponent.js +++ b/wax-questions-service/src/NumericalAnswerService/components/RangeAnswerComponent.js @@ -1,7 +1,7 @@ import React, { useRef, useState } from 'react'; import styled from 'styled-components'; -const ExactAnswerContainer = styled.div` +const AnswerContainer = styled.div` display: flex; flex-direction: row; width: 100%; @@ -41,7 +41,7 @@ const RangeAnswerComponent = () => { }; return ( - <ExactAnswerContainer> + <AnswerContainer> <ValueContainer> <label htmlFor="minAnswer"> <ValueInnerContainer> @@ -70,7 +70,7 @@ const RangeAnswerComponent = () => { </ValueInnerContainer> </label> </ValueContainer> - </ExactAnswerContainer> + </AnswerContainer> ); };