mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 18:00:15 +01:00
Feat/startup config api (#518)
* feat: add api for config * feat: add data service to client * feat: update client pages with values from config endpoint * test: update tests * Update configurations and documentation to remove VITE_SHOW_GOOGLE_LOGIN_OPTION and change VITE_APP_TITLE to APP_TITLE * include APP_TITLE with startup config * Add test for new route * update backend-review pipeline * comment out test until we can figure out testing routes in CI * update: .env.example --------- Co-authored-by: fuegovic <32828263+fuegovic@users.noreply.github.com>
This commit is contained in:
parent
2da81db440
commit
3634d8691a
25 changed files with 419 additions and 75 deletions
|
|
@ -1,20 +1,24 @@
|
|||
import React from 'react';
|
||||
import { useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import useDocumentTitle from '~/hooks/useDocumentTitle';
|
||||
import SunIcon from '../svg/SunIcon';
|
||||
import LightningIcon from '../svg/LightningIcon';
|
||||
import CautionIcon from '../svg/CautionIcon';
|
||||
import store from '~/store';
|
||||
import { useGetStartupConfig } from '~/data-provider';
|
||||
|
||||
export default function Landing() {
|
||||
const { data: config } = useGetStartupConfig();
|
||||
const setText = useSetRecoilState(store.text);
|
||||
const conversation = useRecoilValue(store.conversation);
|
||||
// @ts-ignore TODO: Fix anti-pattern - requires refactoring conversation store
|
||||
const { title = 'New Chat' } = conversation || {};
|
||||
|
||||
useDocumentTitle(title);
|
||||
|
||||
const clickHandler = (e) => {
|
||||
const clickHandler = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||
e.preventDefault();
|
||||
const { innerText } = e.target;
|
||||
const { innerText } = e.target as HTMLButtonElement;
|
||||
const quote = innerText.split('"')[1].trim();
|
||||
setText(quote);
|
||||
};
|
||||
|
|
@ -26,7 +30,7 @@ export default function Landing() {
|
|||
id="landing-title"
|
||||
className="mb-10 ml-auto mr-auto mt-6 flex items-center justify-center gap-2 text-center text-4xl font-semibold sm:mb-16 md:mt-[10vh]"
|
||||
>
|
||||
{import.meta.env.VITE_APP_TITLE || 'LibreChat'}
|
||||
{config?.appTitle || 'LibreChat'}
|
||||
</h1>
|
||||
<div className="items-start gap-3.5 text-center md:flex">
|
||||
<div className="mb-8 flex flex-1 flex-col gap-3.5 md:mb-auto">
|
||||
Loading…
Add table
Add a link
Reference in a new issue