From aaba2fa8b58fa500dec8b58cc55c7bd20cbd869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gerardo=20Rond=C3=B3n=20Garc=C3=ADa?= <61068392+DanielRondonGarcia@users.noreply.github.com> Date: Wed, 5 Apr 2023 23:09:55 -0500 Subject: [PATCH] Update: Style improvements, Italian localization fix and small improvements - Added 'disabled' class to the input element when tightBorder is false. - Applied unavailable cursor style and disabled gray background for elements with the 'disabled' class. - Fixed Italian localization: Changed 'Lingue' to 'Language' to maintain universal terminology and improve user experience. - Added improvement to resizing the border so that it was at 90% of the screen size - Added new color for disabled options - Added title for explain the usage of tightBorder and adjustedContainer - Added the feature to remove a chat item using the middle click (middle mouse button) - Properly utilized the MouseEvent event in the ChatItem component --- app/components/chat-list.tsx | 8 ++++++++ app/components/home.module.scss | 7 +++++++ app/components/home.tsx | 3 ++- app/components/settings.tsx | 17 +++++++++++++++++ app/locales/cn.ts | 4 ++++ app/locales/en.ts | 5 +++++ app/locales/es.ts | 5 +++++ app/locales/it.ts | 7 ++++++- app/locales/tw.ts | 4 ++++ app/store/app.ts | 2 ++ app/styles/globals.scss | 9 +++++++++ 11 files changed, 69 insertions(+), 2 deletions(-) diff --git a/app/components/chat-list.tsx b/app/components/chat-list.tsx index 8d02805f7..d9aa51b8e 100644 --- a/app/components/chat-list.tsx +++ b/app/components/chat-list.tsx @@ -1,3 +1,4 @@ +import React, { MouseEvent as ReactMouseEvent } from "react"; import DeleteIcon from "../icons/delete.svg"; import styles from "./home.module.scss"; import { @@ -22,6 +23,12 @@ export function ChatItem(props: { id: number; index: number; }) { + const handleMiddleClick = (event: ReactMouseEvent) => { + if (event.button === 1 && props.onDelete) { + props.onDelete(); + } + }; + return ( {(provided) => ( @@ -30,6 +37,7 @@ export function ChatItem(props: { props.selected && styles["chat-item-selected"] }`} onClick={props.onClick} + onAuxClick={handleMiddleClick} ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} diff --git a/app/components/home.module.scss b/app/components/home.module.scss index da954dc1d..49d2bcc97 100644 --- a/app/components/home.module.scss +++ b/app/components/home.module.scss @@ -37,6 +37,13 @@ border-radius: 0; } + + .adjusted-container { + --window-width: 90vw; + max-width: 90vw; + max-height: 90vh; + border-radius: 20px; + } } .sidebar { diff --git a/app/components/home.tsx b/app/components/home.tsx index 9e57cb870..4d1203df0 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -110,7 +110,8 @@ function _Home() {
diff --git a/app/components/settings.tsx b/app/components/settings.tsx index a14f6473d..5dad70eb2 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -293,6 +293,7 @@ export function Settings(props: { closeSettings: () => void }) { updateConfig( @@ -302,6 +303,22 @@ export function Settings(props: { closeSettings: () => void }) { > + + + updateConfig( + (config) => + (config.adjustedContainer = e.currentTarget.checked), + ) + } + > + +