From 00719abb5dd48a6453af0b417d48abb00fc43905 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Tue, 13 Jun 2023 20:59:07 +0800 Subject: [PATCH] feat: add some folders --- .env.example | 2 ++ .gitignore | 2 ++ app/chat/@content/page.tsx | 6 ++++++ .../style.module.scss} | 0 app/chat/@sidebar/page.tsx | 6 ++++++ app/chat/@sidebar/style.module.scss | 0 app/chat/layout.tsx | 18 ++++++++++++++++++ app/chat/page.tsx | 6 ------ app/chat/style.module.scss | 9 +++++++++ 9 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 .env.example create mode 100644 app/chat/@content/page.tsx rename app/chat/{style.module.css => @content/style.module.scss} (100%) create mode 100644 app/chat/@sidebar/page.tsx create mode 100644 app/chat/@sidebar/style.module.scss create mode 100644 app/chat/layout.tsx delete mode 100644 app/chat/page.tsx create mode 100644 app/chat/style.module.scss diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d32b8df --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +# you can find this in https://cloud.dify.ai/ +API_SECRET=YOUR_API_SECRET diff --git a/.gitignore b/.gitignore index 8f322f0..93c57fb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +.env diff --git a/app/chat/@content/page.tsx b/app/chat/@content/page.tsx new file mode 100644 index 0000000..3028e8e --- /dev/null +++ b/app/chat/@content/page.tsx @@ -0,0 +1,6 @@ +const Content = async () => { + await new Promise((resolve) => setTimeout(resolve, 1000)) + return
Content
+} + +export default Content diff --git a/app/chat/style.module.css b/app/chat/@content/style.module.scss similarity index 100% rename from app/chat/style.module.css rename to app/chat/@content/style.module.scss diff --git a/app/chat/@sidebar/page.tsx b/app/chat/@sidebar/page.tsx new file mode 100644 index 0000000..23b0702 --- /dev/null +++ b/app/chat/@sidebar/page.tsx @@ -0,0 +1,6 @@ +const Sidebar = async () => { + await new Promise((resolve) => setTimeout(resolve, 2000)) + return
Sidebar
+} + +export default Sidebar diff --git a/app/chat/@sidebar/style.module.scss b/app/chat/@sidebar/style.module.scss new file mode 100644 index 0000000..e69de29 diff --git a/app/chat/layout.tsx b/app/chat/layout.tsx new file mode 100644 index 0000000..eff0b59 --- /dev/null +++ b/app/chat/layout.tsx @@ -0,0 +1,18 @@ +import styles from './style.module.scss' +import { Suspense } from 'react' +import Loading from '../loading' +export default function Layout(props: { + sidebar: React.ReactNode + content: React.ReactNode +}) { + return ( +
+
+ }>{props.sidebar} +
+
+ }>{props.content} +
+
+ ) +} diff --git a/app/chat/page.tsx b/app/chat/page.tsx deleted file mode 100644 index 0e0f617..0000000 --- a/app/chat/page.tsx +++ /dev/null @@ -1,6 +0,0 @@ -const Home = async () => { - await new Promise((resolve) => setTimeout(resolve, 1000)) - return
Chat
-} - -export default Home diff --git a/app/chat/style.module.scss b/app/chat/style.module.scss new file mode 100644 index 0000000..be1e17f --- /dev/null +++ b/app/chat/style.module.scss @@ -0,0 +1,9 @@ +.main { + @apply flex; + .sidebar_wrapper { + @apply flex w-40 md:w-32 lg:w-40 shrink-0; + } + .content_wrapper { + @apply flex w-full; + } +}