fix: Adjust file upload and navbar styling for cross-platform compatibility

- Update Dragger component to use customRequest for file uploads
- Add Windows-specific padding adjustment for navbar right section
This commit is contained in:
kangfenmao 2025-02-26 13:33:21 +08:00
parent 6554a3817b
commit aab318e8ca
2 changed files with 3 additions and 2 deletions

View File

@ -243,7 +243,7 @@ const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
</TitleWrapper>
<Dragger
showUploadList={false}
onDrop={({ dataTransfer }) => handleDrop([...dataTransfer.files])}
customRequest={({ file }) => handleDrop([file as File])}
multiple={true}
accept={fileTypes.join(',')}
style={{ marginTop: 10, background: 'transparent' }}>

View File

@ -12,6 +12,7 @@ import { HStack } from '@renderer/components/Layout'
import ListItem from '@renderer/components/ListItem'
import PromptPopup from '@renderer/components/Popups/PromptPopup'
import Scrollbar from '@renderer/components/Scrollbar'
import { isWindows } from '@renderer/config/constant'
import { useKnowledgeBases } from '@renderer/hooks/useKnowledge'
import { useShortcut } from '@renderer/hooks/useShortcuts'
import { NavbarIcon } from '@renderer/pages/home/Navbar'
@ -253,7 +254,7 @@ const NarrowIcon = styled(NavbarIcon)`
const NavbarRight = styled(NavbarRightFromComponents)`
min-width: auto;
padding-right: 140px;
padding-right: ${isWindows ? '140px' : 15};
`
export default KnowledgePage