Refactor layout.js and CanvasLayout.jsx
This commit is contained in:
parent
33d2ba50e9
commit
614dfe2000
BIN
public/canvasState/d1aa3efa-d543-4a87-8541-a9f380286549.png
Normal file
BIN
public/canvasState/d1aa3efa-d543-4a87-8541-a9f380286549.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
@ -10,10 +10,10 @@ import { ToastContainer } from 'react-toastify'
|
||||
|
||||
import Header from '@/components/header/Header'
|
||||
import QModal from '@/components/common/modal/QModal'
|
||||
import { QcastProvider } from './QcastProvider'
|
||||
|
||||
import './globals.css'
|
||||
import '../styles/style.scss'
|
||||
import { QcastProvider } from './QcastProvider'
|
||||
|
||||
const inter = Inter({ subsets: ['latin'] })
|
||||
|
||||
|
||||
@ -11,10 +11,9 @@ import { useRecoilState } from 'recoil'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { modalContent, modalState } from '@/store/modalAtom'
|
||||
|
||||
export default function Login(props) {
|
||||
export default function Login() {
|
||||
const { patch } = useAxios()
|
||||
|
||||
const { currentLocale } = props
|
||||
const { getMessage } = useMessage()
|
||||
const [globalLocaleState, setGlbalLocaleState] = useRecoilState(globalLocaleStore)
|
||||
const [isSelected, setIsSelected] = useState(globalLocaleState === 'ko' ? true : false)
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import CanvasFrame from './CanvasFrame'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { currentMenuState, stepState } from '@/store/canvasAtom'
|
||||
|
||||
export default function CanvasLayout() {
|
||||
const [plans, setPlans] = useState([
|
||||
{ id: 0, name: 'Plan 1' },
|
||||
{ id: 1, name: 'Plan 2' },
|
||||
{ id: 2, name: 'Plan 3' },
|
||||
{ id: 0, name: 'Plan 1', isCurrent: false },
|
||||
{ id: 1, name: 'Plan 2', isCurrent: false },
|
||||
{ id: 2, name: 'Plan 3', isCurrent: false },
|
||||
])
|
||||
const [idxNum, setIdxNum] = useState(null)
|
||||
|
||||
@ -26,6 +26,12 @@ export default function CanvasLayout() {
|
||||
setPlans([...plans, { id: plans.length, name: `Plan ${plans.length + 1}` }])
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (plans.length === 1) {
|
||||
setPlans([{ id: 0, name: 'Plan 1', isCurrent: false }])
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="canvas-layout">
|
||||
<div className="canvas-page-list">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user