refactor: Remove hard-coded colors and unnecessary dark classes

This commit is contained in:
Igor Carvalho 2023-07-12 13:29:40 -03:00
commit db2a746df7
6 changed files with 13 additions and 7 deletions

View file

@ -38,9 +38,10 @@
--info-background: #f0f4fd; --info-background: #f0f4fd;
--info-foreground: #141653; --info-foreground: #141653;
--high-indigo: #4338ca; --high-indigo: #4338ca;
--medium-indigo: #6366f1; --medium-indigo: #6366f1;
--low-indigo: #e0e7ff;
--chat-bot-icon: #afe6ef; --chat-bot-icon: #afe6ef;
--chat-user-icon: #aface9; --chat-user-icon: #aface9;
@ -52,6 +53,7 @@
--chat-trigger-disabled: #b4c3da; --chat-trigger-disabled: #b4c3da;
--status-red: #ef4444; --status-red: #ef4444;
--status-yellow: #eab308; --status-yellow: #eab308;
--chat-send: #059669;
--status-green: #4ade80; --status-green: #4ade80;
--status-blue:#2563eb; --status-blue:#2563eb;
--connection: #555; --connection: #555;
@ -104,6 +106,7 @@
--high-indigo: #4338ca; --high-indigo: #4338ca;
--medium-indigo: #6366f1; --medium-indigo: #6366f1;
--low-indigo: #e0e7ff;
/* Colors that are shared in dark and light mode */ /* Colors that are shared in dark and light mode */
--blur-shared: #151923d2; --blur-shared: #151923d2;
@ -112,6 +115,7 @@
--chat-trigger-disabled: #2d3b54; --chat-trigger-disabled: #2d3b54;
--status-red: #ef4444; --status-red: #ef4444;
--status-yellow: #eab308; --status-yellow: #eab308;
--chat-send: #059669;
--status-green: #4ade80; --status-green: #4ade80;
--status-blue: #2563eb; --status-blue: #2563eb;
--connection: #555; --connection: #555;

View file

@ -68,10 +68,10 @@ export default function ChatInput({
className={classNames( className={classNames(
"form-modal-send-button", "form-modal-send-button",
noInput noInput
? "bg-indigo-600 text-background" ? "bg-high-indigo text-background"
: chatValue === "" : chatValue === ""
? "text-primary" ? "text-primary"
: "bg-emerald-600 text-background" : "bg-chat-send text-background"
)} )}
disabled={lockChat} disabled={lockChat}
onClick={() => sendMessage()} onClick={() => sendMessage()}

View file

@ -181,7 +181,7 @@ export default function ChatMessage({
// Push div with matched text // Push div with matched text
if (chat.message[match[1]]) { if (chat.message[match[1]]) {
parts.push( parts.push(
<span className="my-1 rounded-md bg-indigo-100"> <span className="my-1 rounded-md bg-low-indigo">
{chat.message[match[1]]} {chat.message[match[1]]}
</span> </span>
); );

View file

@ -392,7 +392,7 @@ export default function FormModal({
<DialogTitle className="flex items-center"> <DialogTitle className="flex items-center">
<span className="pr-2">Chat</span> <span className="pr-2">Chat</span>
<TerminalSquare <TerminalSquare
className="h-6 w-6 pl-1 text-gray-800 dark:text-white" className="h-6 w-6 pl-1 text-foreground"
aria-hidden="true" aria-hidden="true"
/> />
</DialogTitle> </DialogTitle>

View file

@ -203,7 +203,7 @@ export default function GenericModal({
{type === TypeModal.PROMPT && isEdit ? ( {type === TypeModal.PROMPT && isEdit ? (
<Textarea <Textarea
ref={ref} ref={ref}
className="form-input h-full w-full rounded-lg border-gray-300 custom-scroll focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white" className="form-input h-full w-full rounded-lg border-border custom-scroll focus-visible:ring-1"
value={inputValue} value={inputValue}
onBlur={() => { onBlur={() => {
setIsEdit(false); setIsEdit(false);
@ -220,7 +220,7 @@ export default function GenericModal({
) : type !== TypeModal.PROMPT ? ( ) : type !== TypeModal.PROMPT ? (
<Textarea <Textarea
ref={ref} ref={ref}
className="form-input h-full w-full rounded-lg border-gray-300 focus-visible:ring-1 dark:border-gray-700 dark:bg-gray-900 dark:text-white" className="form-input h-full w-full rounded-lg border-border focus-visible:ring-1"
value={inputValue} value={inputValue}
onChange={(e) => { onChange={(e) => {
setInputValue(e.target.value); setInputValue(e.target.value);

View file

@ -43,6 +43,8 @@ module.exports = {
"accordion-up": "accordion-up 0.2s ease-out", "accordion-up": "accordion-up 0.2s ease-out",
}, },
colors: { colors: {
"low-indigo": "var(--low-indigo)",
"chat-send": "var(--chat-send)",
connection: "var(--connection)", connection: "var(--connection)",
"almost-dark-gray": "var(--almost-dark-gray)", "almost-dark-gray": "var(--almost-dark-gray)",
"almost-light-blue": "var(--almost-light-blue)", "almost-light-blue": "var(--almost-light-blue)",