From f16826ab74868bfae9fa13b344e1499e84d66d9f Mon Sep 17 00:00:00 2001 From: sienori Date: Sat, 23 Feb 2019 02:36:02 +0900 Subject: [PATCH] Apply candidate option to popup --- src/popup/components/ResultArea.js | 7 ++++--- src/popup/styles/ResultArea.scss | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/popup/components/ResultArea.js b/src/popup/components/ResultArea.js index 495cf87..cc7021c 100644 --- a/src/popup/components/ResultArea.js +++ b/src/popup/components/ResultArea.js @@ -1,5 +1,6 @@ import React from "react"; import getErrorMessage from "src/common/getErrorMessage"; +import { getSettings } from "src/settings/settings"; import "../styles/ResultArea.scss"; const splitLine = text => { @@ -10,13 +11,13 @@ const splitLine = text => { export default props => { const { resultText, candidateText, statusText } = props; const isError = statusText !== "OK"; + const shouldShowCandidate = getSettings("ifShowCandidate"); return (

{splitLine(resultText)}

-

- {isError ? getErrorMessage(statusText) : splitLine(candidateText)} -

+ {shouldShowCandidate &&

{splitLine(candidateText)}

} + {isError &&

{getErrorMessage(statusText)}

}
); }; diff --git a/src/popup/styles/ResultArea.scss b/src/popup/styles/ResultArea.scss index 8f51b59..ea0d15d 100644 --- a/src/popup/styles/ResultArea.scss +++ b/src/popup/styles/ResultArea.scss @@ -14,7 +14,8 @@ &.resultText { color: var(--main-text); } - &.candidateText { + &.candidateText, + &.error { color: var(--sub-text); margin-top: 1em; &:empty {