diff --git a/src/components/pages/companyPage/auth/signUp/address.jsx b/src/components/pages/companyPage/auth/signUp/address.jsx new file mode 100644 index 0000000..7bc2a33 --- /dev/null +++ b/src/components/pages/companyPage/auth/signUp/address.jsx @@ -0,0 +1,117 @@ +import styled from "styled-components"; +import { open } from "../../../../common/addresshook"; +import { Category, InputForm } from "./styles"; + +const CompanyAddress = ({ info, setInfo }) => { + const arr = [ + { + title: "본사", + str: "home", + }, + { + title: "연구소/지점", + str: "agent", + }, + ]; + + const getAddress = (data, str) => { + let fullAddress = data.address; + let extraAddress = ""; + + if (data.addressType === "R") { + if (data.bname !== "") { + extraAddress += data.bname; + } + if (data.buildingName !== "") { + extraAddress += + extraAddress !== "" ? `, ${data.buildingName}` : data.buildingName; + } + fullAddress += extraAddress !== "" ? ` (${extraAddress})` : ""; + } + + setInfo({ + ...info, + [str + "FullAddress"]: fullAddress, + [str + "AddressNumber"]: data.zonecode, + }); + document.body.removeChild(document.getElementById("daum_postcode_script")); + }; + + return ( + <> +
+{data.title} | -{data.data} | -
{data.title} | + {typeof data.data == "string" ? ( +{data.data} | + ) : ( + <> + {data.data.map((str) => ( +{str} | + ))} + > + )} +
{data.title} | -{data.data} | -
{data.title} | + {typeof data.data == "string" ? ( +{data.data} | + ) : ( + <> + {data.data.map((str) => ( +{str.name} | + ))} + > + )} +