From 1f5168d4af9080b867c19d334c398bf32e4f54b8 Mon Sep 17 00:00:00 2001 From: Faisal Amir Date: Fri, 9 Aug 2024 11:00:33 +0700 Subject: [PATCH] feat: modal waiting cortex (#3306) * feat: update style modal waiting cortex * chore: fix logic open modal * chore: update url default host atom * chore: update jan data folder path * chore: reduce font size modal waiting cortex --- joi/src/core/Modal/index.tsx | 2 +- web/containers/Loader/Spinner.tsx | 14 +++- web/containers/WaitingCortexModal/index.tsx | 80 ++++++++++++++------- web/helpers/atoms/AppConfig.atom.ts | 2 +- 4 files changed, 70 insertions(+), 28 deletions(-) diff --git a/joi/src/core/Modal/index.tsx b/joi/src/core/Modal/index.tsx index 736b2a6f6..7e31671ed 100644 --- a/joi/src/core/Modal/index.tsx +++ b/joi/src/core/Modal/index.tsx @@ -46,7 +46,7 @@ const Modal = ({ -
{title}
+ {title &&
{title}
} {content} {!hideClose && ( diff --git a/web/containers/Loader/Spinner.tsx b/web/containers/Loader/Spinner.tsx index 5735bd5ff..2fb942d0a 100644 --- a/web/containers/Loader/Spinner.tsx +++ b/web/containers/Loader/Spinner.tsx @@ -1,11 +1,20 @@ import React from 'react' -const Spinner = () => { +import { twMerge } from 'tailwind-merge' + +type Props = { + className?: string +} + +const Spinner = ({ className }: Props) => { return (

- Running API Server at{' '} - + {timedOut ? ( + <> +

+ {`Hmm, Jan's taking longer than usual to start up...`} +

+

+ API Server starting at{' '} + + {host}/api + +
+
+ + Check logs at{' '} + window?.electronAPI?.openAppLog()} + className="cursor-pointer text-[hsla(var(--app-link))]" + > + {janDataFolderPath} + {' '} + if this persists or restart app. + +

+ + ) : ( +

+ Jan is getting ready! This usually
takes a few seconds... +

+ )} +
+ +
+ {timedOut && ( + + )}
} /> diff --git a/web/helpers/atoms/AppConfig.atom.ts b/web/helpers/atoms/AppConfig.atom.ts index 9b8cba186..f0c0cc69d 100644 --- a/web/helpers/atoms/AppConfig.atom.ts +++ b/web/helpers/atoms/AppConfig.atom.ts @@ -30,4 +30,4 @@ export const didShowMigrationWarningAtom = atomWithStorage( } ) -export const hostAtom = atom('http://127.0.0.1:1338/v1') +export const hostAtom = atom('http://127.0.0.1:1338')