Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/screens/Chat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const ChatScreen = () => {
setIsWaitingToSend(false)
sendChatMessage()
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [waitingToSendMessage, activeConversationId])

const handleKeyDown = async (
Expand Down
58 changes: 54 additions & 4 deletions web/screens/Welcome/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import { Fragment } from 'react'

import { Badge, Button } from '@janhq/uikit'

import LogoMark from '@/containers/Brand/Logo/Mark'

import { MainViewState } from '@/constants/screens'

import { useActiveModel } from '@/hooks/useActiveModel'
import { useGetDownloadedModels } from '@/hooks/useGetDownloadedModels'

import { useMainViewState } from '@/hooks/useMainViewState'

const WelcomeScreen = () => {
const { downloadedModels } = useGetDownloadedModels()
const { activeModel } = useActiveModel()
const { setMainViewState } = useMainViewState()

return (
<div className="flex h-full items-center justify-center px-4">
<div className="text-center">
Expand All @@ -9,10 +24,45 @@ const WelcomeScreen = () => {
width={56}
height={56}
/>
<h1 data-testid="testid-welcome-title" className="text-2xl font-bold">
Welcome to Jan
</h1>
<p className="">{`let’s download your first model`}</p>

{downloadedModels.length === 0 && !activeModel && (
<Fragment>
<h1
data-testid="testid-welcome-title"
className="text-2xl font-bold"
>
Welcome to Jan
</h1>
<p className="mt-1">{`let’s download your first model`}</p>
<Button
className="mt-4"
onClick={() => setMainViewState(MainViewState.ExploreModels)}
>
Explore Models
</Button>
</Fragment>
)}
{downloadedModels.length >= 1 && !activeModel && (
<Fragment>
<h1 className="mt-2 text-lg font-medium">{`You don’t have any actively running models`}</h1>
<p className="mt-1">{`Please start a downloaded model in My Models page to use this feature.`}</p>
<Badge className="mt-4" themes="secondary">
⌘e to show your model
</Badge>
</Fragment>
)}
{downloadedModels.length >= 1 && activeModel && (
<Fragment>
<h1 className="mt-2 text-lg font-medium">{`Your Model is Active`}</h1>
<p className="mt-1">{`You are ready to start conversations.`}</p>
<Button
className="mt-4"
onClick={() => setMainViewState(MainViewState.Chat)}
>
Start a conversation
</Button>
</Fragment>
)}
</div>
</div>
)
Expand Down