mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:24:00 +01:00
Rename "Save & Submit" to "Generate" (#396)
* Rename to generate * edit view buttons reorder buttons and colors --------- Co-authored-by: Jing Hua <tohjinghua123@gmail.com> Co-authored-by: Jing Hua <59118459+ztjhz@users.noreply.github.com>
This commit is contained in:
parent
5b642f043f
commit
d0ddcfea6a
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Gem",
|
"save": "Gem",
|
||||||
"saveAndSubmit": "Gem & Send",
|
"generate": "Generere",
|
||||||
"cancel": "Annuller",
|
"cancel": "Annuller",
|
||||||
"confirm": "Bekræft",
|
"confirm": "Bekræft",
|
||||||
"warning": "Advarsel",
|
"warning": "Advarsel",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Speichern",
|
"save": "Speichern",
|
||||||
"saveAndSubmit": "Speichern & Absenden",
|
"generate": "Generieren",
|
||||||
"cancel": "Abbrechen",
|
"cancel": "Abbrechen",
|
||||||
"confirm": "Bestätigen",
|
"confirm": "Bestätigen",
|
||||||
"warning": "Achtung",
|
"warning": "Achtung",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"saveAndSubmit": "Save & Submit",
|
"generate": "Generate",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"warning": "Warning",
|
"warning": "Warning",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Save",
|
"save": "Save",
|
||||||
"saveAndSubmit": "Save & Submit",
|
"generate": "Generate",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"confirm": "Confirm",
|
"confirm": "Confirm",
|
||||||
"warning": "Warning",
|
"warning": "Warning",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Guardar",
|
"save": "Guardar",
|
||||||
"saveAndSubmit": "Guardar y enviar",
|
"generate": "Generar",
|
||||||
"cancel": "Cancelar",
|
"cancel": "Cancelar",
|
||||||
"confirm": "Aceptar",
|
"confirm": "Aceptar",
|
||||||
"warning": "Aviso",
|
"warning": "Aviso",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Enregistrer",
|
"save": "Enregistrer",
|
||||||
"saveAndSubmit": "Enregistrer et Soumettre",
|
"generate": "Générer",
|
||||||
"cancel": "Annuler",
|
"cancel": "Annuler",
|
||||||
"confirm": "Confirmer",
|
"confirm": "Confirmer",
|
||||||
"warning": "Attention",
|
"warning": "Attention",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Salva",
|
"save": "Salva",
|
||||||
"saveAndSubmit": "Salva & Invia",
|
"generate": "Generare",
|
||||||
"cancel": "Annulla",
|
"cancel": "Annulla",
|
||||||
"confirm": "Conferma",
|
"confirm": "Conferma",
|
||||||
"warning": "Attenzione",
|
"warning": "Attenzione",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"saveAndSubmit": "保存して送信",
|
"generate": "生成",
|
||||||
"cancel": "キャンセル",
|
"cancel": "キャンセル",
|
||||||
"confirm": "確認",
|
"confirm": "確認",
|
||||||
"warning": "警告",
|
"warning": "警告",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Simpan",
|
"save": "Simpan",
|
||||||
"saveAndSubmit": "Simpan & Hantar",
|
"generate": "Hasilkan",
|
||||||
"cancel": "Batal",
|
"cancel": "Batal",
|
||||||
"confirm": "Sahkan",
|
"confirm": "Sahkan",
|
||||||
"warning": "Amaran",
|
"warning": "Amaran",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Lagre",
|
"save": "Lagre",
|
||||||
"saveAndSubmit": "Lagre & Send inn",
|
"generate": "Generere",
|
||||||
"cancel": "Avbryt",
|
"cancel": "Avbryt",
|
||||||
"confirm": "Bekreft",
|
"confirm": "Bekreft",
|
||||||
"warning": "Advarsel",
|
"warning": "Advarsel",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Salvează",
|
"save": "Salvează",
|
||||||
"saveAndSubmit": "Salvați și trimiteți",
|
"generate": "Generează",
|
||||||
"cancel": "Anulează",
|
"cancel": "Anulează",
|
||||||
"confirm": "Confirmați",
|
"confirm": "Confirmați",
|
||||||
"warning": "Avertisment",
|
"warning": "Avertisment",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Сохранить",
|
"save": "Сохранить",
|
||||||
"saveAndSubmit": "Сохранить и отправить",
|
"generate": "Генерировать",
|
||||||
"cancel": "Отмена",
|
"cancel": "Отмена",
|
||||||
"confirm": "Подтвердить",
|
"confirm": "Подтвердить",
|
||||||
"warning": "Предупреждение",
|
"warning": "Предупреждение",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "Spara",
|
"save": "Spara",
|
||||||
"saveAndSubmit": "Spara & Skicka in",
|
"generate": "Generera",
|
||||||
"cancel": "Avbryt",
|
"cancel": "Avbryt",
|
||||||
"confirm": "Bekräfta",
|
"confirm": "Bekräfta",
|
||||||
"warning": "Varning",
|
"warning": "Varning",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"saveAndSubmit": "保存并提交",
|
"generate": "生成",
|
||||||
"cancel": "取消",
|
"cancel": "取消",
|
||||||
"confirm": "确认",
|
"confirm": "确认",
|
||||||
"warning": "警告",
|
"warning": "警告",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "儲存",
|
"save": "儲存",
|
||||||
"saveAndSubmit": "儲存並提交",
|
"generate": "生成",
|
||||||
"cancel": "取消",
|
"cancel": "取消",
|
||||||
"confirm": "確認",
|
"confirm": "確認",
|
||||||
"warning": "警告",
|
"warning": "警告",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"save": "儲存",
|
"save": "儲存",
|
||||||
"saveAndSubmit": "儲存並提交",
|
"generate": "生成",
|
||||||
"cancel": "取消",
|
"cancel": "取消",
|
||||||
"confirm": "確認",
|
"confirm": "確認",
|
||||||
"warning": "警告",
|
"warning": "警告",
|
||||||
|
|
|
@ -46,7 +46,7 @@ const EditView = ({
|
||||||
|
|
||||||
if (e.ctrlKey && e.shiftKey) {
|
if (e.ctrlKey && e.shiftKey) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleSaveAndSubmit();
|
handleGenerate();
|
||||||
resetTextAreaHeight();
|
resetTextAreaHeight();
|
||||||
} else if (
|
} else if (
|
||||||
(enterToSubmit && !e.shiftKey) ||
|
(enterToSubmit && !e.shiftKey) ||
|
||||||
|
@ -54,7 +54,7 @@ const EditView = ({
|
||||||
) {
|
) {
|
||||||
if (sticky) {
|
if (sticky) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
handleSaveAndSubmit();
|
handleGenerate();
|
||||||
resetTextAreaHeight();
|
resetTextAreaHeight();
|
||||||
} else {
|
} else {
|
||||||
handleSave();
|
handleSave();
|
||||||
|
@ -81,7 +81,7 @@ const EditView = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const { handleSubmit } = useSubmit();
|
const { handleSubmit } = useSubmit();
|
||||||
const handleSaveAndSubmit = () => {
|
const handleGenerate = () => {
|
||||||
if (useStore.getState().generating) return;
|
if (useStore.getState().generating) return;
|
||||||
const updatedChats: ChatInterface[] = JSON.parse(
|
const updatedChats: ChatInterface[] = JSON.parse(
|
||||||
JSON.stringify(useStore.getState().chats)
|
JSON.stringify(useStore.getState().chats)
|
||||||
|
@ -142,7 +142,7 @@ const EditView = ({
|
||||||
</div>
|
</div>
|
||||||
<EditViewButtons
|
<EditViewButtons
|
||||||
sticky={sticky}
|
sticky={sticky}
|
||||||
handleSaveAndSubmit={handleSaveAndSubmit}
|
handleGenerate={handleGenerate}
|
||||||
handleSave={handleSave}
|
handleSave={handleSave}
|
||||||
setIsModalOpen={setIsModalOpen}
|
setIsModalOpen={setIsModalOpen}
|
||||||
setIsEdit={setIsEdit}
|
setIsEdit={setIsEdit}
|
||||||
|
@ -153,7 +153,7 @@ const EditView = ({
|
||||||
setIsModalOpen={setIsModalOpen}
|
setIsModalOpen={setIsModalOpen}
|
||||||
title={t('warning') as string}
|
title={t('warning') as string}
|
||||||
message={t('clearMessageWarning') as string}
|
message={t('clearMessageWarning') as string}
|
||||||
handleConfirm={handleSaveAndSubmit}
|
handleConfirm={handleGenerate}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
@ -163,14 +163,14 @@ const EditView = ({
|
||||||
const EditViewButtons = memo(
|
const EditViewButtons = memo(
|
||||||
({
|
({
|
||||||
sticky = false,
|
sticky = false,
|
||||||
handleSaveAndSubmit,
|
handleGenerate,
|
||||||
handleSave,
|
handleSave,
|
||||||
setIsModalOpen,
|
setIsModalOpen,
|
||||||
setIsEdit,
|
setIsEdit,
|
||||||
_setContent,
|
_setContent,
|
||||||
}: {
|
}: {
|
||||||
sticky?: boolean;
|
sticky?: boolean;
|
||||||
handleSaveAndSubmit: () => void;
|
handleGenerate: () => void;
|
||||||
handleSave: () => void;
|
handleSave: () => void;
|
||||||
setIsModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
setIsModalOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
||||||
setIsEdit: React.Dispatch<React.SetStateAction<boolean>>;
|
setIsEdit: React.Dispatch<React.SetStateAction<boolean>>;
|
||||||
|
@ -188,11 +188,24 @@ const EditViewButtons = memo(
|
||||||
className={`btn relative mr-2 btn-primary ${
|
className={`btn relative mr-2 btn-primary ${
|
||||||
generating ? 'cursor-not-allowed opacity-40' : ''
|
generating ? 'cursor-not-allowed opacity-40' : ''
|
||||||
}`}
|
}`}
|
||||||
onClick={handleSaveAndSubmit}
|
onClick={handleGenerate}
|
||||||
aria-label={t('saveAndSubmit') as string}
|
aria-label={t('generate') as string}
|
||||||
>
|
>
|
||||||
<div className='flex items-center justify-center gap-2'>
|
<div className='flex items-center justify-center gap-2'>
|
||||||
{t('saveAndSubmit')}
|
{t('generate')}
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{sticky || (
|
||||||
|
<button
|
||||||
|
className='btn relative mr-2 btn-primary'
|
||||||
|
onClick={() => {
|
||||||
|
!generating && setIsModalOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div className='flex items-center justify-center gap-2'>
|
||||||
|
{t('generate')}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
@ -203,7 +216,7 @@ const EditViewButtons = memo(
|
||||||
? `btn-neutral ${
|
? `btn-neutral ${
|
||||||
generating ? 'cursor-not-allowed opacity-40' : ''
|
generating ? 'cursor-not-allowed opacity-40' : ''
|
||||||
}`
|
}`
|
||||||
: 'btn-primary'
|
: 'btn-neutral'
|
||||||
}`}
|
}`}
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
aria-label={t('save') as string}
|
aria-label={t('save') as string}
|
||||||
|
@ -213,20 +226,6 @@ const EditViewButtons = memo(
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{sticky || (
|
|
||||||
<button
|
|
||||||
className='btn relative mr-2 btn-neutral'
|
|
||||||
onClick={() => {
|
|
||||||
!generating && setIsModalOpen(true);
|
|
||||||
}}
|
|
||||||
aria-label={t('saveAndSubmit') as string}
|
|
||||||
>
|
|
||||||
<div className='flex items-center justify-center gap-2'>
|
|
||||||
{t('saveAndSubmit')}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{sticky || (
|
{sticky || (
|
||||||
<button
|
<button
|
||||||
className='btn relative btn-neutral'
|
className='btn relative btn-neutral'
|
||||||
|
|
Loading…
Reference in a new issue