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

Added date-field reusable component; Migrated old DateFormFields to new UI components #10049

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
TextAreaFormField is replaced with TextArea ui component
  • Loading branch information
NikhilA8606 committed Jan 23, 2025
commit 33fd7e88856e240f0ed22e56ca0c3b3ea608d73b
59 changes: 0 additions & 59 deletions src/components/Form/FormFields/DateFormField.tsx

This file was deleted.

29 changes: 18 additions & 11 deletions src/hooks/useFileManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import { t } from "i18next";
import { useState } from "react";
import { toast } from "sonner";

import { cn } from "@/lib/utils";

import CareIcon from "@/CAREUI/icons/CareIcon";

import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";

import DialogModal from "@/components/Common/Dialog";
import FilePreviewDialog from "@/components/Common/FilePreviewDialog";
import { StateInterface } from "@/components/Files/FileUpload";
import TextAreaFormField from "@/components/Form/FormFields/TextAreaFormField";
import TextFormField from "@/components/Form/FormFields/TextFormField";
import { FileUploadModel } from "@/components/Patient/models";

Expand Down Expand Up @@ -290,22 +293,26 @@ export default function useFileManager(
className="mx-2 my-4 flex w-full flex-col"
>
<div>
<TextAreaFormField
<Label className="text-gray-800 mb-2">
State the reason for archiving <b>{archiveDialogueOpen?.name}</b>{" "}
file?
</Label>
<Textarea
name="editFileName"
id="archive-file-reason"
label={
<span>
State the reason for archiving{" "}
<b>{archiveDialogueOpen?.name}</b> file?
</span>
}
rows={6}
required
placeholder="Type the reason..."
value={archiveReason}
onChange={(e) => setArchiveReason(e.value)}
error={archiveReasonError}
onChange={(e) => setArchiveReason(e.target.value)}
className={cn(
archiveReasonError &&
"border-red-500 focus-visible:ring-red-500",
)}
/>
{archiveReasonError && (
<p className="text-sm text-red-500">{archiveReasonError}</p>
)}
</div>
<div className="mt-4 flex flex-col-reverse justify-end gap-2 md:flex-row">
<Button
Expand All @@ -316,7 +323,7 @@ export default function useFileManager(
{t("cancel")}
</Button>
<Button type="submit" variant="primary" disabled={archiving}>
{t("proceed")}
{t("Proceed")}
</Button>
</div>
</form>
Expand Down
Loading