From 780bb3af7e8d36ff11dfa12a3c298770f17bb515 Mon Sep 17 00:00:00 2001 From: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com> Date: Mon, 16 Dec 2024 14:52:56 -0500 Subject: [PATCH] fix(ui): Update colors to match brand kit --- www/app/Chat.tsx | 73 +++++++++---------- www/app/actions/conversations.ts | 3 - www/app/auth/page.tsx | 17 ++--- www/app/globals.css | 12 ++- www/app/page.tsx | 2 +- www/app/providers.tsx | 2 +- www/app/settings/SettingsLayout.tsx | 4 +- www/components/auth/forgot.tsx | 13 ++-- www/components/auth/signIn.tsx | 32 +++----- www/components/auth/signUp.tsx | 61 ++++------------ www/components/conversationtab.tsx | 2 +- www/components/cookieConsentBanner.tsx | 12 +-- www/components/header.tsx | 4 +- www/components/messagebox.tsx | 12 ++- www/components/settings/SettingsForm.tsx | 6 +- .../settings/SubscriptionSettings.tsx | 7 +- www/components/sidebar.tsx | 7 +- www/utils/swrCache.ts | 7 +- 18 files changed, 118 insertions(+), 158 deletions(-) diff --git a/www/app/Chat.tsx b/www/app/Chat.tsx index f4aa79a..9600fba 100644 --- a/www/app/Chat.tsx +++ b/www/app/Chat.tsx @@ -158,18 +158,18 @@ export default function Chat({ const conversationsKey = useMemo(() => userId, [userId]); -const { data: conversations, mutate: mutateConversations } = useSWR( - conversationsKey, - conversationsFetcher, - { - fallbackData: initialConversations, - provider: localStorageProvider, - revalidateOnFocus: false, - dedupingInterval: 60000, - revalidateIfStale: false, - revalidateOnMount: false, - } -); + const { data: conversations, mutate: mutateConversations } = useSWR( + conversationsKey, + conversationsFetcher, + { + fallbackData: initialConversations, + provider: localStorageProvider, + revalidateOnFocus: false, + dedupingInterval: 60000, + revalidateIfStale: false, + revalidateOnMount: false, + } + ); const messagesFetcher = async (conversationId: string) => { if (!userId) return Promise.resolve([]); @@ -179,31 +179,27 @@ const { data: conversations, mutate: mutateConversations } = useSWR( return getMessages(conversationId); }; - const messagesKey = useMemo(() => - conversationId ? ['messages', conversationId] : null, + const messagesKey = useMemo( + () => (conversationId ? ['messages', conversationId] : null), [conversationId] ); - + const { data: messages, mutate: mutateMessages, isLoading: messagesLoading, - } = useSWR( - messagesKey, - () => messagesFetcher(conversationId!), - { - fallbackData: initialMessages, - provider: localStorageProvider, - revalidateOnFocus: false, - revalidateOnReconnect: false, - dedupingInterval: 60000, - onSuccess: (data) => { - if (conversationId?.startsWith('temp-')) { - mutateMessages([], false); - } + } = useSWR(messagesKey, () => messagesFetcher(conversationId!), { + fallbackData: initialMessages, + provider: localStorageProvider, + revalidateOnFocus: false, + revalidateOnReconnect: false, + dedupingInterval: 60000, + onSuccess: (data) => { + if (conversationId?.startsWith('temp-')) { + mutateMessages([], false); } - } - ); + }, + }); const handleReactionAdded = async (messageId: string, reaction: Reaction) => { if (!userId || !conversationId) return; @@ -321,7 +317,7 @@ const { data: conversations, mutate: mutateConversations } = useSWR( honchoResponse ).json()) as HonchoResponse; - const pureThought = thoughtText + const pureThought = thoughtText; thoughtText += '\n\nHoncho Dialectic Response:\n\n' + honchoContent.content; @@ -454,7 +450,7 @@ const { data: conversations, mutate: mutateConversations } = useSWR(

)} -
+
{ @@ -528,14 +525,14 @@ const { data: conversations, mutate: mutateConversations } = useSWR( }} /> -

+

Don't have an account?{' '} stateSync('SIGNUP')} - className="text-gray-700 underline" + className="text-foreground underline" > Sign up diff --git a/www/components/auth/signIn.tsx b/www/components/auth/signIn.tsx index 8384296..c5ecc5e 100644 --- a/www/components/auth/signIn.tsx +++ b/www/components/auth/signIn.tsx @@ -43,12 +43,12 @@ export default function SignIn(props: any) { action="#" ref={formRef} onSubmit={handleSignIn} - className={`mt-8 space-y-6 ${theme === 'dark' ? 'text-white' : 'text-gray-700'}`} + className={`mt-8 space-y-6 text-foreground`} >

@@ -57,11 +57,7 @@ export default function SignIn(props: any) { type="email" id="email" name="email" - className={`p-2 mt-1 w-full rounded-md text-sm shadow-sm ${ - theme === 'dark' - ? 'bg-gray-700 text-white border-gray-600' - : 'bg-white text-gray-700 border-gray-200' - } ${error ? 'border-2 border-red-500' : ''}`} + className={`p-2 mt-1 w-full rounded-md text-sm shadow-sm bg-accent text-foreground ${error ? 'border-2 border-red-500' : ''}`} value={email} onChange={(e) => setEmail(e.target.value)} /> @@ -70,7 +66,7 @@ export default function SignIn(props: any) {
@@ -79,11 +75,7 @@ export default function SignIn(props: any) { type="password" id="password" name="password" - className={`p-2 mt-1 w-full rounded-md text-sm shadow-sm ${ - theme === 'dark' - ? 'bg-gray-700 text-white border-gray-600' - : 'bg-white text-gray-700 border-gray-200' - } ${error ? 'border-2 border-red-500' : ''}`} + className={`p-2 mt-1 w-full rounded-md text-sm shadow-sm bg-accent text-foreground ${error ? 'border-2 border-red-500' : ''}`} value={password} onChange={(e) => setPassword(e.target.value)} /> @@ -91,11 +83,7 @@ export default function SignIn(props: any) {
-

+

Don't have an account?{' '} stateSync('SIGNUP')} - className={`underline ${theme === 'dark' ? 'text-gray-100' : 'text-gray-700'}`} + className={`underline text-foreground`} > Sign Up Now

-

+

Forgot Your Password?{' '} stateSync('FORGOT')} - className={`underline ${theme === 'dark' ? 'text-gray-100' : 'text-gray-700'}`} + className={`underline text-foreground`} > Recover diff --git a/www/components/auth/signUp.tsx b/www/components/auth/signUp.tsx index e630f6f..c979bcb 100644 --- a/www/components/auth/signUp.tsx +++ b/www/components/auth/signUp.tsx @@ -86,13 +86,10 @@ export default function SignUp(props: { action="#" ref={formRef} onSubmit={handleSignUp} - className={`mt-8 space-y-6 ${theme === 'dark' ? 'text-white' : 'text-gray-700'}`} + className={`mt-8 space-y-6 text-foreground`} >

-