Compare commits

..

No commits in common. "eea55ae8b4a2cb8b648961df9f3e6af6e9998fe8" and "eaddd3b2a3386a6b3526d581f3c95055068b23bf" have entirely different histories.

5 changed files with 5 additions and 75 deletions

View File

@ -1,16 +1,6 @@
'use client'
import { useEffect } from 'react'
import { useSurveySaleTabState } from '@/store/surveySaleTabState'
import BasicForm from '@/components/survey-sale/detail/BasicForm'
export default function page() {
const { setBasicInfoSelected } = useSurveySaleTabState()
useEffect(() => {
setBasicInfoSelected()
}, [])
return (
<>
<BasicForm />

View File

@ -1,16 +1,6 @@
'use client'
import { useEffect } from 'react'
import { useSurveySaleTabState } from '@/store/surveySaleTabState'
import RoofInfoForm from '@/components/survey-sale/detail/RoofInfoForm'
export default function page() {
const { setRoofInfoSelected } = useSurveySaleTabState()
useEffect(() => {
setRoofInfoSelected()
}, [])
return (
<>
<RoofInfoForm />

View File

@ -1,44 +1,21 @@
'use client'
import { useSurveySaleTabState } from '@/store/surveySaleTabState'
import { usePathname, useRouter } from 'next/navigation'
import { useEffect } from 'react'
import { usePathname } from 'next/navigation'
export default function NavTab() {
const router = useRouter()
const pathname = usePathname()
if (pathname === '/survey-sale') {
return null
}
const { basicInfoSelected, roofInfoSelected, reset } = useSurveySaleTabState()
useEffect(() => {
return () => {
reset()
}
}, [])
const handleBasicInfoClick = () => {
router.push('/survey-sale/basic-info')
}
const handleRoofInfoClick = () => {
router.push('/survey-sale/roof-info')
}
return (
<>
<div className="sale-detail-tab-relative">
<div className="sale-detail-tab-wrap">
<div className="sale-detail-tab-inner">
<button className={`sale-detail-tab ${basicInfoSelected ? 'act' : ''}`} onClick={handleBasicInfoClick}>
</button>
<button className={`sale-detail-tab ${roofInfoSelected ? 'act' : ''}`} onClick={handleRoofInfoClick}>
/
</button>
<button className="sale-detail-tab"></button>
<button className="sale-detail-tab"> / </button>
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
import { useEffect, useState } from 'react'
import Link from 'next/link'
import { usePathname, useRouter } from 'next/navigation'
import { usePathname } from 'next/navigation'
import { Swiper, SwiperSlide } from 'swiper/react'
@ -17,7 +17,6 @@ import 'swiper/css'
// }
export default function Header({ name }: HeaderProps) {
const router = useRouter()
const pathname = usePathname()
const [headerAct, setHeaderAct] = useState<boolean>(false)
const [isShowBackBtn, setIsShowBackBtn] = useState<boolean>(false)
@ -39,7 +38,7 @@ export default function Header({ name }: HeaderProps) {
<div className="header-inner">
{isShowBackBtn && (
<div className="back-button-wrap">
<button className="back-button" onClick={() => router.back()}></button>
<button className="back-button"></button>
</div>
)}
<h2 className="logo">

View File

@ -1,26 +0,0 @@
import { create } from 'zustand'
type SurveySaleTabState = {
basicInfoSelected: boolean
roofInfoSelected: boolean
setBasicInfoSelected: () => void
setRoofInfoSelected: () => void
reset: () => void
}
type InitialState = {
basicInfoSelected: boolean
roofInfoSelected: boolean
}
const initialState: InitialState = {
basicInfoSelected: true,
roofInfoSelected: false,
}
export const useSurveySaleTabState = create<SurveySaleTabState>((set) => ({
...initialState,
setBasicInfoSelected: () => set((state) => ({ ...state, basicInfoSelected: true, roofInfoSelected: false })),
setRoofInfoSelected: () => set((state) => ({ ...state, basicInfoSelected: false, roofInfoSelected: true })),
reset: () => set(initialState),
}))