![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
react-file-chooser
Advanced tools
a helper for choosing a file in react application.
with npm:
npm install react-file-chooser
with yarn:
yarn add react-file-chooser
with pnpm:
pnpm add react-file-chooser
with drag and drop
export const FileChooser = () => {
const { onChange, onDrag, destroy, isDragging, error, imageDataUrl } =
useFileChooser()
return (
<div className="flex flex-col gap-4 items-center justify-center">
{!!error && <p className="py-2 text-red-500">{error}</p>}
<label
onDragOver={(e) => e.preventDefault()}
onDragLeave={(e) => onDrag(e, false)}
onDragEnter={(e) => onDrag(e, true)}
onDrop={(e) => onChange(e, true)}
htmlFor="file"
className={`${
isDragging && 'bg-blue-50'
} relative cursor-pointer w-96 h-56 border border-dashed border-blue-400 p-20 flex flex-col justify-center items-center gap-2 hover:bg-blue-50 duration-150 transition rounded-2xl`}
>
<input
type="file"
id="file"
className="hidden"
onChange={(e) => onChange(e, false)}
/>
{!imageDataUrl && (
<>
<ArrowUpTrayIcon className="w-5 h-5" />
<span className="text-blue-500 text-sm">
Browse <span className="text-black/50">or</span> Drag & Drop
</span>
</>
)}
{!!imageDataUrl && (
<>
<img
src={imageDataUrl}
className="border border-black/5 w-32 h-32 rounded-full aspect-square object-cover object-center"
/>
</>
)}
{!!imageDataUrl && (
<span className="absolute top-2 right-2">
<button onClick={(e) => destroy(e)}>
<XMarkIcon className="w-5 h-5 fill-black" />
</button>
</span>
)}
</label>
</div>
)
}
without drag and drop
export const FileChooser = () => {
const { onChange, onDrag, destroy, isDragging, error, imageDataUrl } =
useFileChooser()
return (
<div className="flex flex-col gap-4 items-center justify-center">
{!!error && <p className="py-2 text-red-500">{error}</p>}
<label
htmlFor="file"
className={`${
isDragging && 'bg-blue-50'
} relative cursor-pointer w-96 h-56 border border-dashed border-blue-400 p-20 flex flex-col justify-center items-center gap-2 hover:bg-blue-50 duration-150 transition rounded-2xl`}
>
<input
type="file"
id="file"
className="hidden"
onChange={(e) => onChange(e, false)}
/>
{!imageDataUrl && (
<>
<ArrowUpTrayIcon className="w-5 h-5" />
<span className="text-blue-500 text-sm">
Browse <span className="text-black/50">or</span> Drag & Drop
</span>
</>
)}
{!!imageDataUrl && (
<>
<img
src={imageDataUrl}
className="border border-black/5 w-32 h-32 rounded-full aspect-square object-cover object-center"
/>
</>
)}
{!!imageDataUrl && (
<span className="absolute top-2 right-2">
<button onClick={(e) => destroy(e)}>
<XMarkIcon className="w-5 h-5 fill-black" />
</button>
</span>
)}
</label>
</div>
)
}
FAQs
a helper for choosing a file in react application.
The npm package react-file-chooser receives a total of 0 weekly downloads. As such, react-file-chooser popularity was classified as not popular.
We found that react-file-chooser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.