Skip to content

Commit

Permalink
feat: 購入画面が重すぎたのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sor4chi committed Mar 4, 2023
1 parent 9c13d0e commit 24c6537
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/client/components/order/OrderForm/OrderForm.tsx
Expand Up @@ -33,12 +33,12 @@ export const OrderForm: FC<Props> = ({ onSubmit }) => {
formik.handleChange(event);

const zipCode = event.target.value;
const address = [...(structuredClone(zipcodeJa)[zipCode]?.address ?? [])];
const prefecture = address.shift();
const city = address.join(' ');
const address = zipcodeJa[zipCode]?.address;

formik.setFieldValue('prefecture', prefecture);
formik.setFieldValue('city', city);
if (!address) return;

formik.setFieldValue('prefecture', address.slice(0, 1));
formik.setFieldValue('city', address.slice(1, address.length).join(' '));
};

return (
Expand Down

0 comments on commit 24c6537

Please sign in to comment.