Merge branch 'dev' of https://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
aa486480f4
@ -10,7 +10,6 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nextui-org/react": "^2.4.2",
|
"@nextui-org/react": "^2.4.2",
|
||||||
"@prisma/client": "^5.18.0",
|
|
||||||
"ag-grid-react": "^32.0.2",
|
"ag-grid-react": "^32.0.2",
|
||||||
"axios": "^1.7.3",
|
"axios": "^1.7.3",
|
||||||
"fabric": "^5.3.0",
|
"fabric": "^5.3.0",
|
||||||
@ -30,7 +29,6 @@
|
|||||||
"react-hook-form": "^7.53.0",
|
"react-hook-form": "^7.53.0",
|
||||||
"react-icons": "^5.3.0",
|
"react-icons": "^5.3.0",
|
||||||
"react-responsive-modal": "^6.4.2",
|
"react-responsive-modal": "^6.4.2",
|
||||||
"react-toastify": "^10.0.5",
|
|
||||||
"recoil": "^0.7.7",
|
"recoil": "^0.7.7",
|
||||||
"sweetalert2": "^11.14.1",
|
"sweetalert2": "^11.14.1",
|
||||||
"sweetalert2-react-content": "^5.0.7",
|
"sweetalert2-react-content": "^5.0.7",
|
||||||
@ -42,7 +40,6 @@
|
|||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"postcss": "^8",
|
"postcss": "^8",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"prisma": "^5.18.0",
|
|
||||||
"react-color-palette": "^7.2.2",
|
"react-color-palette": "^7.2.2",
|
||||||
"react-select": "^5.8.1",
|
"react-select": "^5.8.1",
|
||||||
"sass": "^1.77.8",
|
"sass": "^1.77.8",
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { I18nProviderClient } from '@/locales/client'
|
|
||||||
|
|
||||||
export function LocaleProvider({ locale, children }) {
|
|
||||||
return (
|
|
||||||
<I18nProviderClient locale={locale} fallback={''}>
|
|
||||||
{children}
|
|
||||||
</I18nProviderClient>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Archive from '@/components/community/Archive'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function CommunityArchivePage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="자료 다운로드" />
|
|
||||||
<div className="container flex flex-wrap items-center justify-between mx-auto p-4 m-4 border">
|
|
||||||
<Archive />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Faq from '@/components/community/Faq'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function CommunityFaqPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="FAQ" />
|
|
||||||
<div className="container flex flex-wrap items-center justify-between mx-auto p-4 m-4 border">
|
|
||||||
<Faq />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Notice from '@/components/community/Notice'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function CommunityNoticePage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="공지사항" />
|
|
||||||
<div className="container flex flex-wrap items-center justify-between mx-auto p-4 m-4 border">
|
|
||||||
<Notice />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
export default function ServerError() {
|
|
||||||
return (
|
|
||||||
<section className="bg-white dark:bg-gray-900">
|
|
||||||
<div className="py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6">
|
|
||||||
<div className="mx-auto max-w-screen-sm text-center">
|
|
||||||
<h1 className="mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-primary-600 dark:text-primary-500">500</h1>
|
|
||||||
<p className="mb-4 text-3xl tracking-tight font-bold text-gray-900 md:text-4xl dark:text-white">Internal Server Error.</p>
|
|
||||||
<p className="mb-4 text-lg font-light text-gray-500 dark:text-gray-400">We are already working to solve the problem. </p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
import FloorPlan from '@/components/floor-plan/FloorPlan'
|
|
||||||
|
|
||||||
export default function FloorPlanPage() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<FloorPlan />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import InitSettingsModal from '@/components/InitSettingsModal'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function InitSettingsModalPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="Basic Settings" />
|
|
||||||
<div className="flex flex-col justify-center my-8">
|
|
||||||
<InitSettingsModal />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import Intro from '@/components/Intro'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function IntroPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="container mx-auto p-4 m-4 border">
|
|
||||||
<Intro />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
|
||||||
|
|
||||||
export default function CompletePage() {
|
|
||||||
const { getMessage } = useMessage()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="flex min-h-full flex-1 flex-col justify-center px-6 py-12 lg:px-8">
|
|
||||||
<h1 className="text-center text-4xl font-bold mb-10">{getMessage('join.complete.title')}</h1>
|
|
||||||
<div className="mt-10 mb-10 w-full text-center text-2xl">{getMessage('join.complete.contents')}</div>
|
|
||||||
<div className="mt-10 w-full text-center">
|
|
||||||
{getMessage('join.complete.email_comment')} : {getMessage('join.complete.email')}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
import Join from '@/components/auth/Join'
|
|
||||||
|
|
||||||
export default function JoinPage() {
|
|
||||||
return <>{<Join />}</>
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { useEffect } from 'react'
|
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
|
||||||
import { appMessageStore, globalLocaleStore } from '@/store/localeAtom'
|
|
||||||
import { LocaleProvider } from './LocaleProvider'
|
|
||||||
import { useCurrentLocale } from '@/locales/client'
|
|
||||||
import ServerError from './error'
|
|
||||||
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
|
|
||||||
import '@/styles/common.scss'
|
|
||||||
|
|
||||||
import KO from '@/locales/ko.json'
|
|
||||||
import JA from '@/locales/ja.json'
|
|
||||||
|
|
||||||
export default function LocaleLayout({ children }) {
|
|
||||||
const locale = useCurrentLocale()
|
|
||||||
const globalLocale = useRecoilValue(globalLocaleStore)
|
|
||||||
const [appMessageState, setAppMessageState] = useRecoilState(appMessageStore)
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log(globalLocale)
|
|
||||||
console.log(sessionStorage.getItem('hi'))
|
|
||||||
console.log(Object.keys(appMessageState).length)
|
|
||||||
// if (Object.keys(appMessageState).length === 0) {
|
|
||||||
if (globalLocale === 'ko') {
|
|
||||||
setAppMessageState(KO)
|
|
||||||
} else {
|
|
||||||
setAppMessageState(JA)
|
|
||||||
}
|
|
||||||
// }
|
|
||||||
}, [globalLocale])
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ErrorBoundary fallback={<ServerError />}>
|
|
||||||
<LocaleProvider locale={locale} fallback={<ServerError />}>
|
|
||||||
{children}
|
|
||||||
</LocaleProvider>
|
|
||||||
</ErrorBoundary>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Login from '@/components/auth/Login'
|
|
||||||
import { getCurrentLocale } from '@/locales/server'
|
|
||||||
|
|
||||||
export default function LoginPage() {
|
|
||||||
const currentLocale = getCurrentLocale()
|
|
||||||
|
|
||||||
const loginPageProps = {
|
|
||||||
currentLocale,
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Login {...loginPageProps} />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Plan from '@/components/management/Plan'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function ManagementPlanPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="도면관리" />
|
|
||||||
<div className="container flex flex-wrap items-center justify-between mx-auto p-4 m-4 border">
|
|
||||||
<Plan />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import Hero from '@/components/Hero'
|
|
||||||
import StuffDetail from '@/components/management/StuffDetail'
|
|
||||||
import Link from 'next/link'
|
|
||||||
export default function ManagementStuffDetailPage() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="pt-48 flex justify-left">
|
|
||||||
<h1 className="text-4xl archivo-black-regular">물건정보</h1>
|
|
||||||
<Link href="/management/plan">
|
|
||||||
<h1 className="text-4xl archivo-black-regular">도면작성</h1>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
<div className="m2">
|
|
||||||
<StuffDetail />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
import StuffSearchCondition from '@/components/management/StuffSearchCondition'
|
|
||||||
import Stuff from '@/components/management/Stuff'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
import Hero from '@/components/Hero'
|
|
||||||
export default async function ManagementStuffPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="물건현황" />
|
|
||||||
<div>
|
|
||||||
<div className="m2">
|
|
||||||
<StuffSearchCondition />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col justify-center my-8 pt-20">
|
|
||||||
<Stuff />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import Hero from '@/components/Hero'
|
|
||||||
import StuffDetail from '@/components/management/StuffDetail'
|
|
||||||
export default function ManagementStuffDetailPage() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="pt-48 flex justify-left">
|
|
||||||
<h1 className="text-4xl archivo-black-regular">물건정보</h1>
|
|
||||||
</div>
|
|
||||||
<div className="m2">
|
|
||||||
<StuffDetail />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Company from '@/components/master/Company'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function MasterCompanyPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="회사정보 조회" />
|
|
||||||
<div className="container flex flex-wrap items-center justify-between mx-auto p-4 m-4 border">
|
|
||||||
<Company />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Price from '@/components/master/Price'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function MasterPricePage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="가격 마스터 조회" />
|
|
||||||
<div className="container flex flex-wrap items-center justify-between mx-auto p-4 m-4 border">
|
|
||||||
<Price />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import Link from 'next/link'
|
|
||||||
|
|
||||||
export default function NotFound() {
|
|
||||||
return (
|
|
||||||
<section className="bg-white dark:bg-gray-900">
|
|
||||||
<div className="py-8 px-4 mx-auto max-w-screen-xl lg:py-16 lg:px-6">
|
|
||||||
<div className="mx-auto max-w-screen-sm text-center">
|
|
||||||
<h1 className="mb-4 text-7xl tracking-tight font-extrabold lg:text-9xl text-primary-600 dark:text-primary-500">404</h1>
|
|
||||||
<p className="mb-4 text-3xl tracking-tight font-bold text-gray-900 md:text-4xl dark:text-white">Something's missing.</p>
|
|
||||||
<p className="mb-4 text-lg font-light text-gray-500 dark:text-gray-400">
|
|
||||||
Sorry, we can't find that page. You'll find lots to explore on the home page.{' '}
|
|
||||||
</p>
|
|
||||||
<Link
|
|
||||||
href="/"
|
|
||||||
className="inline-flex text-white bg-primary-600 hover:bg-primary-800 focus:ring-4 focus:outline-none focus:ring-primary-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:focus:ring-primary-900 my-4"
|
|
||||||
>
|
|
||||||
Back to Homepage
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
import { getSession } from '@/lib/authActions'
|
|
||||||
import MainPage from '@/components/Main'
|
|
||||||
|
|
||||||
export default async function page() {
|
|
||||||
const session = await getSession()
|
|
||||||
|
|
||||||
const mainPageProps = {
|
|
||||||
isLoggedIn: session?.isLoggedIn,
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div className="m-4">
|
|
||||||
<MainPage {...mainPageProps} />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
import Playground from '@/components/Playground'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function PlaygroundPage() {
|
|
||||||
// const { session } = await checkSession()
|
|
||||||
|
|
||||||
// if (!session.isLoggedIn) {
|
|
||||||
// redirect('/login')
|
|
||||||
// }
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Playground />
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Roof from '@/components/Roof'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function RoofPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="Drawing on canvas 2D Roof" />
|
|
||||||
<div className="flex flex-col justify-center my-8">
|
|
||||||
<Roof />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,128 +0,0 @@
|
|||||||
'use client'
|
|
||||||
|
|
||||||
import { Select, SelectItem } from '@nextui-org/react'
|
|
||||||
import { useEffect, useState } from 'react'
|
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
|
||||||
|
|
||||||
export default function RoofSelect() {
|
|
||||||
const [roofMaterials, setRoofMaterials] = useState([])
|
|
||||||
const [manufacturers, setManufacturers] = useState([])
|
|
||||||
const [trestles, setTrestles] = useState([])
|
|
||||||
const [modules, setModules] = useState([])
|
|
||||||
const [originTrestles, setOriginTrestles] = useState([])
|
|
||||||
|
|
||||||
const [roofMaterialId, setRoofMaterialId] = useState(null)
|
|
||||||
const [manufacturerId, setManufacturerId] = useState(null)
|
|
||||||
const [trestleId, setTrestleId] = useState(null)
|
|
||||||
|
|
||||||
const { get } = useAxios()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
get({ url: '/api/roof-material/roof-material-infos' }).then((res) => {
|
|
||||||
//TODO: error handling
|
|
||||||
if (!res) return
|
|
||||||
|
|
||||||
setRoofMaterials(res)
|
|
||||||
})
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!roofMaterialId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
get({ url: `/api/roof-material/roof-material-infos/${roofMaterialId}/trestles` }).then((res) => {
|
|
||||||
if (res.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setOriginTrestles(res)
|
|
||||||
const manufactural = res.map((trestle) => {
|
|
||||||
return { id: trestle.manufacturerId, name: trestle.manufacturerName }
|
|
||||||
})
|
|
||||||
// Remove duplicates
|
|
||||||
const uniqueManufactural = Array.from(new Set(manufactural.map((a) => a.id))).map((id) => {
|
|
||||||
return manufactural.find((a) => a.id === id)
|
|
||||||
})
|
|
||||||
|
|
||||||
setManufacturers(uniqueManufactural)
|
|
||||||
})
|
|
||||||
}, [roofMaterialId])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!manufacturerId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const trestles = originTrestles.filter((trestle) => trestle.manufacturerId === manufacturerId)
|
|
||||||
setTrestles(trestles)
|
|
||||||
}, [manufacturerId])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!trestleId) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
get({ url: `/api/module/module-infos?roofMaterialId=${roofMaterialId}&trestleId=${trestleId}` }).then((res) => {
|
|
||||||
if (res.length === 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
setModules(res)
|
|
||||||
})
|
|
||||||
}, [trestleId])
|
|
||||||
|
|
||||||
const handleRoofMaterialOnChange = (e) => {
|
|
||||||
const roofMaterialId = e.target.value
|
|
||||||
setRoofMaterialId(roofMaterialId)
|
|
||||||
setManufacturers([])
|
|
||||||
setManufacturerId(null)
|
|
||||||
setTrestleId(null)
|
|
||||||
setTrestles([])
|
|
||||||
setModules([])
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleManufacturersOnChange = (e) => {
|
|
||||||
const manufacturerId = Number(e.target.value)
|
|
||||||
setTrestles([])
|
|
||||||
setManufacturerId(manufacturerId)
|
|
||||||
setTrestleId(null)
|
|
||||||
setModules([])
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleTrestlesOnChange = (e) => {
|
|
||||||
const trestleId = Number(e.target.value)
|
|
||||||
setTrestleId(trestleId)
|
|
||||||
setModules([])
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="flex w-full flex-wrap md:flex-nowrap gap-4">
|
|
||||||
{roofMaterials.length > 0 && (
|
|
||||||
<Select label="지붕재" className="max-w-xs" onChange={handleRoofMaterialOnChange}>
|
|
||||||
{roofMaterials.map((roofMaterial) => (
|
|
||||||
<SelectItem key={roofMaterial.id}>{roofMaterial.name}</SelectItem>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
)}
|
|
||||||
{manufacturers.length > 0 && (
|
|
||||||
<Select label="제조 회사" className="max-w-xs" onChange={handleManufacturersOnChange}>
|
|
||||||
{manufacturers.map((manufacturer) => (
|
|
||||||
<SelectItem key={manufacturer.id}>{manufacturer.name}</SelectItem>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
)}
|
|
||||||
{trestles.length > 0 && (
|
|
||||||
<Select label="가대" className="max-w-xs" onChange={handleTrestlesOnChange}>
|
|
||||||
{trestles.map((trestle) => (
|
|
||||||
<SelectItem key={trestle.id}>{trestle.name}</SelectItem>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
)}
|
|
||||||
{modules.length > 0 && (
|
|
||||||
<Select label="설치가능 모듈" className="max-w-xs">
|
|
||||||
{modules.map((module) => (
|
|
||||||
<SelectItem key={module.id}>{module.name}</SelectItem>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
import Roof2 from '@/components/Roof2'
|
|
||||||
import RoofSelect from '@/app/[locale]/roof2/RoofSelect'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function Roof2Page() {
|
|
||||||
const session = await initCheck()
|
|
||||||
const roof2Props = {
|
|
||||||
name: session.name || '',
|
|
||||||
userId: session.userId || '',
|
|
||||||
email: session.email || '',
|
|
||||||
isLoggedIn: session.isLoggedIn,
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div>
|
|
||||||
<div className="m-2">
|
|
||||||
<RoofSelect />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col justify-center my-8 pt-20">
|
|
||||||
<Roof2 {...roof2Props} />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
import Hero from '@/components/Hero'
|
|
||||||
import Settings from '@/components/Settings'
|
|
||||||
import { initCheck } from '@/util/session-util'
|
|
||||||
|
|
||||||
export default async function SettingsPage() {
|
|
||||||
await initCheck()
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Hero title="Canvas Setting" />
|
|
||||||
<div className="flex flex-col justify-center my-8">
|
|
||||||
<Settings />
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,25 +1,19 @@
|
|||||||
// import { Inter } from 'next/font/google'
|
|
||||||
|
|
||||||
import { headers } from 'next/headers'
|
import { headers } from 'next/headers'
|
||||||
import { redirect } from 'next/navigation'
|
import { redirect } from 'next/navigation'
|
||||||
import { getSession } from '@/lib/authActions'
|
import { getSession } from '@/lib/authActions'
|
||||||
import RecoilRootWrapper from './RecoilWrapper'
|
import RecoilRootWrapper from './RecoilWrapper'
|
||||||
|
|
||||||
import { ToastContainer } from 'react-toastify'
|
|
||||||
|
|
||||||
import { QcastProvider } from './QcastProvider'
|
import { QcastProvider } from './QcastProvider'
|
||||||
import Header from '@/components/header/Header'
|
import Header from '@/components/header/Header'
|
||||||
import QModal from '@/components/common/modal/QModal'
|
import QModal from '@/components/common/modal/QModal'
|
||||||
|
|
||||||
import './globals.css'
|
|
||||||
import '../styles/style.scss'
|
|
||||||
import '../styles/contents.scss'
|
|
||||||
import Dimmed from '@/components/ui/Dimmed'
|
import Dimmed from '@/components/ui/Dimmed'
|
||||||
import SessionProvider from './SessionProvider'
|
import SessionProvider from './SessionProvider'
|
||||||
import LocaleSwitch from '@/components/LocaleSwitch'
|
import LocaleSwitch from '@/components/LocaleSwitch'
|
||||||
import PopupManager from '@/components/common/popupManager/PopupManager'
|
import PopupManager from '@/components/common/popupManager/PopupManager'
|
||||||
|
|
||||||
// const inter = Inter({ subsets: ['latin'] })
|
import './globals.css'
|
||||||
|
import '../styles/style.scss'
|
||||||
|
import '../styles/contents.scss'
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'Create Next App',
|
title: 'Create Next App',
|
||||||
@ -30,8 +24,6 @@ export default async function RootLayout({ children }) {
|
|||||||
const headersList = headers()
|
const headersList = headers()
|
||||||
const headerPathname = headersList.get('x-pathname') || ''
|
const headerPathname = headersList.get('x-pathname') || ''
|
||||||
|
|
||||||
// console.log('headerPathname:', headerPathname)
|
|
||||||
// const isLoggedIn = await checkSession()
|
|
||||||
const session = await getSession()
|
const session = await getSession()
|
||||||
console.log('session[layout]:', session)
|
console.log('session[layout]:', session)
|
||||||
|
|
||||||
@ -85,7 +77,6 @@ export default async function RootLayout({ children }) {
|
|||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<ToastContainer />
|
|
||||||
<QModal />
|
<QModal />
|
||||||
<PopupManager />
|
<PopupManager />
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@ -1,35 +0,0 @@
|
|||||||
import { toast } from 'react-toastify'
|
|
||||||
|
|
||||||
const toastDefaultOptions = {
|
|
||||||
position: 'top-right',
|
|
||||||
autoClose: 3000,
|
|
||||||
draggable: false,
|
|
||||||
hideProgressBar: false,
|
|
||||||
rtl: false,
|
|
||||||
pauseOnFocusLoss: true,
|
|
||||||
pauseOnHover: true,
|
|
||||||
theme: 'light',
|
|
||||||
limit: 2,
|
|
||||||
closeOnClick: true,
|
|
||||||
}
|
|
||||||
|
|
||||||
const toastUp = (props) => {
|
|
||||||
// type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default'
|
|
||||||
const { message, type = 'info', options } = props
|
|
||||||
const customOptions = { ...toastDefaultOptions, ...options }
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case 'info':
|
|
||||||
return toast.info(message, customOptions)
|
|
||||||
case 'success':
|
|
||||||
return toast.success(message, customOptions)
|
|
||||||
case 'warning':
|
|
||||||
return toast.warn(message, customOptions)
|
|
||||||
case 'error':
|
|
||||||
return toast.error(message, customOptions)
|
|
||||||
default:
|
|
||||||
return toast(message, customOptions)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export { toastUp }
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
import { PrismaClient } from '@prisma/client'
|
|
||||||
|
|
||||||
let prisma
|
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
|
||||||
prisma = new PrismaClient()
|
|
||||||
} else {
|
|
||||||
if (!global.prisma) {
|
|
||||||
global.prisma = new PrismaClient()
|
|
||||||
}
|
|
||||||
prisma = global.prisma
|
|
||||||
}
|
|
||||||
|
|
||||||
export default prisma
|
|
||||||
55
yarn.lock
55
yarn.lock
@ -1538,47 +1538,6 @@
|
|||||||
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
|
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
|
||||||
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
|
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
|
||||||
|
|
||||||
"@prisma/client@^5.18.0":
|
|
||||||
version "5.18.0"
|
|
||||||
resolved "https://registry.npmjs.org/@prisma/client/-/client-5.18.0.tgz"
|
|
||||||
integrity sha512-BWivkLh+af1kqC89zCJYkHsRcyWsM8/JHpsDMM76DjP3ZdEquJhXa4IeX+HkWPnwJ5FanxEJFZZDTWiDs/Kvyw==
|
|
||||||
|
|
||||||
"@prisma/debug@5.18.0":
|
|
||||||
version "5.18.0"
|
|
||||||
resolved "https://registry.npmjs.org/@prisma/debug/-/debug-5.18.0.tgz"
|
|
||||||
integrity sha512-f+ZvpTLidSo3LMJxQPVgAxdAjzv5OpzAo/eF8qZqbwvgi2F5cTOI9XCpdRzJYA0iGfajjwjOKKrVq64vkxEfUw==
|
|
||||||
|
|
||||||
"@prisma/engines-version@5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169":
|
|
||||||
version "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169"
|
|
||||||
resolved "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169.tgz"
|
|
||||||
integrity sha512-a/+LpJj8vYU3nmtkg+N3X51ddbt35yYrRe8wqHTJtYQt7l1f8kjIBcCs6sHJvodW/EK5XGvboOiwm47fmNrbgg==
|
|
||||||
|
|
||||||
"@prisma/engines@5.18.0":
|
|
||||||
version "5.18.0"
|
|
||||||
resolved "https://registry.npmjs.org/@prisma/engines/-/engines-5.18.0.tgz"
|
|
||||||
integrity sha512-ofmpGLeJ2q2P0wa/XaEgTnX/IsLnvSp/gZts0zjgLNdBhfuj2lowOOPmDcfKljLQUXMvAek3lw5T01kHmCG8rg==
|
|
||||||
dependencies:
|
|
||||||
"@prisma/debug" "5.18.0"
|
|
||||||
"@prisma/engines-version" "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169"
|
|
||||||
"@prisma/fetch-engine" "5.18.0"
|
|
||||||
"@prisma/get-platform" "5.18.0"
|
|
||||||
|
|
||||||
"@prisma/fetch-engine@5.18.0":
|
|
||||||
version "5.18.0"
|
|
||||||
resolved "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.18.0.tgz"
|
|
||||||
integrity sha512-I/3u0x2n31rGaAuBRx2YK4eB7R/1zCuayo2DGwSpGyrJWsZesrV7QVw7ND0/Suxeo/vLkJ5OwuBqHoCxvTHpOg==
|
|
||||||
dependencies:
|
|
||||||
"@prisma/debug" "5.18.0"
|
|
||||||
"@prisma/engines-version" "5.18.0-25.4c784e32044a8a016d99474bd02a3b6123742169"
|
|
||||||
"@prisma/get-platform" "5.18.0"
|
|
||||||
|
|
||||||
"@prisma/get-platform@5.18.0":
|
|
||||||
version "5.18.0"
|
|
||||||
resolved "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.18.0.tgz"
|
|
||||||
integrity sha512-Tk+m7+uhqcKDgnMnFN0lRiH7Ewea0OEsZZs9pqXa7i3+7svS3FSCqDBCaM9x5fmhhkufiG0BtunJVDka+46DlA==
|
|
||||||
dependencies:
|
|
||||||
"@prisma/debug" "5.18.0"
|
|
||||||
|
|
||||||
"@react-aria/breadcrumbs@3.5.13":
|
"@react-aria/breadcrumbs@3.5.13":
|
||||||
version "3.5.13"
|
version "3.5.13"
|
||||||
resolved "https://registry.npmjs.org/@react-aria/breadcrumbs/-/breadcrumbs-3.5.13.tgz"
|
resolved "https://registry.npmjs.org/@react-aria/breadcrumbs/-/breadcrumbs-3.5.13.tgz"
|
||||||
@ -5810,13 +5769,6 @@ prettier@^3.3.3:
|
|||||||
resolved "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz"
|
resolved "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz"
|
||||||
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
|
integrity sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==
|
||||||
|
|
||||||
prisma@^5.18.0:
|
|
||||||
version "5.18.0"
|
|
||||||
resolved "https://registry.npmjs.org/prisma/-/prisma-5.18.0.tgz"
|
|
||||||
integrity sha512-+TrSIxZsh64OPOmaSgVPH7ALL9dfU0jceYaMJXsNrTkFHO7/3RANi5K2ZiPB1De9+KDxCWn7jvRq8y8pvk+o9g==
|
|
||||||
dependencies:
|
|
||||||
"@prisma/engines" "5.18.0"
|
|
||||||
|
|
||||||
process@^0.11.10:
|
process@^0.11.10:
|
||||||
version "0.11.10"
|
version "0.11.10"
|
||||||
resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz"
|
resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz"
|
||||||
@ -5998,13 +5950,6 @@ react-textarea-autosize@^8.5.3:
|
|||||||
use-composed-ref "^1.3.0"
|
use-composed-ref "^1.3.0"
|
||||||
use-latest "^1.2.1"
|
use-latest "^1.2.1"
|
||||||
|
|
||||||
react-toastify@^10.0.5:
|
|
||||||
version "10.0.5"
|
|
||||||
resolved "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz"
|
|
||||||
integrity sha512-mNKt2jBXJg4O7pSdbNUfDdTsK9FIdikfsIE/yUCxbAEXl4HMyJaivrVFcn3Elvt5xvCQYhUZm+hqTIu1UXM3Pw==
|
|
||||||
dependencies:
|
|
||||||
clsx "^2.1.0"
|
|
||||||
|
|
||||||
react-transition-group@^4.3.0:
|
react-transition-group@^4.3.0:
|
||||||
version "4.4.5"
|
version "4.4.5"
|
||||||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
|
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user