📌fix: addPlan 버튼 조건부 렌더링 추가
This commit is contained in:
parent
9754fb6049
commit
936b6c0458
@ -1,6 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useContext, useEffect } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
|
import { usePathname } from 'next/navigation'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||||
import { SessionContext } from '@/app/SessionProvider'
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
@ -12,6 +13,7 @@ import { globalLocaleStore } from '@/store/localeAtom'
|
|||||||
|
|
||||||
export default function CanvasLayout({ children }) {
|
export default function CanvasLayout({ children }) {
|
||||||
// const { menuNumber } = props
|
// const { menuNumber } = props
|
||||||
|
const pathname = usePathname()
|
||||||
const { menuNumber } = useCanvasMenu()
|
const { menuNumber } = useCanvasMenu()
|
||||||
const { session } = useContext(SessionContext)
|
const { session } = useContext(SessionContext)
|
||||||
const { floorPlanState } = useContext(FloorPlanContext)
|
const { floorPlanState } = useContext(FloorPlanContext)
|
||||||
@ -54,7 +56,7 @@ export default function CanvasLayout({ children }) {
|
|||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
{plans.length < 10 && (
|
{plans.length < 10 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (
|
||||||
<button
|
<button
|
||||||
className="plane-add"
|
className="plane-add"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user