Skip to content

Commit

Permalink
Merge pull request Yanabada#193 from Yanabada/feature/Yanabada#189
Browse files Browse the repository at this point in the history
Fix: 페이&양도 QA 2차 반영
  • Loading branch information
furaha707 authored Jan 26, 2024
2 parents d5e3a2e + 2d666bd commit 881ac06
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/priceArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const PriceArea = ({

function priceFormat(n: number): string {
const formattedNumber = numberFormat(n);
return `${formattedNumber}`;
return `${formattedNumber}`;
}

const renderCalButton = ([amount, text, calc]: [number, string, string]): JSX.Element => (
Expand Down
12 changes: 10 additions & 2 deletions src/pages/charge/account.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as CS from "./styles/styles";

import { useState } from "react";
import { useEffect, useState } from "react";
import { IoMdArrowDropup } from "react-icons/io";
import { IoMdArrowDropdown } from "react-icons/io";
import { GoCheck } from "react-icons/go";
Expand Down Expand Up @@ -29,6 +29,14 @@ const Account = () => {
const [check2, setCheck2] = useState(false);
const numberPattern = /^[0-9]{10,14}$/;

useEffect(() => {
if (check1 && check2) {
setAllCheck(true);
} else {
setAllCheck(false);
}
}, [check1, check2]);

const toggleOption = () => {
setIsOptionVisible((prev) => !prev);
};
Expand All @@ -50,7 +58,7 @@ const Account = () => {

const completeAccount = () => {
setBottomSheetVisible(true);
if (allCheck) {
if (allCheck && isFormValid) {
const simplePassword = password.join("");
const accountNumber = String(bankNumber);

Expand Down
6 changes: 4 additions & 2 deletions src/pages/charge/confirm.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import * as S from "./styles/confirm";
import * as CS from "./styles/password";

import { useNavigate, useParams, useSearchParams } from "react-router-dom";

import { numberFormat } from "@utils/numberFormat";
import BaseButton from "@components/buttons/BaseButton";
import UpperNavBar from "@components/navBar/upperNavBar";
import usePaymentHistory from "./hooks/usePaymentHistory";
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
import CheckIcoLogo from "@assets/check-ico.png";

import usePaymentHistory from "./hooks/usePaymentHistory";

const typeMap = new Map([
["DISBURSEMENT", "인출"],
["CHARGE", "충전"],
Expand Down
2 changes: 1 addition & 1 deletion src/pages/charge/hooks/useRegisterPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const useRegisterForPayment = () => {
navigate("/charge/success");
},
onError: (error: Error) => {
toast.error("이미 야놀자 페이에 가입되어있습니다");
toast.error("뭐라하지");
console.error("등록 실패", error);
}
});
Expand Down
6 changes: 4 additions & 2 deletions src/pages/charge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const Charge = () => {
const [bankMessage, setBankMessage] = useState("계좌선택");
const { amount, setAmount } = AmountStore();

const isFormValid = amount && bankMessage !== "계좌선택";

const [searchParams] = useSearchParams();
const typeParam = searchParams.get("type");
const priceParam = searchParams.get("price");
Expand Down Expand Up @@ -119,12 +121,12 @@ const Charge = () => {
) : null}
<S.ButtonWrapper>
{amount < 10000 || amount > 2000000 ? (
<BaseButton buttonType="disabled-default" width="100%">
<BaseButton buttonType={isFormValid ? "default" : "disabled-default"} width="100%">
{typeText}하기
</BaseButton>
) : (
<Link to={`/charge/password?registration=false&type=${typeParam}`}>
<BaseButton buttonType="default" width="100%">
<BaseButton buttonType={isFormValid ? "default" : "disabled-default"} width="100%">
{typeText}하기
</BaseButton>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/sell/components/DateOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const DateOption = ({
) : (
<>
<span className="percentage text-orange">
{endDateInfo.feePercentage}%
{100 - endDateInfo.feePercentage}%
</span>
&nbsp;
<span className="price">{numberFormat(calcFeeNumber)}</span>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/sell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import Cookies from "js-cookie";
import UpperNavBar from "@components/navBar/upperNavBar";
import Notice from "@components/notice";
import AuthenticationButton from "@components/buttons/AuthenticationButton";
import Modal from "@components/modal";
import { getDayOfWeek } from "@utils/getDayOfWeek";
import NoItemsLogo from "@assets/noitems-logo.png";

import getSellList from "./apis/getSellList";
import { SellListData } from "./types/sellListData";
import Modal from "@components/modal";

const Sell = () => {
const [selectedCard, setSelectedCard] = useState<number | null>(null);
Expand Down Expand Up @@ -91,7 +91,7 @@ const Sell = () => {
}}
transition={{ duration: 0.2, delay: 0.1 }}
>
<label htmlFor="radioButton1">
<label htmlFor={"select" + sellItem.id}>
<div className="list-card">
<p className="list-card__title">
{sellItem.accommodationName}
Expand Down

0 comments on commit 881ac06

Please sign in to comment.