From b3a8021dfedbaa2e2556b50475e6bc6fe3391c1c Mon Sep 17 00:00:00 2001 From: Subny Date: Tue, 30 May 2023 11:12:28 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[#91]FIX:=EB=B6=80=EB=AA=A8=EC=9E=85?= =?UTF-8?q?=EC=9E=A5=EC=97=90=EC=84=9C=20=EC=9E=90=EB=8F=99=EC=9D=B4?= =?UTF-8?q?=EC=B2=B4=20=EC=95=88=EB=90=98=EB=8A=94=EA=B1=B0=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/debitBanner/DebitBanner.jsx | 49 ++++++++++++---------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/src/components/debitBanner/DebitBanner.jsx b/src/components/debitBanner/DebitBanner.jsx index e79694c..f1589f4 100644 --- a/src/components/debitBanner/DebitBanner.jsx +++ b/src/components/debitBanner/DebitBanner.jsx @@ -16,6 +16,7 @@ const DebitBanner = ({idx, color, setKidUserId, setKidUserName}) => { const [familyOptions, setFamilyOptions] = useState([{ value: '가족 선택하기', label: '가족 선택하기' }]) const [kidBalance, setKidBalance] = useState([0]); const [nowKidBalance, setNowKidBalance] = useState(kidBalance[0]) + const parentMenuOptions = [ { value: '이체 하기', label:
이체 하기
}, @@ -29,8 +30,8 @@ const DebitBanner = ({idx, color, setKidUserId, setKidUserName}) => { ] + // const [kidSelectedValue, setKidSelectedValue] = useState(kidMenuOptions[idx].value); const [parentSelectedValue, setParentSelectedValue] = useState(parentMenuOptions[idx].value); - const [kidSelectedValue, setKidSelectedValue] = useState(kidMenuOptions[idx].value); useEffect(() => { if(parent === "F") { @@ -95,7 +96,9 @@ const DebitBanner = ({idx, color, setKidUserId, setKidUserName}) => { if (kidOptions.length !== 0) { - if(parent === "T") { + + if (parent === "F") { + return (
@@ -110,18 +113,18 @@ const DebitBanner = ({idx, color, setKidUserId, setKidUserName}) => { } }), }} - options={parentMenuOptions} + options={kidMenuOptions} onChange={(e) => {setParentSelectedValue(e.value) }} components={{ DropdownIndicator:() => null, IndicatorSeparator:() => null }} - value={parentMenuOptions.filter(function (option) { + value={kidMenuOptions.filter(function (option) { return option.value === parentSelectedValue; })} />
-
아이 현재 잔액:
-
{nowKidBalance} 원
+
내 잔액:
+
{kidInfo} 원
{ borderColor: "#FFF" } }), - }} - options={kidMenuOptions} - onChange={(e) => {setKidSelectedValue(e.value) + }} + options={parentMenuOptions} + onChange={(e) => {setParentSelectedValue(e.value) }} components={{ DropdownIndicator:() => null, IndicatorSeparator:() => null }} - value={kidMenuOptions.filter(function (option) { - return option.value === kidSelectedValue; + value={parentMenuOptions.filter(function (option) { + return option.value === parentSelectedValue; })} />
-
내 잔액:
-
{kidInfo} 원
+
아이 현재 잔액:
+
{nowKidBalance} 원