Skip to content

Commit

Permalink
feat: 가게 등록완료 UI 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
daepan committed Jan 16, 2025
1 parent 3722626 commit 6d907d9
Show file tree
Hide file tree
Showing 6 changed files with 177 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/page/ShopRegistration/view/Mobile/Main/Main.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@

&__delete-img-button {
position: relative;
right: 15px;
right: 25px;
display: flex;
justify-content: center;
align-items: center;
background-color: #f7941e;
border-radius: 50%;
height: 24px;
z-index: 999;

svg {
width: 24px;
Expand Down
6 changes: 2 additions & 4 deletions src/page/ShopRegistration/view/Mobile/Main/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ export default function Main({ onNext, onPrev }:{
} = useImagesUpload();

const handleDeleteImage = (url: string) => {
setImageFile(imageFile.filter((img) => img !== url));
setImageFile((prevImages) => prevImages.filter((img) => img !== url));
};

useEffect(() => {
if (imageFile.length > 0) {
setValue('image_urls', imageFile);
}
setValue('image_urls', imageFile);
}, [imageFile, setValue]);

const handleNextClick = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
font-weight: 500;
line-height: 160%;
border: none;

&--disable {
background-color: #cacaca;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@use "src/utils/styles/mediaQuery" as media;

.content {
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;

@include media.media-breakpoint-down(mobile) {
height: calc(100vh - 200px);
}

&__complete {
width: 160px;
height: 160px;
border-radius: 100%;
display: flex;
align-items: center;
justify-content: center;
border: 8px solid #f7941e;
margin-bottom: 72px;

@include media.media-breakpoint-down(mobile) {
width: 55px;
height: 55px;
border: 3px solid #f7941e;
margin-bottom: 25px;
}

&--check-image {
width: 74px;

@include media.media-breakpoint-down(mobile) {
width: 26px;
}
}
}

&__title {
display: block;
width: auto;
text-align: center;
font-size: 36px;
font-weight: 700;
color: #175c8e;
margin-bottom: 24px;

@include media.media-breakpoint-down(mobile) {
font-size: 24px;
margin-bottom: 18px;
}
}

&__text {
display: flex;
flex-direction: column;
gap: 5px;
text-align: center;
font-size: 16px;
font-weight: 400;
margin-bottom: 80px;
color: #858585;
}

&__link {
display: flex;
justify-content: center;
align-items: center;
width: 368px;
height: 48px;
font-weight: 500;
color: #ffffff;
background-color: #175c8e;
text-decoration: none;

&:hover {
cursor: pointer;
}

@include media.media-breakpoint-down(mobile) {
width: 82%;
}
}

&__more {
display: flex;
justify-content: center;
align-items: center;
width: 368px;
height: 48px;
font-weight: 500;
color: #ffffff;
background-color: #f7941e;
text-decoration: none;
margin-bottom: 24px;

&:hover {
cursor: pointer;
}

@include media.media-breakpoint-down(mobile) {
width: 82%;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { Link } from 'react-router-dom';
import Check from 'assets/svg/auth/check.svg?react';
import useStepStore from 'store/useStepStore';
import useShopRegistrationStore from 'store/shopRegistration';
import styles from './ShopRegistrationComplete.module.scss';

interface CompleteProps {
title: string;
topText: string;
bottomText: string;
}

export default function ShopRegistrationComplete({
title, topText, bottomText,
}: CompleteProps) {
const { setStep } = useStepStore();
const {
setCategory,
setCategoryId,
setImageUrls,
setName,
setAddress,
setPhone,
setDeliveryPrice,
setDescription,
setDelivery,
setPayBank,
setPayCard,
} = useShopRegistrationStore();

const initialize = () => {
setStep(0);
setCategory('');
setCategoryId(0);
setDelivery(false);
setDeliveryPrice(0);
setDescription('');
setImageUrls([]);
setName('');
setPayBank(false);
setPayCard(false);
setPhone('');
setAddress(''); // 전역 상태 초기화
};
return (
<div className={styles.content}>
<div className={styles.content__complete}>
<Check className={styles['content__complete--check-image']} />
</div>
<span className={styles.content__title}>{title}</span>
<div className={styles.content__text}>
<span>
{topText}
</span>
<span>
{bottomText}
</span>
</div>
<Link to="/owner" className={styles.content__more} onClick={initialize}>내 상점 바로가기</Link>
<Link to="/owner/shop-registration" className={styles.content__link} onClick={initialize}>가게 추가 등록하기</Link>
</div>
);
}
8 changes: 3 additions & 5 deletions src/page/ShopRegistration/view/Mobile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PreviousStep from 'component/Auth/PreviousStep';
import ProgressBar from 'component/Auth/ProgressBar';
import Complete from 'component/Auth/Complete';
import ShopRegistrationComplete from 'page/ShopRegistration/view/Mobile/ShopRegistrationComplete';
import SubTitle from 'component/Auth/SubTitle';
import PROGRESS_TITLE from 'utils/constant/progress';
import ShopEntry from 'page/ShopRegistration/view/Mobile/ShopEntry';
Expand Down Expand Up @@ -139,12 +139,10 @@ export default function ShopRegistrationMobile() {
</>
)}
{step === 5 && (
<Complete
<ShopRegistrationComplete
title="가게 등록 완료"
topText="가게 등록이 완료되었습니다."
bottomText="업체 정보 수정은 내 상점에서 가능합니다."
link="/"
linkText="메인 화면 바로가기"
bottomText="가게 정보 수정은 내 상점에서 가능합니다."
/>
)}
</div>
Expand Down

0 comments on commit 6d907d9

Please sign in to comment.