From e38e9c7e45210552963b1cfa5b0b50f004747561 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 5 Jan 2024 14:55:22 +0700 Subject: [PATCH] feat: allow user click badge cmd shortcut my model and update copy --- .../Layout/BottomBar/SystemItem/index.tsx | 23 ++++++++-- web/containers/Layout/BottomBar/index.tsx | 45 ++++++++++++------- web/containers/Layout/TopBar/index.tsx | 2 - 3 files changed, 48 insertions(+), 22 deletions(-) diff --git a/web/containers/Layout/BottomBar/SystemItem/index.tsx b/web/containers/Layout/BottomBar/SystemItem/index.tsx index dfa8cb0d3..6bb8b645d 100644 --- a/web/containers/Layout/BottomBar/SystemItem/index.tsx +++ b/web/containers/Layout/BottomBar/SystemItem/index.tsx @@ -1,15 +1,30 @@ import { ReactNode } from 'react' +import { twMerge } from 'tailwind-merge' + type Props = { name?: string value: string | ReactNode + titleBold?: boolean } -export default function SystemItem({ name, value }: Props) { +export default function SystemItem({ name, value, titleBold }: Props) { return ( -
-

{name}

- {value} +
+

+ {name} +

+ + {value} +
) } diff --git a/web/containers/Layout/BottomBar/index.tsx b/web/containers/Layout/BottomBar/index.tsx index 74844a000..7f839b210 100644 --- a/web/containers/Layout/BottomBar/index.tsx +++ b/web/containers/Layout/BottomBar/index.tsx @@ -6,17 +6,19 @@ import { TooltipContent, TooltipTrigger, } from '@janhq/uikit' -import { useAtomValue } from 'jotai' +import { useAtomValue, useSetAtom } from 'jotai' import { FaGithub, FaDiscord } from 'react-icons/fa' import DownloadingState from '@/containers/Layout/BottomBar/DownloadingState' import SystemItem from '@/containers/Layout/BottomBar/SystemItem' +import CommandListDownloadedModel from '@/containers/Layout/TopBar/CommandListDownloadedModel' import ProgressBar from '@/containers/ProgressBar' import { appDownloadProgress } from '@/containers/Providers/Jotai' +import { showSelectModelModalAtom } from '@/containers/Providers/KeyListener' import ShortCut from '@/containers/Shortcut' import { MainViewState } from '@/constants/screens' @@ -48,6 +50,7 @@ const BottomBar = () => { const { downloadedModels } = useGetDownloadedModels() const { setMainViewState } = useMainViewState() const { downloadStates } = useDownloadState() + const setShowSelectModelModal = useSetAtom(showSelectModelModalAtom) return (
@@ -58,24 +61,31 @@ const BottomBar = () => { ) : null}
+ setShowSelectModelModal((show) => !show)} + > + My Models  + + + {stateModel.state === 'start' && stateModel.loading && ( - + )} {stateModel.state === 'stop' && stateModel.loading && ( - + )} {!stateModel.loading && downloadedModels.length !== 0 && ( - - -   to view models - - ) - } - /> + )} {downloadedModels.length === 0 && !stateModel.loading && @@ -91,13 +101,15 @@ const BottomBar = () => {
-
+
{/* VERSION is defined by webpack, please see next.config.js */} - Jan v{VERSION ?? ''} + + Jan v{VERSION ?? ''} +
{menuLinks .filter((link) => !!link) @@ -123,6 +135,7 @@ const BottomBar = () => { ))}
+
) } diff --git a/web/containers/Layout/TopBar/index.tsx b/web/containers/Layout/TopBar/index.tsx index c830c84e3..9ef03dd11 100644 --- a/web/containers/Layout/TopBar/index.tsx +++ b/web/containers/Layout/TopBar/index.tsx @@ -13,7 +13,6 @@ import { import { twMerge } from 'tailwind-merge' -import CommandListDownloadedModel from '@/containers/Layout/TopBar/CommandListDownloadedModel' import CommandSearch from '@/containers/Layout/TopBar/CommandSearch' import { MainViewState } from '@/constants/screens' @@ -213,7 +212,6 @@ const TopBar = () => { )} - ) }