diff --git a/frontend/.ladle/components.tsx b/frontend/.ladle/components.tsx index 39e3e879a..e7577eff8 100644 --- a/frontend/.ladle/components.tsx +++ b/frontend/.ladle/components.tsx @@ -1,7 +1,21 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import '../src/i18n'; import { GlobalProvider } from '@ladle/react'; +import { useLadleContext } from '@ladle/react'; import '../src/index.css'; + export const Provider: GlobalProvider = ({ children }) => { + const { globalState } = useLadleContext(); + + useEffect(() => { + const bodyClass = document.body.classList; + + if (globalState.theme === 'dark') { + bodyClass.add('dark'); + } else { + bodyClass.remove('dark'); + } + }, [globalState.theme]); + return <>{children}; }; diff --git a/frontend/src/components/Alert.tsx b/frontend/src/components/Alert.tsx index 6bf0e62a7..9e33f36c5 100644 --- a/frontend/src/components/Alert.tsx +++ b/frontend/src/components/Alert.tsx @@ -24,7 +24,7 @@ const Alert: React.FC = (props) => { return (
= (props) => { )}>
{icon}
{props.title}
-
+
{props.children}
diff --git a/frontend/src/components/ApiKeyItem.tsx b/frontend/src/components/ApiKeyItem.tsx index 58f3a164e..d0e39b06b 100644 --- a/frontend/src/components/ApiKeyItem.tsx +++ b/frontend/src/components/ApiKeyItem.tsx @@ -64,7 +64,7 @@ const ApiKeyItem: React.FC = (props) => { {isLoading ? ( ) : ( -
+
{botApiKey?.description}
@@ -80,7 +80,7 @@ const ApiKeyItem: React.FC = (props) => { {t('bot.apiSettings.label.apiKeyDetail.inactive')}
)} -
+
{t('bot.apiSettings.label.apiKeyDetail.creationDate')}:
@@ -98,7 +98,7 @@ const ApiKeyItem: React.FC = (props) => {
diff --git a/frontend/src/components/DialogConfirmDeleteApi.tsx b/frontend/src/components/DialogConfirmDeleteApi.tsx index 17b2351ca..798b9df40 100644 --- a/frontend/src/components/DialogConfirmDeleteApi.tsx +++ b/frontend/src/components/DialogConfirmDeleteApi.tsx @@ -28,7 +28,7 @@ const DialogConfirmDeleteApi: React.FC = (props) => {
diff --git a/frontend/src/components/DialogConfirmDeleteApiKey.tsx b/frontend/src/components/DialogConfirmDeleteApiKey.tsx index c55218ecb..3ab3af8e2 100644 --- a/frontend/src/components/DialogConfirmDeleteApiKey.tsx +++ b/frontend/src/components/DialogConfirmDeleteApiKey.tsx @@ -35,7 +35,7 @@ const DialogConfirmDeleteApiKey: React.FC = (props) => {
diff --git a/frontend/src/components/DialogConfirmDeleteBot.tsx b/frontend/src/components/DialogConfirmDeleteBot.tsx index 5c74a530a..83cec18eb 100644 --- a/frontend/src/components/DialogConfirmDeleteBot.tsx +++ b/frontend/src/components/DialogConfirmDeleteBot.tsx @@ -36,7 +36,7 @@ const DialogConfirmDeleteBot: React.FC = (props) => { onClick={() => { props.onDelete(props.target?.id ?? ''); }} - className="bg-red p-2 text-aws-font-color-white"> + className="bg-red p-2 text-aws-font-color-white-light dark:text-aws-font-color-white-dark"> {t('button.delete')}
diff --git a/frontend/src/components/DialogConfirmDeleteChat.tsx b/frontend/src/components/DialogConfirmDeleteChat.tsx index b3290f57f..489c532ab 100644 --- a/frontend/src/components/DialogConfirmDeleteChat.tsx +++ b/frontend/src/components/DialogConfirmDeleteChat.tsx @@ -36,7 +36,7 @@ const DialogConfirmDeleteChat: React.FC = (props) => { onClick={() => { props.onDelete(props.target?.id ?? ''); }} - className="bg-red p-2 text-aws-font-color-white"> + className="bg-red p-2 text-aws-font-color-white-light dark:text-aws-font-color-white-dark"> {t('button.delete')} diff --git a/frontend/src/components/DialogInstructionsSamples.tsx b/frontend/src/components/DialogInstructionsSamples.tsx index 54fb3e73d..24026da66 100644 --- a/frontend/src/components/DialogInstructionsSamples.tsx +++ b/frontend/src/components/DialogInstructionsSamples.tsx @@ -13,7 +13,7 @@ const PromptSample: React.FC = (props) => { return (
{props.title}
-
+
{props.prompt.split('\n').map((s, idx) => (
{s}
))} @@ -58,7 +58,7 @@ const DialogInstructionsSamples: React.FC = (props) => { href={t('bot.samples.anthropicLibrary.url')} target="_blank" rel="noopener noreferrer" - className="text-aws-sea-blue underline hover:text-aws-sea-blue-hover"> + className="text-aws-sea-blue-light dark:text-aws-font-color-blue underline hover:text-aws-sea-blue-hover-light dark:hover:text-aws-sea-blue-hover-dark"> {t('bot.samples.anthropicLibrary.title')}
diff --git a/frontend/src/components/DialogShareBot.tsx b/frontend/src/components/DialogShareBot.tsx index 3f56d445b..b0808b33b 100644 --- a/frontend/src/components/DialogShareBot.tsx +++ b/frontend/src/components/DialogShareBot.tsx @@ -54,16 +54,16 @@ const DialogShareBot: React.FC = (props) => {
{isShared && ( -
+
diff --git a/frontend/src/components/DrawerItem.tsx b/frontend/src/components/DrawerItem.tsx index 93f4569a1..46612a0f3 100644 --- a/frontend/src/components/DrawerItem.tsx +++ b/frontend/src/components/DrawerItem.tsx @@ -19,8 +19,8 @@ const DrawerItem: React.FC = (props) => { className={twMerge( 'group mx-2 my-1 flex h-10 items-center rounded px-2', props.isActive ?? true - ? 'bg-aws-sea-blue' - : 'hover:bg-aws-sea-blue-hover', + ? 'bg-aws-sea-blue-light dark:bg-aws-sea-blue-dark' + : 'hover:bg-aws-sea-blue-hover-light dark:hover:bg-aws-paper-dark', props.className )} to={props.to} @@ -34,8 +34,8 @@ const DrawerItem: React.FC = (props) => { className={twMerge( 'absolute inset-y-0 right-0 w-8 bg-gradient-to-l', props.isActive - ? 'from-aws-sea-blue' - : 'from-aws-squid-ink group-hover:from-aws-sea-blue-hover' + ? 'from-aws-sea-blue-light dark:from-aws-sea-blue-dark' + : 'from-aws-squid-ink-light dark:from-aws-squid-ink-dark group-hover:from-aws-sea-blue-hover-light dark:group-hover:from-aws-paper-dark' )} /> )} diff --git a/frontend/src/components/GenerationConfig.tsx b/frontend/src/components/GenerationConfig.tsx index 1ad155ac1..1cc065542 100644 --- a/frontend/src/components/GenerationConfig.tsx +++ b/frontend/src/components/GenerationConfig.tsx @@ -36,7 +36,7 @@ const GenerationConfig: React.FC = ({ const { t } = useTranslation(); return (
-
+
{t('generationConfig.description')}
diff --git a/frontend/src/components/InputChatContent.tsx b/frontend/src/components/InputChatContent.tsx index 9c89459d5..96e8456bb 100644 --- a/frontend/src/components/InputChatContent.tsx +++ b/frontend/src/components/InputChatContent.tsx @@ -457,7 +457,7 @@ const InputChatContent = forwardRef((props, focusInputRef) = onDrop={onDrop} className={twMerge( props.className, - 'relative mb-7 flex w-11/12 flex-col rounded-xl border border-black/10 bg-white shadow-[0_0_30px_7px] shadow-light-gray md:w-10/12 lg:w-4/6 xl:w-3/6' + 'relative mb-7 flex w-11/12 flex-col rounded-xl border border-black/10 bg-white dark:bg-aws-ui-color-dark shadow-[0_0_30px_7px] shadow-light-gray dark:shadow-black/35 md:w-10/12 lg:w-4/6 xl:w-3/6' )}>