From 93ce01051c5d0e5169ef23c4493dc95398f1a5e5 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Thu, 30 May 2024 18:14:16 +0700 Subject: [PATCH] fix: wrong direction icon collapse right panel (#2967) * fix: wrong direction icon collapse right panel * fix: add back social icon * fix: modal troubleshoot * fix: shadow transparent theme * fix: enable nitro_tensorrt_llm * fix: disabled model dropdown when local server running --- electron/utils/setup.ts | 2 +- joi/src/core/Modal/styles.scss | 1 + joi/src/core/ScrollArea/index.tsx | 8 +++- web/app/layout.tsx | 2 +- web/containers/CenterPanelContainer/index.tsx | 2 +- web/containers/Layout/BottomPanel/index.tsx | 40 +++++++++++++++++++ web/containers/Layout/TopPanel/index.tsx | 4 +- web/containers/ModalTroubleShoot/AppLogs.tsx | 2 +- .../ModalTroubleShoot/DeviceSpecs.tsx | 2 +- web/containers/ModalTroubleShoot/index.tsx | 29 ++++++-------- web/containers/ModelDropdown/index.tsx | 17 ++++++-- web/containers/ServerLogs/index.tsx | 2 +- .../LocalServerRightPanel/index.tsx | 2 +- web/screens/Settings/Appearance/index.tsx | 2 +- 14 files changed, 83 insertions(+), 32 deletions(-) diff --git a/electron/utils/setup.ts b/electron/utils/setup.ts index c53698351..437e21f97 100644 --- a/electron/utils/setup.ts +++ b/electron/utils/setup.ts @@ -2,7 +2,7 @@ import { app } from 'electron' import Store from 'electron-store' const DEFAULT_WIDTH = 1000 -const DEFAULT_HEIGHT = 700 +const DEFAULT_HEIGHT = 800 const storage = new Store() diff --git a/joi/src/core/Modal/styles.scss b/joi/src/core/Modal/styles.scss index 8baddaef2..755daaf3d 100644 --- a/joi/src/core/Modal/styles.scss +++ b/joi/src/core/Modal/styles.scss @@ -16,6 +16,7 @@ fieldset, overflow: hidden; background-color: hsla(var(--modal-bg)); border-radius: 8px; + font-size: 14px; position: fixed; z-index: 300; top: 50%; diff --git a/joi/src/core/ScrollArea/index.tsx b/joi/src/core/ScrollArea/index.tsx index abe2adda9..3a2ffaaa8 100644 --- a/joi/src/core/ScrollArea/index.tsx +++ b/joi/src/core/ScrollArea/index.tsx @@ -7,13 +7,17 @@ import './styles.scss' const ScrollArea = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( +>(({ className, children, onScroll, ...props }, ref) => ( - + {children} - +
{children} diff --git a/web/containers/CenterPanelContainer/index.tsx b/web/containers/CenterPanelContainer/index.tsx index 72588a894..dd8fa0ae4 100644 --- a/web/containers/CenterPanelContainer/index.tsx +++ b/web/containers/CenterPanelContainer/index.tsx @@ -16,7 +16,7 @@ const CenterPanelContainer = ({ children }: PropsWithChildren) => { className={twMerge( 'h-full w-full overflow-hidden bg-[hsla(var(--center-panel-bg))]', !reduceTransparent && - 'rounded-lg border border-[hsla(var(--app-border))] shadow' + 'rounded-lg border border-[hsla(var(--app-border))]' )} > {children} diff --git a/web/containers/Layout/BottomPanel/index.tsx b/web/containers/Layout/BottomPanel/index.tsx index 1c7439c81..cc0efd805 100644 --- a/web/containers/Layout/BottomPanel/index.tsx +++ b/web/containers/Layout/BottomPanel/index.tsx @@ -1,5 +1,7 @@ +import { Button, Tooltip } from '@janhq/joi' import { useAtomValue } from 'jotai' +import { FaGithub, FaDiscord } from 'react-icons/fa' import { twMerge } from 'tailwind-merge' import DownloadingState from './DownloadingState' @@ -13,6 +15,19 @@ import UpdatedFailedModal from './UpdateFailedModal' import { appDownloadProgressAtom } from '@/helpers/atoms/App.atom' import { reduceTransparentAtom } from '@/helpers/atoms/Setting.atom' +const menuLinks = [ + { + name: 'Discord', + icon: , + link: 'https://discord.gg/FTk2MvZwJH', + }, + { + name: 'Github', + icon: , + link: 'https://github.com/janhq/jan', + }, +] + const BottomPanel = () => { const progress = useAtomValue(appDownloadProgressAtom) const reduceTransparent = useAtomValue(reduceTransparentAtom) @@ -41,6 +56,31 @@ const BottomPanel = () => { Jan v{VERSION ?? ''} +
+ {menuLinks + .filter((link) => !!link) + .map((link, i) => ( +
+ + + {link.icon} + + + } + content={link.name} + /> +
+ ))} +
) diff --git a/web/containers/Layout/TopPanel/index.tsx b/web/containers/Layout/TopPanel/index.tsx index bd34f5858..e2966e4da 100644 --- a/web/containers/Layout/TopPanel/index.tsx +++ b/web/containers/Layout/TopPanel/index.tsx @@ -77,11 +77,11 @@ const TopPanel = () => { {showRightPanel ? ( ) : ( )} diff --git a/web/containers/ModalTroubleShoot/AppLogs.tsx b/web/containers/ModalTroubleShoot/AppLogs.tsx index f9e585dde..63b324e96 100644 --- a/web/containers/ModalTroubleShoot/AppLogs.tsx +++ b/web/containers/ModalTroubleShoot/AppLogs.tsx @@ -27,7 +27,7 @@ const AppLogs = () => { return (
-
+
- + {loadModelError && serverEnabled && (
diff --git a/web/screens/Settings/Appearance/index.tsx b/web/screens/Settings/Appearance/index.tsx index 23a791aa8..e91709f5b 100644 --- a/web/screens/Settings/Appearance/index.tsx +++ b/web/screens/Settings/Appearance/index.tsx @@ -3,7 +3,7 @@ import { useCallback } from 'react' import { useTheme } from 'next-themes' import { fs, joinPath } from '@janhq/core' -import { Button, Select, Switch } from '@janhq/joi' +import { Button, Select } from '@janhq/joi' import { useAtom, useAtomValue } from 'jotai' import {