Skip to content

Commit

Permalink
fixed image upload modal (#6666)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijv256 authored Nov 22, 2023
1 parent 3eade87 commit 0787ed7
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/Components/Facility/CoverImageEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,10 @@ const CoverImageEditModal = ({
</form>
) : (
<div className="flex max-h-screen min-h-[24rem] flex-col overflow-auto">
<div className="flex flex-col bg-gray-300">
<div className="mb-1 mt-2 flex flex-col">
<span className="text-xl font-medium">
{t("capture_cover_photo")}
</span>
<span className="mt-1 text-gray-700">{facility.name}</span>
</div>
<div className="flex flex-1 items-center justify-center">
{!previewImage ? (
Expand All @@ -326,10 +325,13 @@ const CoverImageEditModal = ({
)}
</div>
{/* buttons for mobile screens */}
<div className="m-4 flex justify-evenly sm:hidden ">
<div className="m-4 flex flex-col justify-evenly sm:hidden ">
<div>
{!previewImage ? (
<ButtonV2 onClick={handleSwitchCamera} className="m-2">
<ButtonV2
onClick={handleSwitchCamera}
className="my-2 w-full"
>
{t("switch")}
</ButtonV2>
) : (
Expand All @@ -344,25 +346,25 @@ const CoverImageEditModal = ({
onClick={() => {
captureImage();
}}
className="m-2"
className="my-2 w-full"
>
{t("capture")}
</ButtonV2>
</div>
</>
) : (
<>
<div className="flex space-x-2">
<div className="flex flex-col">
<ButtonV2
onClick={() => {
setPreviewImage(null);
}}
className="m-2"
className="my-2 w-full"
disabled={isUploading}
>
{t("retake")}
</ButtonV2>
<ButtonV2 onClick={handleUpload} className="m-2">
<ButtonV2 onClick={handleUpload} className="my-2 w-full">
{isCaptureImgBeingUploaded && (
<CareIcon className="care-l-spinner animate-spin text-lg" />
)}
Expand All @@ -380,7 +382,7 @@ const CoverImageEditModal = ({
setIsCameraOpen(false);
webRef.current.stopCamera();
}}
className="m-2"
className="border-grey-200 my-2 w-full border-2"
>
{t("close")}
</ButtonV2>
Expand Down

0 comments on commit 0787ed7

Please sign in to comment.