diff --git a/src/i18n/localization/locales/en/translation.json b/src/i18n/localization/locales/en/translation.json index 71b23be..191f8d3 100644 --- a/src/i18n/localization/locales/en/translation.json +++ b/src/i18n/localization/locales/en/translation.json @@ -524,6 +524,7 @@ "Delete": "Delete", "Edit": "Edit", "Open": "Open", + "Close": "Close", "Import": { "ImportWiki": "Import Wiki" }, diff --git a/src/i18n/localization/locales/zh_CN/translation.json b/src/i18n/localization/locales/zh_CN/translation.json index 7e020aa..686a6a7 100644 --- a/src/i18n/localization/locales/zh_CN/translation.json +++ b/src/i18n/localization/locales/zh_CN/translation.json @@ -496,6 +496,7 @@ "Description": "描述", "Tags": "标签", "Open": "打开", + "Close": "关闭", "Edit": "编辑", "Share": { "SharedContent": "分享内容", diff --git a/src/pages/MainMenu/EditItemModel/PerformanceToolsModelContent.tsx b/src/pages/MainMenu/EditItemModel/PerformanceToolsModelContent.tsx index 0ef9e96..bc7e556 100644 --- a/src/pages/MainMenu/EditItemModel/PerformanceToolsModelContent.tsx +++ b/src/pages/MainMenu/EditItemModel/PerformanceToolsModelContent.tsx @@ -1,6 +1,6 @@ -import React from 'react'; +import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { Button, Switch, Text } from 'react-native-paper'; +import { Button, Switch, Text, TextInput } from 'react-native-paper'; import { styled } from 'styled-components/native'; import { FlexibleText, SwitchContainer } from '../../../components/PreferenceWidgets'; @@ -19,6 +19,7 @@ export function PerformanceToolsModelContent({ id, onClose }: ModalProps): JSX.E id === undefined ? undefined : state.workspaces.find((w): w is IWikiWorkspace => w.id === id && (w.type === undefined || w.type === 'wiki')) ); const updateWorkspace = useWorkspaceStore(state => state.update); + const [editedSelectiveSyncFilter, setEditedSelectiveSyncFilter] = useState(wiki?.selectiveSyncFilter ?? ''); if (id === undefined || wiki === undefined) { return ( @@ -35,6 +36,9 @@ export function PerformanceToolsModelContent({ id, onClose }: ModalProps): JSX.E {t('AddWorkspace.ImportBinaryFiles')} + + + {t('Preference.EnableQuickLoad')} @@ -64,3 +68,6 @@ const SectionContainer = styled.View` align-items: stretch; margin-top: 15px; `; +const StyledTextInput = styled(TextInput)` + margin-bottom: 10px; +`; diff --git a/src/pages/MainMenu/EditItemModel/WikiModelContent.tsx b/src/pages/MainMenu/EditItemModel/WikiModelContent.tsx index 6f4024e..1713494 100644 --- a/src/pages/MainMenu/EditItemModel/WikiModelContent.tsx +++ b/src/pages/MainMenu/EditItemModel/WikiModelContent.tsx @@ -2,7 +2,7 @@ /* eslint-disable @typescript-eslint/strict-boolean-expressions */ /* eslint-disable unicorn/no-null */ import * as Haptics from 'expo-haptics'; -import React, { useCallback, useState } from 'react'; +import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Alert } from 'react-native'; import { Button, Modal, Portal, Text, TextInput, useTheme } from 'react-native-paper'; @@ -33,7 +33,6 @@ export function WikiEditModalContent({ id, onClose }: WikiEditModalProps): JSX.E const [updateWiki, deleteWiki, setServerActive] = useWorkspaceStore(state => [state.update, state.remove, state.setServerActive]); const [editedName, setEditedName] = useState(wiki?.name ?? ''); - const [editedSelectiveSyncFilter, setEditedSelectiveSyncFilter] = useState(wiki?.selectiveSyncFilter ?? ''); const [editedWikiFolderLocation, setEditedWikiFolderLocation] = useState(wiki?.wikiFolderLocation ?? ''); const [selectedServerID, setSelectedServerID] = useState(); const [serverModalVisible, setServerModalVisible] = useState(false); @@ -42,15 +41,6 @@ export function WikiEditModalContent({ id, onClose }: WikiEditModalProps): JSX.E const [performanceToolsModelVisible, setPerformanceToolsModelVisible] = useState(false); const [expandServerList, setExpandServerList] = useState(false); - const handleSave = useCallback(() => { - if (id === undefined) return; - updateWiki(id, { - name: editedName, - selectiveSyncFilter: editedSelectiveSyncFilter, - }); - onClose(); - }, [editedName, editedSelectiveSyncFilter, id, onClose, updateWiki]); - if (id === undefined || wiki === undefined) { return ( @@ -61,8 +51,16 @@ export function WikiEditModalContent({ id, onClose }: WikiEditModalProps): JSX.E return ( - - + { + setEditedName(editedName); + updateWiki(id, { + name: editedName, + }); + }} + /> @@ -118,18 +116,12 @@ export function WikiEditModalContent({ id, onClose }: WikiEditModalProps): JSX.E - - +