feat(chat): 협상 유의사항 안내 팝업 2종 이식 + 팝업 숨김 저장 API
KT-NEGOWIZ fe_v2 의 서비스 안내 팝업을 우리 구조로 이식.
- frontend: GuideContent(공용 본문, VAT/배송비는 chat init 메타로 동적 표시)
+ ServiceInfoPopup(채팅 진입 시 자동 — 안내 보지 않기/오늘 하루 보지 않기)
+ ServiceGuidePopup(메뉴 유의사항·이용 가이드 버튼 수동 — X/배경/ESC 닫기)
+ useServiceInfoPopup 훅(서버 상태 + localStorage 오늘 하루)
+ apis/auth 에 popupStatus 쿼리·hidePopup 뮤테이션, 헬프데스크 연락처 반영,
한국어 단어 잘림 방지(break-keep)
- backend: GET /v1/auth/popup/status, POST /v1/auth/popup/hide
(authenticate 공통 인증 + supplier_users.hide_service_info 영구 저장), 테스트 4건
- db: supplier_users.hide_service_info 컬럼 — 00-init 테이블 정의 갱신,
기존 DB 보정은 alters/2026-07-07-supplier-users-hide-service-info.sql 별도 파일
(기준선 이후 보정 ALTER 는 alters/ 파일로 관리하도록 규칙 변경)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dc0e78ec73
commit
3c8923c075
21 files changed
+488
-21
No files matched your search
@@ -1,22 +1,28 @@
|
||||
import { useState } from 'react'
|
||||
import { interactive, cn } from '@/lib'
|
||||
import { ServiceGuidePopup } from '@/features/chat/components/popup/ServiceGuidePopup'
|
||||
|
||||
// 헬프데스크 (TODO: 이용가이드 팝업 연동, 연락처는 추후 설정값으로 교체)
|
||||
// 헬프데스크 — 이용 가이드 버튼 클릭 시 안내 팝업을 연다.
|
||||
export function Contact() {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<div className="flex flex-col w-full pl-[24px] pb-[24px]">
|
||||
<div className="flex flex-col w-full gap-2">
|
||||
<div className="title-5 text-neutral-80">헬프 데스크</div>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setIsOpen(true)}
|
||||
className={cn('body-5 text-neutral-80 bg-neutral-40 rounded-[8px] px-[12px] py-[6px] w-fit', interactive)}
|
||||
>
|
||||
이용 가이드
|
||||
</button>
|
||||
<div className="flex flex-col gap-1">
|
||||
<div className="body-5 text-neutral-60">-</div>
|
||||
<div className="body-5 text-neutral-60">-</div>
|
||||
<div className="body-5 text-neutral-60">010-0000-0000</div>
|
||||
<div className="body-5 text-neutral-60">o2odev@o2o.kr</div>
|
||||
</div>
|
||||
</div>
|
||||
{isOpen && <ServiceGuidePopup onClose={() => setIsOpen(false)} />}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1,18 +1,26 @@
|
||||
import { useState } from 'react'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { interactive, cn } from '@/lib'
|
||||
import { ServiceGuidePopup } from '@/features/chat/components/popup/ServiceGuidePopup'
|
||||
|
||||
// 유의사항 및 이용방법 (TODO: 이용가이드 팝업 연동)
|
||||
// 유의사항 및 이용방법 — 클릭 시 안내 팝업을 연다.
|
||||
export function Guide() {
|
||||
const [isOpen, setIsOpen] = useState(false)
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
className={cn(
|
||||
'flex w-full bg-white rounded-[28px] py-[20px] pl-[24px] pr-[16px] justify-between items-center text-left',
|
||||
interactive,
|
||||
)}
|
||||
>
|
||||
<span className="menu-title text-neutral-80 break-keep">유의사항 및 이용방법</span>
|
||||
<ChevronRight size={20} className="text-neutral-70" />
|
||||
</button>
|
||||
<>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setIsOpen(true)}
|
||||
className={cn(
|
||||
'flex w-full bg-white rounded-[28px] py-[20px] pl-[24px] pr-[16px] justify-between items-center text-left',
|
||||
interactive,
|
||||
)}
|
||||
>
|
||||
<span className="menu-title text-neutral-80 break-keep">유의사항 및 이용방법</span>
|
||||
<ChevronRight size={20} className="text-neutral-70" />
|
||||
</button>
|
||||
{isOpen && <ServiceGuidePopup onClose={() => setIsOpen(false)} />}
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import { useChatInitStore } from '@/features/chat/stores/useChatInitStore'
|
||||
|
||||
// 협상 유의사항 및 서비스 이용 방법 안내 — 팝업 2종(자동 안내/메뉴 가이드)이 공유하는 본문.
|
||||
// VAT/배송비 문구는 채팅 init 메타(useChatInitStore)를 읽어 상품별로 동적 표시한다.
|
||||
// break-keep: 한국어 단어가 중간에서 잘려 줄바꿈되지 않도록 한다.
|
||||
const textStyle = 'text-[17px] font-normal leading-[150%] tracking-[-0.34px] text-neutral-90 break-keep'
|
||||
|
||||
function Bullet({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<div className="flex items-start py-[6px]">
|
||||
<p className="ml-[8px] mr-[6px] flex-shrink-0">•</p>
|
||||
<div className={`${textStyle} flex-1`}>{children}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export function GuideContent() {
|
||||
const { item_vat_yn, item_delivery_fee_yn } = useChatInitStore()
|
||||
// init 미로드/값 없음 → 보수적 기본값 (KT-NEGOWIZ 와 동일한 폴백 규칙)
|
||||
const vat = item_vat_yn || 'VAT별도'
|
||||
const deliveryFee = item_delivery_fee_yn || '배송비별도'
|
||||
|
||||
return (
|
||||
<div className="flex w-full flex-col">
|
||||
<div className="headline-3 mb-10 break-keep text-center text-neutral-90">
|
||||
협상 유의 사항 및 서비스 이용 방법 안내
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-start">
|
||||
<div className={`${textStyle} mb-2`}>
|
||||
협상과 관련하여 다음 사항을 참고하여 견적에 참여해 주시기 바랍니다.
|
||||
</div>
|
||||
|
||||
<Bullet>
|
||||
협상 개시는
|
||||
<span className="font-bold">Negosium 시스템의 협상 참여 버튼을 클릭하는 순간부터 시작</span>
|
||||
됩니다.
|
||||
</Bullet>
|
||||
|
||||
<Bullet>
|
||||
부여된 협상 시간에
|
||||
<span className="font-bold">
|
||||
응찰하지 않는 경우, 협상 참여의사가 없는 것으로 간주하여 재견적으로 진행
|
||||
</span>
|
||||
될 수 있습니다.
|
||||
</Bullet>
|
||||
|
||||
<Bullet>
|
||||
협상에 입력되는 모든 가격은
|
||||
<span className="font-bold text-negative">
|
||||
{vat} 및 {deliveryFee}
|
||||
</span>
|
||||
기준이며,
|
||||
<span className="font-bold">
|
||||
할인을 요청하는 경우 기존 공급가격에 할인율이 적용된 가격으로 환산
|
||||
</span>
|
||||
되어 제시됩니다.
|
||||
</Bullet>
|
||||
|
||||
<Bullet>
|
||||
본 협상 결과에 대해서는 협상자와 협상대상자 간의 비밀 유지 조건으로 진행되고, 협상에서
|
||||
얻어진 결과나 내용에 대해서는 당사자를 제외하고 제 3자에 공유할 수 없으며, 비밀 유지를
|
||||
전제로 진행됩니다.
|
||||
</Bullet>
|
||||
|
||||
<Bullet>
|
||||
협상이 종결되면 특별한 사유 없이 취소 변경이 불가하니, 신중하게 협상에 참여해 주시기
|
||||
바랍니다.
|
||||
</Bullet>
|
||||
|
||||
<Bullet>안내된 사항 외 부분은 기존 견적 프로세스와 동일한 부분 유의 바랍니다.</Bullet>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
// 하단 문의 안내 박스
|
||||
export function GuideContactBox() {
|
||||
return (
|
||||
<div className="flex w-full flex-col items-center gap-2 rounded-[16px] bg-neutral-10 p-6">
|
||||
<div className={`${textStyle} text-center`}>
|
||||
기타 협상과정에서 궁금한 사항이나 문의하실 사항은 아래의 연락처로 상담을 부탁드립니다.
|
||||
</div>
|
||||
{/* textStyle 의 font-normal 과 같은 요소에서 충돌하지 않도록 bold 는 별도 조합으로 준다 */}
|
||||
<div className="break-keep text-center text-[17px] font-bold leading-[150%] tracking-[-0.34px] text-neutral-90">
|
||||
헬프데스크 010-0000-0000, 이메일: o2odev@o2o.kr
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { X } from 'lucide-react'
|
||||
import { Modal } from '@/components'
|
||||
import { cn, interactive } from '@/lib'
|
||||
import { GuideContent, GuideContactBox } from './GuideContent'
|
||||
|
||||
// 유의사항 및 이용방법 팝업 (메뉴 버튼으로 여는 수동형). X 버튼 · 배경 클릭 · ESC 로 닫는다.
|
||||
export function ServiceGuidePopup({ onClose }: { onClose: () => void }) {
|
||||
return (
|
||||
<Modal onClose={onClose}>
|
||||
<div className="flex max-h-[90vh] w-full max-w-[1000px] flex-col items-end gap-6 overflow-y-auto rounded-3xl bg-white px-12 pb-[56px] pt-8">
|
||||
<button
|
||||
type="button"
|
||||
aria-label="닫기"
|
||||
onClick={onClose}
|
||||
className={cn(
|
||||
'flex size-10 flex-shrink-0 items-center justify-center rounded-full bg-neutral-10',
|
||||
interactive,
|
||||
)}
|
||||
>
|
||||
<X size={20} className="text-neutral-80" />
|
||||
</button>
|
||||
<div className="flex w-full flex-col gap-6 px-[40px]">
|
||||
<GuideContent />
|
||||
<GuideContactBox />
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import { cn, interactive } from '@/lib'
|
||||
import { GuideContent, GuideContactBox } from './GuideContent'
|
||||
|
||||
interface ServiceInfoPopupProps {
|
||||
isOpen: boolean
|
||||
/** 서버에 영구 저장 — 이후 어떤 기기에서도 다시 뜨지 않음 */
|
||||
onNeverShowAgain: () => void
|
||||
/** 오늘 하루 보지 않기 (localStorage) */
|
||||
onCloseToday: () => void
|
||||
}
|
||||
|
||||
const buttonStyle = cn(
|
||||
'flex h-[50px] w-[168px] items-center justify-center rounded-full',
|
||||
'border border-neutral-30 bg-white title-5 text-neutral-70',
|
||||
interactive,
|
||||
)
|
||||
|
||||
// 채팅 진입 시 자동 표시되는 서비스 안내 팝업. 버튼 2개로만 닫는다(배경 클릭/ESC 없음).
|
||||
export function ServiceInfoPopup({ isOpen, onNeverShowAgain, onCloseToday }: ServiceInfoPopupProps) {
|
||||
if (!isOpen) return null
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-[rgba(0,0,0,0.40)] p-4">
|
||||
<div className="flex max-h-[90vh] w-full max-w-[1000px] flex-col overflow-y-auto rounded-[24px] bg-white px-[80px] pb-[48px] pt-[56px]">
|
||||
<div className="mb-6 flex w-full flex-col gap-5">
|
||||
<GuideContent />
|
||||
<GuideContactBox />
|
||||
</div>
|
||||
<div className="flex w-full justify-center gap-3">
|
||||
<button type="button" className={buttonStyle} onClick={onNeverShowAgain}>
|
||||
안내 보지 않기
|
||||
</button>
|
||||
<button type="button" className={buttonStyle} onClick={onCloseToday}>
|
||||
오늘 하루 보지 않기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user