@lobehub/chat 0.151.6 → 0.151.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/locales/ar/error.json +11 -0
  3. package/locales/bg-BG/error.json +11 -0
  4. package/locales/de-DE/error.json +11 -0
  5. package/locales/en-US/error.json +11 -0
  6. package/locales/es-ES/error.json +11 -0
  7. package/locales/fr-FR/error.json +11 -0
  8. package/locales/it-IT/error.json +11 -0
  9. package/locales/ja-JP/error.json +11 -0
  10. package/locales/ko-KR/error.json +11 -0
  11. package/locales/nl-NL/error.json +11 -0
  12. package/locales/pl-PL/error.json +11 -0
  13. package/locales/pt-BR/error.json +11 -0
  14. package/locales/ru-RU/error.json +11 -0
  15. package/locales/tr-TR/error.json +11 -0
  16. package/locales/vi-VN/error.json +11 -0
  17. package/locales/zh-CN/error.json +11 -0
  18. package/locales/zh-TW/error.json +11 -0
  19. package/package.json +1 -1
  20. package/src/{layout/DefaultLayout/Desktop/SideBar → app/(main)/@nav/_layout/Desktop}/index.tsx +9 -6
  21. package/src/app/(main)/@nav/_layout/Mobile.tsx +71 -0
  22. package/src/app/(main)/@nav/default.tsx +10 -0
  23. package/src/app/(main)/_layout/Desktop.tsx +33 -0
  24. package/src/app/(main)/_layout/Mobile.tsx +24 -0
  25. package/src/app/(main)/_layout/type.ts +6 -0
  26. package/src/app/(main)/chat/(mobile)/features/ChatInput/index.tsx +1 -1
  27. package/src/app/(main)/chat/(mobile)/index.tsx +4 -3
  28. package/src/app/(main)/chat/(mobile)/mobile/ChatHeader/index.tsx +1 -0
  29. package/src/app/(main)/chat/(mobile)/mobile/page.tsx +6 -9
  30. package/src/app/(main)/chat/settings/(mobile)/index.tsx +4 -3
  31. package/src/app/(main)/error.tsx +5 -0
  32. package/src/app/(main)/layout.tsx +11 -0
  33. package/src/app/(main)/market/_layout/Mobile/index.tsx +6 -8
  34. package/src/app/(main)/market/features/AgentSearchBar/index.tsx +15 -12
  35. package/src/app/(main)/not-found.tsx +3 -0
  36. package/src/app/(main)/settings/_layout/Mobile/index.tsx +3 -3
  37. package/src/app/error.tsx +5 -0
  38. package/src/app/global-error.tsx +20 -0
  39. package/src/app/layout.tsx +1 -4
  40. package/src/app/not-found.tsx +3 -0
  41. package/src/app/page.tsx +2 -0
  42. package/src/components/404/index.tsx +43 -0
  43. package/src/components/Error/index.tsx +58 -0
  44. package/src/components/Error/sentryCaptureException.ts +11 -0
  45. package/src/components/server/MobileNavLayout.tsx +60 -0
  46. package/src/components/server/ServerLayout.tsx +6 -7
  47. package/src/config/client.ts +3 -0
  48. package/src/database/client/models/__tests__/sessionGroup.test.ts +18 -0
  49. package/src/features/Conversation/index.tsx +3 -3
  50. package/src/locales/default/error.ts +12 -0
  51. package/src/styles/mobileHeader.ts +1 -0
  52. package/src/layout/DefaultLayout/Desktop/index.tsx +0 -32
  53. package/src/layout/DefaultLayout/Mobile/index.tsx +0 -59
  54. package/src/layout/DefaultLayout/index.ts +0 -2
  55. package/src/layout/routes/Desktop.tsx +0 -18
  56. package/src/layout/routes/Mobile.tsx +0 -24
  57. package/src/layout/routes/index.tsx +0 -8
  58. /package/src/{layout/DefaultLayout/Desktop/SideBar → app/(main)/@nav/_layout/Desktop}/Avatar.tsx +0 -0
  59. /package/src/{layout/DefaultLayout/Desktop/SideBar → app/(main)/@nav/_layout/Desktop}/BottomActions.tsx +0 -0
  60. /package/src/{layout/DefaultLayout/Desktop/SideBar → app/(main)/@nav/_layout/Desktop}/TopActions.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.151.8](https://github.com/lobehub/lobe-chat/compare/v0.151.7...v0.151.8)
6
+
7
+ <sup>Released on **2024-04-30**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Move NavBar to `[@nav](https://github.com/nav)` slot route.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Move NavBar to `[@nav](https://github.com/nav)` slot route, closes [#2306](https://github.com/lobehub/lobe-chat/issues/2306) ([aee7231](https://github.com/lobehub/lobe-chat/commit/aee7231))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 0.151.7](https://github.com/lobehub/lobe-chat/compare/v0.151.6...v0.151.7)
31
+
32
+ <sup>Released on **2024-04-30**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Add 404 and Error page.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Add 404 and Error page, closes [#2299](https://github.com/lobehub/lobe-chat/issues/2299) ([938a3e9](https://github.com/lobehub/lobe-chat/commit/938a3e9))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 0.151.6](https://github.com/lobehub/lobe-chat/compare/v0.151.5...v0.151.6)
6
56
 
7
57
  <sup>Released on **2024-04-30**</sup>
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "العودة إلى الصفحة الرئيسية",
4
+ "desc": "حاول مرة أخرى في وقت لاحق، أو عد إلى العالم المألوف",
5
+ "retry": "إعادة التحميل",
6
+ "title": "واجهت الصفحة مشكلة ما.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "العودة إلى الصفحة الرئيسية",
10
+ "desc": "لم نتمكن من العثور على الصفحة التي تبحث عنها، يرجى التحقق مما إذا كان الرابط صحيحًا",
11
+ "title": "هل دخلت إلى مجال غير معروف؟"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "أكمل الإعدادات التالية لبدء استخدام هذا المكون الإضافي",
4
15
  "title": "تكوين مكون الإضافة {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Върни се в началото",
4
+ "desc": "Опитайте отново по-късно или се върнете в познатия свят",
5
+ "retry": "Опитай отново",
6
+ "title": "Страницата се е сблъскала с проблем.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Върни се в началото",
10
+ "desc": "Не можем да намерим страницата, която търсите. Моля, проверете дали връзката е правилна.",
11
+ "title": "Влезли сте в неизвестна територия?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Попълнете следната конфигурация, за да започнете да използвате този плъгин",
4
15
  "title": "Настройки на плъгина {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Zurück zur Startseite",
4
+ "desc": "Versuchen Sie es später erneut oder kehren Sie in die bekannte Welt zurück",
5
+ "retry": "Erneut laden",
6
+ "title": "Ein Problem ist aufgetreten auf der Seite.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Zurück zur Startseite",
10
+ "desc": "Die von Ihnen gesuchte Seite konnte nicht gefunden werden. Bitte überprüfen Sie, ob der Link korrekt ist.",
11
+ "title": "In unbekanntes Gebiet geraten?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Führen Sie die folgende Konfiguration durch, um das Plugin zu verwenden",
4
15
  "title": "{{name}} Plugin-Konfiguration"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Back to Home",
4
+ "desc": "Give it a try later, or go back to the known world.",
5
+ "retry": "Reload",
6
+ "title": "Oops, something went wrong.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Back to Home",
10
+ "desc": "We couldn't find the page you're looking for, please check if the link is correct",
11
+ "title": "Entered Unknown Territory?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Complete the following configuration to start using this plugin",
4
15
  "title": "{{name}} Plugin Settings"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Volver a la página de inicio",
4
+ "desc": "Inténtalo de nuevo más tarde, o regresa al mundo conocido",
5
+ "retry": "Reintentar",
6
+ "title": "Se ha producido un problema en la página.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Volver a la página de inicio",
10
+ "desc": "No podemos encontrar la página que estás buscando, por favor verifica si el enlace es correcto",
11
+ "title": "¿Has entrado en un área desconocida?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Complete la siguiente configuración para comenzar a usar este complemento",
4
15
  "title": "Configuración del complemento {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Retour à la page d'accueil",
4
+ "desc": "Réessayez plus tard, ou retournez au monde connu",
5
+ "retry": "Recharger",
6
+ "title": "Un problème est survenu sur la page.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Retour à la page d'accueil",
10
+ "desc": "La page que vous recherchez est introuvable. Veuillez vérifier si le lien est correct.",
11
+ "title": "Êtes-vous entré dans un domaine inconnu ?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Completez la configuration suivante pour commencer à utiliser ce plugin",
4
15
  "title": "Configuration du plugin {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Torna alla homepage",
4
+ "desc": "Prova di nuovo più tardi, o torna al mondo conosciuto",
5
+ "retry": "Ricarica",
6
+ "title": "La pagina ha riscontrato un problema.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Torna alla homepage",
10
+ "desc": "Non riusciamo a trovare la pagina che stai cercando, controlla che il link sia corretto",
11
+ "title": "Hai raggiunto un territorio sconosciuto?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Completa la seguente configurazione per iniziare a utilizzare il plugin",
4
15
  "title": "Configurazione del plugin {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "ホームに戻る",
4
+ "desc": "後で試してみるか、既知の世界に戻る",
5
+ "retry": "再読み込み",
6
+ "title": "ページに問題が発生しました.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "ホームに戻る",
10
+ "desc": "お探しのページが見つかりません。リンクが正しいかどうかをご確認ください",
11
+ "title": "未知の領域に入りましたか?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "以下の設定を完了すると、プラグインを使用することができます",
4
15
  "title": "{{name}} プラグイン設定"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "홈페이지로 돌아가기",
4
+ "desc": "잠시 후 다시 시도하거나 익숙한 세계로 돌아가세요",
5
+ "retry": "다시 시도",
6
+ "title": "페이지에서 문제가 발생했습니다."
7
+ },
8
+ "notFound": {
9
+ "backHome": "홈페이지로 돌아가기",
10
+ "desc": "찾고 있는 페이지를 찾을 수 없습니다. 링크가 올바른지 확인해주세요.",
11
+ "title": "알 수 없는 영역에 들어갔나요?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "다음 구성을 완료하면 플러그인을 사용할 수 있습니다.",
4
15
  "title": "{{name}} 플러그인 설정"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Terug naar startpagina",
4
+ "desc": "Probeer het later opnieuw of keer terug naar de bekende wereld",
5
+ "retry": "Opnieuw proberen",
6
+ "title": "Er is een probleem opgetreden op de pagina.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Terug naar startpagina",
10
+ "desc": "We kunnen de pagina die je zoekt niet vinden, controleer of de link juist is",
11
+ "title": "Betreden onbekend terrein?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Voltooi de volgende instellingen om de plugin te gebruiken",
4
15
  "title": "{{name}} Plugin Instellingen"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Powrót do strony głównej",
4
+ "desc": "Spróbuj ponownie później lub wróć do znanego świata",
5
+ "retry": "Ponów próbę",
6
+ "title": "Napotkano problem na stronie.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Powrót do strony głównej",
10
+ "desc": "Nie możemy odnaleźć strony, której szukasz. Sprawdź, czy link jest poprawny.",
11
+ "title": "Wkraczasz w nieznane terytorium?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Wykonaj poniższą konfigurację, aby rozpocząć korzystanie z tego wtyczki",
4
15
  "title": "Konfiguracja wtyczki {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Voltar para a página inicial",
4
+ "desc": "Tente novamente mais tarde, ou retorne ao mundo conhecido",
5
+ "retry": "Tentar novamente",
6
+ "title": "Ocorreu um problema na página.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Voltar para a página inicial",
10
+ "desc": "Não conseguimos encontrar a página que você está procurando, por favor, verifique se o link está correto",
11
+ "title": "Entrou em um território desconhecido?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Complete a seguinte configuração para começar a usar este plugin",
4
15
  "title": "Configuração do plugin {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Вернуться на главную",
4
+ "desc": "Попробуйте позже или вернитесь в знакомый мир",
5
+ "retry": "Повторить попытку",
6
+ "title": "Произошла проблема на странице.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Вернуться на главную",
10
+ "desc": "Мы не можем найти страницу, которую вы ищете. Пожалуйста, проверьте правильность ссылки",
11
+ "title": "Заблудились в неизведанных местах?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Чтобы начать использовать этот плагин, выполните следующую конфигурацию",
4
15
  "title": "{{name}} Настройки плагина"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Ana Sayfaya Dön",
4
+ "desc": "Biraz sonra tekrar deneyin veya bilinen dünyaya geri dönün",
5
+ "retry": "Yeniden Yükle",
6
+ "title": "Sayfa bir sorunla karşılaştı.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Ana Sayfaya Dön",
10
+ "desc": "Aradığınız sayfayı bulamadık, lütfen bağlantının doğru olduğundan emin olun",
11
+ "title": "Bilinmeyen bir alana mı girdiniz?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Bu eklentiyi kullanmaya başlamak için aşağıdaki yapılandırmayı tamamlayın",
4
15
  "title": "{{name}} Eklenti Ayarları"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "Quay về Trang chủ",
4
+ "desc": "Hãy thử lại sau, hoặc quay về thế giới đã biết",
5
+ "retry": "Thử lại",
6
+ "title": "Trang gặp một chút vấn đề.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "Quay về Trang chủ",
10
+ "desc": "Chúng tôi không thể tìm thấy trang bạn đang tìm, vui lòng kiểm tra xem liên kết có đúng không",
11
+ "title": "Bước vào vùng đất chưa biết?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "Hoàn thành cấu hình sau để bắt đầu sử dụng plugin này",
4
15
  "title": "Cấu hình Plugin {{name}}"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "返回首页",
4
+ "desc": "待会来试试,或者回到已知的世界",
5
+ "retry": "重新加载",
6
+ "title": "页面遇到一点问题.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "返回首页",
10
+ "desc": "我们找不到你正在寻找的页面,请检查链接是否正确",
11
+ "title": "进入了未知领域?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "完成以下配置,即可开始使用该插件",
4
15
  "title": "{{name}} 插件配置"
@@ -1,4 +1,15 @@
1
1
  {
2
+ "error": {
3
+ "backHome": "返回首頁",
4
+ "desc": "待會再試試,或者回到已知的世界",
5
+ "retry": "重新加載",
6
+ "title": "頁面遇到一點問題.."
7
+ },
8
+ "notFound": {
9
+ "backHome": "返回首頁",
10
+ "desc": "我們找不到您正在尋找的頁面,請檢查連結是否正確",
11
+ "title": "進入了未知領域?"
12
+ },
2
13
  "pluginSettings": {
3
14
  "desc": "完成以下設定後,即可開始使用此外掛",
4
15
  "title": "{{name}} 插件設定"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.151.6",
3
+ "version": "0.151.8",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -1,17 +1,16 @@
1
+ 'use client';
2
+
1
3
  import { SideNav } from '@lobehub/ui';
2
4
  import { memo } from 'react';
3
5
 
4
- import { SidebarTabKey } from '@/store/global/initialState';
6
+ import { useActiveTabKey } from '@/hooks/useActiveTabKey';
5
7
 
6
8
  import Avatar from './Avatar';
7
9
  import BottomActions from './BottomActions';
8
10
  import TopActions from './TopActions';
9
11
 
10
- interface Props {
11
- sidebarKey?: SidebarTabKey;
12
- }
13
-
14
- export default memo<Props>(({ sidebarKey }) => {
12
+ const Nav = memo(() => {
13
+ const sidebarKey = useActiveTabKey();
15
14
  return (
16
15
  <SideNav
17
16
  avatar={<Avatar />}
@@ -21,3 +20,7 @@ export default memo<Props>(({ sidebarKey }) => {
21
20
  />
22
21
  );
23
22
  });
23
+
24
+ Nav.displayName = 'DesktopNav';
25
+
26
+ export default Nav;
@@ -0,0 +1,71 @@
1
+ 'use client';
2
+
3
+ import { Icon, MobileTabBar, type MobileTabBarProps } from '@lobehub/ui';
4
+ import { createStyles } from 'antd-style';
5
+ import { Bot, MessageSquare, User } from 'lucide-react';
6
+ import { useRouter } from 'next/navigation';
7
+ import { rgba } from 'polished';
8
+ import { memo, useMemo } from 'react';
9
+ import { useTranslation } from 'react-i18next';
10
+
11
+ import { useActiveTabKey } from '@/hooks/useActiveTabKey';
12
+ import { SidebarTabKey } from '@/store/global/initialState';
13
+
14
+ const useStyles = createStyles(({ css, token }) => ({
15
+ active: css`
16
+ svg {
17
+ fill: ${rgba(token.colorPrimary, 0.33)};
18
+ }
19
+ `,
20
+ container: css`
21
+ position: fixed;
22
+ z-index: 100;
23
+ right: 0;
24
+ bottom: 0;
25
+ left: 0;
26
+ `,
27
+ }));
28
+
29
+ const Nav = memo(() => {
30
+ const { t } = useTranslation('common');
31
+ const { styles } = useStyles();
32
+ const activeKey = useActiveTabKey();
33
+ const router = useRouter();
34
+ const items: MobileTabBarProps['items'] = useMemo(
35
+ () => [
36
+ {
37
+ icon: (active) => (
38
+ <Icon className={active ? styles.active : undefined} icon={MessageSquare} />
39
+ ),
40
+ key: SidebarTabKey.Chat,
41
+ onClick: () => {
42
+ router.push('/chat');
43
+ },
44
+ title: t('tab.chat'),
45
+ },
46
+ {
47
+ icon: (active) => <Icon className={active ? styles.active : undefined} icon={Bot} />,
48
+ key: SidebarTabKey.Market,
49
+ onClick: () => {
50
+ router.push('/market');
51
+ },
52
+ title: t('tab.market'),
53
+ },
54
+ {
55
+ icon: (active) => <Icon className={active ? styles.active : undefined} icon={User} />,
56
+ key: SidebarTabKey.Setting,
57
+ onClick: () => {
58
+ router.push('/settings');
59
+ },
60
+ title: t('tab.setting'),
61
+ },
62
+ ],
63
+ [t],
64
+ );
65
+
66
+ return <MobileTabBar activeKey={activeKey} className={styles.container} items={items} safeArea />;
67
+ });
68
+
69
+ Nav.displayName = 'MobileNav';
70
+
71
+ export default Nav;
@@ -0,0 +1,10 @@
1
+ import ServerLayout from '@/components/server/ServerLayout';
2
+
3
+ import Desktop from './_layout/Desktop';
4
+ import Mobile from './_layout/Mobile';
5
+
6
+ const Nav = ServerLayout({ Desktop, Mobile });
7
+
8
+ Nav.displayName = 'Nav';
9
+
10
+ export default Nav;
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+
3
+ import { useTheme } from 'antd-style';
4
+ import { memo } from 'react';
5
+ import { Flexbox } from 'react-layout-kit';
6
+
7
+ import { useIsPWA } from '@/hooks/useIsPWA';
8
+
9
+ import { LayoutProps } from './type';
10
+
11
+ const Layout = memo<LayoutProps>(({ children, nav }) => {
12
+ const isPWA = useIsPWA();
13
+ const theme = useTheme();
14
+
15
+ return (
16
+ <Flexbox
17
+ height={'100%'}
18
+ horizontal
19
+ style={{
20
+ borderTop: isPWA ? `1px solid ${theme.colorBorder}` : undefined,
21
+ position: 'relative',
22
+ }}
23
+ width={'100%'}
24
+ >
25
+ {nav}
26
+ {children}
27
+ </Flexbox>
28
+ );
29
+ });
30
+
31
+ Layout.displayName = 'DesktopMainLayout';
32
+
33
+ export default Layout;
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+
3
+ import { usePathname } from 'next/navigation';
4
+ import { memo } from 'react';
5
+
6
+ import { LayoutProps } from './type';
7
+
8
+ const MOBILE_IGNORE_NAV_ROUTES = ['/settings/', '/chat/'];
9
+
10
+ const Layout = memo(({ children, nav }: LayoutProps) => {
11
+ const pathname = usePathname();
12
+ const hideNav = MOBILE_IGNORE_NAV_ROUTES.some((path) => pathname.startsWith(path));
13
+
14
+ return (
15
+ <>
16
+ {children}
17
+ {!hideNav && nav}
18
+ </>
19
+ );
20
+ });
21
+
22
+ Layout.displayName = 'MobileMainLayout';
23
+
24
+ export default Layout;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface LayoutProps {
4
+ children: ReactNode;
5
+ nav: ReactNode;
6
+ }
@@ -27,7 +27,7 @@ const ChatInputMobileLayout = memo(() => {
27
27
  setExpand={setExpand}
28
28
  style={{
29
29
  background: `linear-gradient(to bottom, ${theme.colorFillQuaternary}, transparent)`,
30
- width: '100vw',
30
+ width: '100%',
31
31
  }}
32
32
  textAreaLeftAddons={<STT mobile />}
33
33
  textAreaRightAddons={
@@ -3,6 +3,8 @@
3
3
  import { useRouter } from 'next/navigation';
4
4
  import { memo, useEffect } from 'react';
5
5
 
6
+ import MobileContentLayout from '@/components/server/MobileNavLayout';
7
+
6
8
  import SessionHeader from './features/SessionHeader';
7
9
  import SessionList from './features/SessionList';
8
10
 
@@ -15,10 +17,9 @@ const ChatMobilePage = memo(() => {
15
17
  }, []);
16
18
 
17
19
  return (
18
- <>
19
- <SessionHeader />
20
+ <MobileContentLayout header={<SessionHeader />} withNav>
20
21
  <SessionList />
21
- </>
22
+ </MobileContentLayout>
22
23
  );
23
24
  });
24
25
 
@@ -48,6 +48,7 @@ const MobileHeader = memo(() => {
48
48
  </>
49
49
  }
50
50
  showBackButton
51
+ style={{ width: '100%' }}
51
52
  />
52
53
  );
53
54
  });
@@ -2,8 +2,8 @@
2
2
 
3
3
  import dynamic from 'next/dynamic';
4
4
  import { memo } from 'react';
5
- import { Flexbox } from 'react-layout-kit';
6
5
 
6
+ import MobileContentLayout from '@/components/server/MobileNavLayout';
7
7
  import Conversation from '@/features/Conversation';
8
8
 
9
9
  import SessionHydration from '../../components/SessionHydration';
@@ -15,15 +15,12 @@ const TopicList = dynamic(() => import('../features/TopicList'));
15
15
 
16
16
  const Chat = memo(() => {
17
17
  return (
18
- <>
19
- <ChatHeader />
20
- <Flexbox height={'calc(100% - 44px)'} horizontal>
21
- <Conversation chatInput={<ChatInput />} mobile />
22
- <TopicList />
23
- <TelemetryNotification mobile />
24
- </Flexbox>
18
+ <MobileContentLayout header={<ChatHeader />}>
19
+ <Conversation chatInput={<ChatInput />} mobile />
20
+ <TopicList />
21
+ <TelemetryNotification mobile />
25
22
  <SessionHydration />
26
- </>
23
+ </MobileContentLayout>
27
24
  );
28
25
  });
29
26
  export default Chat;
@@ -2,14 +2,15 @@
2
2
 
3
3
  import { memo } from 'react';
4
4
 
5
+ import MobileContentLayout from '@/components/server/MobileNavLayout';
6
+
5
7
  import EditPage from '../features/EditPage';
6
8
  import Header from './Header';
7
9
 
8
10
  const ChatSettings = memo(() => (
9
- <>
10
- <Header />
11
+ <MobileContentLayout header={<Header />} withNav={false}>
11
12
  <EditPage />
12
- </>
13
+ </MobileContentLayout>
13
14
  ));
14
15
 
15
16
  export default ChatSettings;
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+
3
+ import dynamic from 'next/dynamic';
4
+
5
+ export default dynamic(() => import('@/components/Error'));
@@ -0,0 +1,11 @@
1
+ import ServerLayout from '@/components/server/ServerLayout';
2
+
3
+ import Desktop from './_layout/Desktop';
4
+ import Mobile from './_layout/Mobile';
5
+ import { LayoutProps } from './_layout/type';
6
+
7
+ const MainLayout = ServerLayout<LayoutProps>({ Desktop, Mobile });
8
+
9
+ MainLayout.displayName = 'MainLayout';
10
+
11
+ export default MainLayout;