From eec560869e11286cae8cb42497167f62204ed39c Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Sat, 16 Nov 2024 10:20:25 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=99=20feat:=20automatically=20add=20st?= =?UTF-8?q?art=20balance=20(#168)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adding information about the starting balance * Adding information about the starting balance * chore: type fixes * fix: MDX build errors * chore: explicit typing * chore: improve typing for author metadata socials * chore: strict assertion --------- Co-authored-by: MSITE.TOP --- components/Author/AuthorPage.tsx | 12 ++++++++---- components/home/components/HomeSection.tsx | 3 ++- components/ui/accordion.tsx | 1 + components/ui/avatar.tsx | 1 + components/ui/dialog.tsx | 1 + components/ui/dropdown-menu.tsx | 16 +++++++++++++--- components/ui/form.tsx | 1 + components/ui/label.tsx | 1 + components/ui/select.tsx | 1 + components/ui/tabs.tsx | 1 + pages/docs/configuration/dotenv.mdx | 3 ++- pages/docs/configuration/token_usage.mdx | 9 ++++++++- 12 files changed, 40 insertions(+), 10 deletions(-) diff --git a/components/Author/AuthorPage.tsx b/components/Author/AuthorPage.tsx index eb8956c8d..ca23498a2 100644 --- a/components/Author/AuthorPage.tsx +++ b/components/Author/AuthorPage.tsx @@ -11,7 +11,9 @@ interface AuthorMetadata { name: string bio: string ogImage: string - socials?: Record + socials?: { + [key: string]: string + } } const AuthorCard: React.FC<{ author: AuthorMetadata }> = ({ author }) => { @@ -21,7 +23,9 @@ const AuthorCard: React.FC<{ author: AuthorMetadata }> = ({ author }) => { setIsClient(true) }, []) - const socialsEntries = Object.entries(author.socials ?? {}).filter(([, value]) => !!value) + const socialsEntries = Object.entries(author.socials ?? {}).filter( + ([, value]) => !!value, + ) as unknown as [string, string][] return ( @@ -43,7 +47,7 @@ const AuthorCard: React.FC<{ author: AuthorMetadata }> = ({ author }) => { socialsEntries.map(([key, value]) => ( = ({ author }) => { onClick={(e) => e.stopPropagation()} > ((props, ref) => { return (
, React.ComponentPropsWithoutRef & { inset?: boolean + children: React.ReactNode } >(({ className, inset, children, ...props }, ref) => ( , - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + children?: React.ReactNode + } >(({ className, sideOffset = 4, ...props }, ref) => ( , React.ComponentPropsWithoutRef & { inset?: boolean + children?: React.ReactNode + onClick?: (event: React.MouseEvent) => void } >(({ className, inset, ...props }, ref) => ( , - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + children: React.ReactNode + } >(({ className, children, checked, ...props }, ref) => ( , - React.ComponentPropsWithoutRef + React.ComponentPropsWithoutRef & { + children: React.ReactNode + } >(({ className, children, value, ...props }, ref) => ( diff --git a/pages/docs/configuration/token_usage.mdx b/pages/docs/configuration/token_usage.mdx index 0b91b3a83..bab10acf2 100644 --- a/pages/docs/configuration/token_usage.mdx +++ b/pages/docs/configuration/token_usage.mdx @@ -17,6 +17,13 @@ Currently, you can limit user token usage by enabling user balances. To enables ]} /> +And You can also set the number of tokens a user will receive upon registration: + + You manually add user balance, or you will need to build out a balance-accruing system for users. This may come as a feature to the app whenever an admin dashboard is introduced. @@ -101,4 +108,4 @@ There will be more customization for this soon from the `librechat.yaml` file. ![image](https://github.com/danny-avila/LibreChat/assets/110412045/39a1aa5d-f8fc-43bf-81f2-299e57d944bb) -![image](https://github.com/danny-avila/LibreChat/assets/110412045/e1b1cc3f-8981-4c7c-a5f8-e7badbc6f675) \ No newline at end of file +![image](https://github.com/danny-avila/LibreChat/assets/110412045/e1b1cc3f-8981-4c7c-a5f8-e7badbc6f675)