diff --git a/package.json b/package.json
index 4dfef6dd..303e4864 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,6 @@
},
"dependencies": {
"@nextui-org/react": "^2.4.2",
- "@prisma/client": "^5.18.0",
"ag-grid-react": "^32.0.2",
"axios": "^1.7.3",
"fabric": "^5.3.0",
@@ -30,7 +29,6 @@
"react-hook-form": "^7.53.0",
"react-icons": "^5.3.0",
"react-responsive-modal": "^6.4.2",
- "react-toastify": "^10.0.5",
"recoil": "^0.7.7",
"sweetalert2": "^11.14.1",
"sweetalert2-react-content": "^5.0.7",
@@ -42,7 +40,6 @@
"dayjs": "^1.11.13",
"postcss": "^8",
"prettier": "^3.3.3",
- "prisma": "^5.18.0",
"react-color-palette": "^7.2.2",
"react-select": "^5.8.1",
"sass": "^1.77.8",
diff --git a/src/app/QcastProvider.js b/src/app/QcastProvider.js
index 84a5638e..bdaa72c6 100644
--- a/src/app/QcastProvider.js
+++ b/src/app/QcastProvider.js
@@ -1,24 +1,19 @@
'use client'
import { ErrorBoundary } from 'next/dist/client/components/error-boundary'
+import { useCommonCode } from '@/hooks/common/useCommonCode'
import ServerError from './error'
import '@/styles/common.scss'
-// import KO from '@/locales/ko.json'
-// import JA from '@/locales/ja.json'
-
export const QcastProvider = ({ children }) => {
- // const globalLocale = useRecoilValue(globalLocaleStore)
- // const [appMessageState, setAppMessageState] = useRecoilState(appMessageStore)
+ const { commonCode, findCommonCode } = useCommonCode()
// useEffect(() => {
- // if (globalLocale === 'ko') {
- // setAppMessageState(KO)
- // } else {
- // setAppMessageState(JA)
- // }
- // }, [globalLocale])
+ // console.log('commonCode', commonCode)
+ // console.log(findCommonCode(100200))
+ // console.log(findCommonCode(115800))
+ // }, [commonCode])
return (
<>
diff --git a/src/app/[locale]/LocaleProvider.js b/src/app/[locale]/LocaleProvider.js
deleted file mode 100644
index cb4aa5d6..00000000
--- a/src/app/[locale]/LocaleProvider.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use client'
-
-import { I18nProviderClient } from '@/locales/client'
-
-export function LocaleProvider({ locale, children }) {
- return (
-
- {children}
-
- )
-}
diff --git a/src/app/[locale]/community/archive/page.jsx b/src/app/[locale]/community/archive/page.jsx
deleted file mode 100644
index 6917f228..00000000
--- a/src/app/[locale]/community/archive/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
- >
- )
-}
diff --git a/src/app/[locale]/community/faq/page.jsx b/src/app/[locale]/community/faq/page.jsx
deleted file mode 100644
index 2b9d5452..00000000
--- a/src/app/[locale]/community/faq/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/community/notice/page.jsx b/src/app/[locale]/community/notice/page.jsx
deleted file mode 100644
index d2157b20..00000000
--- a/src/app/[locale]/community/notice/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/error.jsx b/src/app/[locale]/error.jsx
deleted file mode 100644
index 07d75e7e..00000000
--- a/src/app/[locale]/error.jsx
+++ /dev/null
@@ -1,15 +0,0 @@
-'use client'
-
-export default function ServerError() {
- return (
-
-
-
-
500
-
Internal Server Error.
-
We are already working to solve the problem.
-
-
-
- )
-}
diff --git a/src/app/[locale]/floor-plan/page.jsx b/src/app/[locale]/floor-plan/page.jsx
deleted file mode 100644
index f503099e..00000000
--- a/src/app/[locale]/floor-plan/page.jsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import FloorPlan from '@/components/floor-plan/FloorPlan'
-
-export default function FloorPlanPage() {
- return (
- <>
-
- >
- )
-}
diff --git a/src/app/[locale]/initSettingsModal/page.jsx b/src/app/[locale]/initSettingsModal/page.jsx
deleted file mode 100644
index a081ef47..00000000
--- a/src/app/[locale]/initSettingsModal/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/intro/page.jsx b/src/app/[locale]/intro/page.jsx
deleted file mode 100644
index 8d560ce5..00000000
--- a/src/app/[locale]/intro/page.jsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import Intro from '@/components/Intro'
-import { initCheck } from '@/util/session-util'
-
-export default async function IntroPage() {
- await initCheck()
-
- return (
- <>
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/join/complete/page.jsx b/src/app/[locale]/join/complete/page.jsx
deleted file mode 100644
index 3f9fc462..00000000
--- a/src/app/[locale]/join/complete/page.jsx
+++ /dev/null
@@ -1,19 +0,0 @@
-'use client'
-
-import { useMessage } from '@/hooks/useMessage'
-
-export default function CompletePage() {
- const { getMessage } = useMessage()
-
- return (
- <>
-
-
{getMessage('join.complete.title')}
-
{getMessage('join.complete.contents')}
-
- {getMessage('join.complete.email_comment')} : {getMessage('join.complete.email')}
-
-
- >
- )
-}
diff --git a/src/app/[locale]/join/page.jsx b/src/app/[locale]/join/page.jsx
deleted file mode 100644
index 118a25b4..00000000
--- a/src/app/[locale]/join/page.jsx
+++ /dev/null
@@ -1,5 +0,0 @@
-import Join from '@/components/auth/Join'
-
-export default function JoinPage() {
- return <>{}>
-}
diff --git a/src/app/[locale]/layout.js b/src/app/[locale]/layout.js
deleted file mode 100644
index 018f1ef5..00000000
--- a/src/app/[locale]/layout.js
+++ /dev/null
@@ -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 (
- <>
- }>
- }>
- {children}
-
-
- >
- )
-}
diff --git a/src/app/[locale]/login/page.jsx b/src/app/[locale]/login/page.jsx
deleted file mode 100644
index 47a23986..00000000
--- a/src/app/[locale]/login/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
- >
- )
-}
diff --git a/src/app/[locale]/management/plan/page.jsx b/src/app/[locale]/management/plan/page.jsx
deleted file mode 100644
index 5fefa62a..00000000
--- a/src/app/[locale]/management/plan/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
- >
- )
-}
diff --git a/src/app/[locale]/management/stuff/detail/page.jsx b/src/app/[locale]/management/stuff/detail/page.jsx
deleted file mode 100644
index 6759b282..00000000
--- a/src/app/[locale]/management/stuff/detail/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
물건정보
-
- 도면작성
-
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/management/stuff/page.jsx b/src/app/[locale]/management/stuff/page.jsx
deleted file mode 100644
index 7590a7cf..00000000
--- a/src/app/[locale]/management/stuff/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/management/stuff/tempdetail/page.jsx b/src/app/[locale]/management/stuff/tempdetail/page.jsx
deleted file mode 100644
index 8b84287a..00000000
--- a/src/app/[locale]/management/stuff/tempdetail/page.jsx
+++ /dev/null
@@ -1,15 +0,0 @@
-import React from 'react'
-import Hero from '@/components/Hero'
-import StuffDetail from '@/components/management/StuffDetail'
-export default function ManagementStuffDetailPage() {
- return (
- <>
-
-
물건정보
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/master/company/page.jsx b/src/app/[locale]/master/company/page.jsx
deleted file mode 100644
index 15eda41c..00000000
--- a/src/app/[locale]/master/company/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/master/price/page.jsx b/src/app/[locale]/master/price/page.jsx
deleted file mode 100644
index a641d6bb..00000000
--- a/src/app/[locale]/master/price/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
- >
- )
-}
diff --git a/src/app/[locale]/not-found.jsx b/src/app/[locale]/not-found.jsx
deleted file mode 100644
index 8127943b..00000000
--- a/src/app/[locale]/not-found.jsx
+++ /dev/null
@@ -1,25 +0,0 @@
-'use client'
-
-import Link from 'next/link'
-
-export default function NotFound() {
- return (
-
-
-
-
404
-
Something's missing.
-
- Sorry, we can't find that page. You'll find lots to explore on the home page.{' '}
-
-
- Back to Homepage
-
-
-
-
- )
-}
diff --git a/src/app/[locale]/page.js b/src/app/[locale]/page.js
deleted file mode 100644
index 1b8f2258..00000000
--- a/src/app/[locale]/page.js
+++ /dev/null
@@ -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 (
- <>
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/playground/page.jsx b/src/app/[locale]/playground/page.jsx
deleted file mode 100644
index 66d83c34..00000000
--- a/src/app/[locale]/playground/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
- >
- )
-}
diff --git a/src/app/[locale]/roof/page.jsx b/src/app/[locale]/roof/page.jsx
deleted file mode 100644
index f5b8e611..00000000
--- a/src/app/[locale]/roof/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/roof2/RoofSelect.jsx b/src/app/[locale]/roof2/RoofSelect.jsx
deleted file mode 100644
index d759398b..00000000
--- a/src/app/[locale]/roof2/RoofSelect.jsx
+++ /dev/null
@@ -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 (
-
- {roofMaterials.length > 0 && (
-
- )}
- {manufacturers.length > 0 && (
-
- )}
- {trestles.length > 0 && (
-
- )}
- {modules.length > 0 && (
-
- )}
-
- )
-}
diff --git a/src/app/[locale]/roof2/page.jsx b/src/app/[locale]/roof2/page.jsx
deleted file mode 100644
index 72881d11..00000000
--- a/src/app/[locale]/roof2/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/[locale]/settings/page.jsx b/src/app/[locale]/settings/page.jsx
deleted file mode 100644
index 797c024c..00000000
--- a/src/app/[locale]/settings/page.jsx
+++ /dev/null
@@ -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 (
- <>
-
-
-
-
- >
- )
-}
diff --git a/src/app/community/archive/page.jsx b/src/app/community/archive/page.jsx
index 308e02f3..eee23c36 100644
--- a/src/app/community/archive/page.jsx
+++ b/src/app/community/archive/page.jsx
@@ -1,10 +1,7 @@
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 (
<>
diff --git a/src/app/community/faq/page.jsx b/src/app/community/faq/page.jsx
index 054f9007..cf1c1941 100644
--- a/src/app/community/faq/page.jsx
+++ b/src/app/community/faq/page.jsx
@@ -1,9 +1,6 @@
import Faq from '@/components/community/Faq'
-import { initCheck } from '@/util/session-util'
export default async function CommunityFaqPage() {
- await initCheck()
-
return (
<>
diff --git a/src/app/community/notice/page.jsx b/src/app/community/notice/page.jsx
index a3453e64..c6d407e2 100644
--- a/src/app/community/notice/page.jsx
+++ b/src/app/community/notice/page.jsx
@@ -1,9 +1,6 @@
import Notice from '@/components/community/Notice'
-import { initCheck } from '@/util/session-util'
export default async function CommunityNoticePage() {
- await initCheck()
-
return (
<>
diff --git a/src/app/initSettingsModal/page.jsx b/src/app/initSettingsModal/page.jsx
index a081ef47..fc51b5cc 100644
--- a/src/app/initSettingsModal/page.jsx
+++ b/src/app/initSettingsModal/page.jsx
@@ -1,10 +1,7 @@
import Hero from '@/components/Hero'
import InitSettingsModal from '@/components/InitSettingsModal'
-import { initCheck } from '@/util/session-util'
export default async function InitSettingsModalPage() {
- await initCheck()
-
return (
<>
diff --git a/src/app/intro/page.jsx b/src/app/intro/page.jsx
index 8d560ce5..ebf1081b 100644
--- a/src/app/intro/page.jsx
+++ b/src/app/intro/page.jsx
@@ -2,8 +2,6 @@ import Intro from '@/components/Intro'
import { initCheck } from '@/util/session-util'
export default async function IntroPage() {
- await initCheck()
-
return (
<>
diff --git a/src/app/layout.js b/src/app/layout.js
index 64b374e8..32803812 100644
--- a/src/app/layout.js
+++ b/src/app/layout.js
@@ -1,24 +1,19 @@
-// import { Inter } from 'next/font/google'
-
import { headers } from 'next/headers'
import { redirect } from 'next/navigation'
import { getSession } from '@/lib/authActions'
import RecoilRootWrapper from './RecoilWrapper'
-import { ToastContainer } from 'react-toastify'
-
import { QcastProvider } from './QcastProvider'
import Header from '@/components/header/Header'
import QModal from '@/components/common/modal/QModal'
+import Dimmed from '@/components/ui/Dimmed'
+import SessionProvider from './SessionProvider'
+import LocaleSwitch from '@/components/LocaleSwitch'
+import PopupManager from '@/components/common/popupManager/PopupManager'
import './globals.css'
import '../styles/style.scss'
import '../styles/contents.scss'
-import Dimmed from '@/components/ui/Dimmed'
-import SessionProvider from './SessionProvider'
-import LocaleSwitch from '@/components/LocaleSwitch'
-
-// const inter = Inter({ subsets: ['latin'] })
export const metadata = {
title: 'Create Next App',
@@ -29,8 +24,6 @@ export default async function RootLayout({ children }) {
const headersList = headers()
const headerPathname = headersList.get('x-pathname') || ''
- // console.log('headerPathname:', headerPathname)
- // const isLoggedIn = await checkSession()
const session = await getSession()
console.log('session[layout]:', session)
@@ -84,8 +77,8 @@ export default async function RootLayout({ children }) {
)}
-
+