Compare commits
2 Commits
775393dfd1
...
835db6e49f
| Author | SHA1 | Date | |
|---|---|---|---|
| 835db6e49f | |||
| b5dd009d1a |
@ -54,6 +54,7 @@ const FileUpload = ({
|
|||||||
currentFiles.length === 0
|
currentFiles.length === 0
|
||||||
: !currentFiles
|
: !currentFiles
|
||||||
setHasNoItems(noItems)
|
setHasNoItems(noItems)
|
||||||
|
onChange(currentFiles)
|
||||||
}, [currentFiles, multiple])
|
}, [currentFiles, multiple])
|
||||||
|
|
||||||
const handleFileUpload = async (file) => {
|
const handleFileUpload = async (file) => {
|
||||||
@ -68,11 +69,9 @@ const FileUpload = ({
|
|||||||
// For multiple files, add to existing array
|
// For multiple files, add to existing array
|
||||||
const newFiles = [...currentFiles, uploadedFile]
|
const newFiles = [...currentFiles, uploadedFile]
|
||||||
setCurrentFiles(newFiles)
|
setCurrentFiles(newFiles)
|
||||||
onChange(newFiles)
|
|
||||||
} else {
|
} else {
|
||||||
// For single file, replace the value
|
// For single file, replace the value
|
||||||
setCurrentFiles(uploadedFile)
|
setCurrentFiles(uploadedFile)
|
||||||
onChange(uploadedFile)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -88,11 +87,9 @@ const FileUpload = ({
|
|||||||
// For multiple files, add to existing array
|
// For multiple files, add to existing array
|
||||||
const newFiles = [...currentFiles, selectedFile]
|
const newFiles = [...currentFiles, selectedFile]
|
||||||
setCurrentFiles(newFiles)
|
setCurrentFiles(newFiles)
|
||||||
onChange(newFiles)
|
|
||||||
} else {
|
} else {
|
||||||
// For single file, replace the value
|
// For single file, replace the value
|
||||||
setCurrentFiles(selectedFile)
|
setCurrentFiles(selectedFile)
|
||||||
onChange(selectedFile)
|
|
||||||
}
|
}
|
||||||
// Clear the selection
|
// Clear the selection
|
||||||
setSelectedFile(null)
|
setSelectedFile(null)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { createElement } from 'react'
|
import { createElement } from 'react'
|
||||||
import { Flex, Typography, Button, Space, Dropdown, Divider } from 'antd'
|
import { Flex, Typography, Button, Space, Dropdown, Divider, Card } from 'antd'
|
||||||
import { UserOutlined } from '@ant-design/icons'
|
import { UserOutlined } from '@ant-design/icons'
|
||||||
import { useContext } from 'react'
|
import { useContext } from 'react'
|
||||||
import { useNavigate } from 'react-router-dom'
|
import { useNavigate } from 'react-router-dom'
|
||||||
@ -17,7 +17,9 @@ const UserProfilePopover = ({ onClose }) => {
|
|||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
|
|
||||||
const modelActions = User.actions || []
|
const modelActions = User.actions || []
|
||||||
const iconActions = modelActions.filter((a) => ICON_ACTION_NAMES.includes(a.name))
|
const iconActions = modelActions.filter((a) =>
|
||||||
|
ICON_ACTION_NAMES.includes(a.name)
|
||||||
|
)
|
||||||
const dropdownActions = modelActions.filter(
|
const dropdownActions = modelActions.filter(
|
||||||
(a) => !ICON_ACTION_NAMES.includes(a.name)
|
(a) => !ICON_ACTION_NAMES.includes(a.name)
|
||||||
)
|
)
|
||||||
@ -96,9 +98,20 @@ const UserProfilePopover = ({ onClose }) => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<UserOutlined
|
<Card
|
||||||
style={{ fontSize: 48, color: 'var(--color-text-secondary)' }}
|
style={{ borderRadius: '5px', width: 76, height: 76 }}
|
||||||
/>
|
styles={{ body: { padding: 0, height: '100%' } }}
|
||||||
|
>
|
||||||
|
<Flex justify='center' align='center' style={{ height: '100%' }}>
|
||||||
|
<UserOutlined
|
||||||
|
style={{
|
||||||
|
fontSize: 32,
|
||||||
|
color: 'var(--color-text-secondary)',
|
||||||
|
marginBottom: 2
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Flex>
|
||||||
|
</Card>
|
||||||
)}
|
)}
|
||||||
<Flex vertical style={{ minWidth: 0 }}>
|
<Flex vertical style={{ minWidth: 0 }}>
|
||||||
{fullName && (
|
{fullName && (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user