🖌️ feat: Optional Display Username in Messages, Send/Stop Button Style, Localization (#1592)

* 👤add: Username instead of 'You' when sending messages.

* 🌎: Added a new translation for 'You' and updated the existing translation for Spanish.

* fix: remove "!"

* Added: New setting Account for show username in messages
chore (StopButon and SendButon): Updated to new style of ChatGPT
chore Update and Added news translations: Spanish, English and Portuguese Brazilian

* fix: message component definition and imports order, remove unnecessary useEffect and localStorage set, fix localStorage key in store

* chore: update readme.md

* chore: optimize condition for messageLabel

* chore(Message.tsx): remove empty blocks

---------

Co-authored-by: Raí Santos <140329135+itzraiss@users.noreply.github.com>
This commit is contained in:
Danny Avila 2024-01-19 03:44:02 -05:00 committed by GitHub
parent 3df58532d9
commit f133bb98fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 223 additions and 115 deletions

View file

@ -88,6 +88,25 @@ const LaTeXParsing = atom<boolean>({
] as const,
});
const UsernameDisplay = atom<boolean>({
key: 'UsernameDisplay',
default: localStorage.getItem('UsernameDisplay') === 'true',
effects: [
({ setSelf, onSet }) => {
const savedValue = localStorage.getItem('UsernameDisplay');
if (savedValue != null) {
setSelf(savedValue === 'true');
}
onSet((newValue: unknown) => {
if (typeof newValue === 'boolean') {
localStorage.setItem('UsernameDisplay', newValue.toString());
}
});
},
] as const,
});
export default {
abortScroll,
optionSettings,
@ -98,4 +117,5 @@ export default {
autoScroll,
modularChat,
LaTeXParsing,
UsernameDisplay,
};