mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-21 06:59:33 +02:00
Merge branch 'main' into link-bug-fix
This commit is contained in:
@@ -101,11 +101,7 @@ const Navbar: React.FC<NavbarProps> = ({ onSwitchTheme }) => {
|
||||
}}
|
||||
>
|
||||
<Link to="/">
|
||||
<img
|
||||
src={logo}
|
||||
width={isMobile ? '80px' : '150px'}
|
||||
style={{ pointerEvents: 'none' }}
|
||||
/>
|
||||
<img src={logo} width={isMobile ? '80px' : '150px'} />
|
||||
</Link>
|
||||
{isMobile ? (
|
||||
<>
|
||||
|
@@ -33,18 +33,15 @@ export default function BaseFileInput({
|
||||
const { showSnackBar } = useContext(CustomSnackBarContext);
|
||||
|
||||
useEffect(() => {
|
||||
try {
|
||||
if (isArray(value)) {
|
||||
const objectUrl = createObjectURL(value[0]);
|
||||
if (value) {
|
||||
try {
|
||||
const objectUrl = createObjectURL(value);
|
||||
setPreview(objectUrl);
|
||||
|
||||
return () => revokeObjectURL(objectUrl);
|
||||
} else {
|
||||
setPreview(null);
|
||||
} catch (error) {
|
||||
console.error('Error previewing file:', error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error previewing file:', error);
|
||||
}
|
||||
} else setPreview(null);
|
||||
}, [value]);
|
||||
|
||||
const handleFileChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
@@ -70,11 +67,6 @@ export default function BaseFileInput({
|
||||
}
|
||||
};
|
||||
|
||||
function handleClear() {
|
||||
// @ts-ignore
|
||||
onChange(null);
|
||||
}
|
||||
|
||||
const handleDrop = (event: React.DragEvent<HTMLDivElement>) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
@@ -216,11 +208,7 @@ export default function BaseFileInput({
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
<InputFooter
|
||||
handleCopy={handleCopy}
|
||||
handleImport={handleImportClick}
|
||||
handleClear={handleClear}
|
||||
/>
|
||||
<InputFooter handleCopy={handleCopy} handleImport={handleImportClick} />
|
||||
<input
|
||||
ref={fileInputRef}
|
||||
style={{ display: 'none' }}
|
||||
|
Reference in New Issue
Block a user