Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix container collision #202

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 21 additions & 18 deletions apps/web/src/components/UploadInterface/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,44 +177,47 @@ const UploadInterface = () => {
)}

<form
className="relative flex w-full rounded-lg border border-gray-200 bg-white p-4 shadow-md"
className="relative flex w-full flex-row justify-between rounded-lg border border-gray-200 bg-white p-4 shadow-md"
id="upload-form"
onSubmit={onSubmit}
>
<input
type="url"
ref={urlInputRef}
onChange={onInputChange}
className="w-full border-none bg-transparent pr-3 text-lg outline-none"
placeholder={
!isLocalUpload
? "Drop your OpenAPI 3.x file or enter your OpenAPI file URL here"
: ""
}
aria-label="Enter OpenAPI 3.x file URL here"
disabled={!!file}
/>
{!isLocalUpload && !file && !isValidUrlInput && (
<input
type="url"
ref={urlInputRef}
onChange={onInputChange}
className="w-full border-none bg-transparent pr-3 text-lg outline-none"
placeholder={
!isLocalUpload
? "Drop your OpenAPI 3.x file or enter your OpenAPI file URL here"
: ""
}
aria-label="Enter OpenAPI 3.x file URL here"
disabled={!!file}
/>
)}

<input
ref={fileInputRef}
onChange={onLocalFileUploadInputChange}
className="hidden"
className="hidden h-0 w-0"
type="file"
name="drag-upload"
accept=".json,.yaml,.yml"
/>

{isLocalUpload && (
<button
onClick={onClear}
className="absolute flex items-center rounded-lg bg-gray-200 p-2 text-lg hover:bg-gray-300"
className="flex items-center rounded-lg bg-gray-200 p-2 text-lg hover:bg-gray-300"
>
<DocumentIcon
height={24}
width={24}
className="mr-1 text-gray-900"
/>
<span>{file?.name}</span>
<span className="max-w-[170px] overflow-hidden whitespace-nowrap md:max-w-[500px]">
{file?.name}
</span>
<XMarkIcon height={24} width={24} className="ml-3 text-gray-900" />
</button>
)}
Expand Down