diff --git a/.changeset/afraid-fishes-rule.md b/.changeset/afraid-fishes-rule.md new file mode 100644 index 00000000..0e277875 --- /dev/null +++ b/.changeset/afraid-fishes-rule.md @@ -0,0 +1,5 @@ +--- +"syncia": patch +--- + +Fixes UI for welcome auth screen and settings page base url input diff --git a/src/components/Settings/Sections/ChatSettings.tsx b/src/components/Settings/Sections/ChatSettings.tsx index e43d9878..988d2784 100644 --- a/src/components/Settings/Sections/ChatSettings.tsx +++ b/src/components/Settings/Sections/ChatSettings.tsx @@ -86,14 +86,6 @@ const ChatSettings = () => { type={showPassword ? 'text' : 'password'} className="input" /> - - { + + + + + Update + + + {' '} {/* ========================= Model Setting ===========================*/} diff --git a/src/components/Sidebar/auth/index.tsx b/src/components/Sidebar/auth/index.tsx index f474ff88..dd67cc26 100644 --- a/src/components/Sidebar/auth/index.tsx +++ b/src/components/Sidebar/auth/index.tsx @@ -5,6 +5,7 @@ import { validateApiKey } from '../../../lib/validApiKey' const Auth = () => { const [, setSettings] = useSettings() const [error, setError] = React.useState(null) + const [showAdvanced, setShowAdvanced] = React.useState(false) useEffect(() => { if (error) { @@ -18,9 +19,8 @@ const Auth = () => { e.preventDefault() const data = new FormData(e.currentTarget) const key = data.get('openAiKey') as string | null - const openAiBaseUrl = data.get('openAiBaseUrl') as - | string - | 'https://api.openai.com/v1' + const openAiBaseUrl = + (data.get('openAiBaseUrl') as string) || 'https://api.openai.com/v1' if (key && (await validateApiKey(key, openAiBaseUrl))) { setSettings((prev) => ({ @@ -28,13 +28,14 @@ const Auth = () => { chat: { ...prev.chat, openAIKey: key as string, - openAiBaseUrl: openAiBaseUrl as string, + openAiBaseUrl: openAiBaseUrl, }, })) } else { setError('Invalid API key. Please try with a valid one.') } } + return ( { sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - - + + + + API Key + + + + + setShowAdvanced(!showAdvanced)} + className="cdx-mt-4 cdx-text-sm cdx-text-blue-400 hover:cdx-underline" + > + {showAdvanced ? 'Hide Advanced Settings' : 'Show Advanced Settings'} + + + {showAdvanced && ( + + + Base URL (optional) + + + + )} {error && ( {error} @@ -80,6 +112,7 @@ const Auth = () => { > Submit + (Note: we only store your key locally. We do not send it anywhere. You can check the{' '}