Skip to content

Commit

Permalink
Replaced all TextAreaFormField with Textarea ui
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilA8606 committed Jan 29, 2025
1 parent 0f82aa0 commit 982787b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@
"no_beds_available": "No beds available",
"no_changes": "No changes",
"no_changes_made": "No changes made",
"no_comments_available": "No comments available",
"no_consultation_filed": "No consultation filed",
"no_consultation_history": "No consultation history available",
"no_consultation_updates": "No consultation updates",
Expand Down
14 changes: 7 additions & 7 deletions src/components/Resource/ResourceCommentSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { toast } from "sonner";
import PaginatedList from "@/CAREUI/misc/PaginatedList";

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

import { Avatar } from "@/components/Common/Avatar";
import CircularProgress from "@/components/Common/CircularProgress";
import TextAreaFormField from "@/components/Form/FormFields/TextAreaFormField";

import routes from "@/Utils/request/api";
import request from "@/Utils/request/request";
Expand Down Expand Up @@ -42,28 +42,28 @@ const CommentSection = (props: { id: string }) => {
>
{(_, query) => (
<div className="flex w-full flex-col">
<TextAreaFormField
<Textarea
name="comment"
placeholder="Type your comment"
placeholder={t("type_your_comment")}
value={commentBox}
onChange={(e) => setCommentBox(e.value)}
onChange={(e) => setCommentBox(e.target.value)}
/>

<div className="flex w-full justify-end">
<div className="flex w-full justify-end mt-2">
<Button
variant="primary"
onClick={async () => {
await onSubmitComment();
query.refetch();
}}
>
Post Your Comment
{t("post_your_comment")}
</Button>
</div>
<div className="w-full">
<div>
<PaginatedList.WhenEmpty className="flex w-full justify-center border-b border-secondary-200 bg-white p-5 text-center text-2xl font-bold text-secondary-500">
<span>No comments available</span>
<span>{t("no_comments_available")}</span>
</PaginatedList.WhenEmpty>
<PaginatedList.WhenLoading>
<CircularProgress className="h-12 w-12" />
Expand Down
6 changes: 3 additions & 3 deletions src/components/Resource/ResourceCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Separator } from "@/components/ui/separator";
import { Textarea } from "@/components/ui/textarea";

import { FacilitySelect } from "@/components/Common/FacilitySelect";
import Loading from "@/components/Common/Loading";
import Page from "@/components/Common/Page";
import { PhoneNumberValidator } from "@/components/Form/FieldValidators";
import PhoneNumberFormField from "@/components/Form/FormFields/PhoneNumberFormField";
import TextAreaFormField from "@/components/Form/FormFields/TextAreaFormField";
import TextFormField from "@/components/Form/FormFields/TextFormField";

import useAppHistory from "@/hooks/useAppHistory";
Expand Down Expand Up @@ -350,11 +350,11 @@ export default function ResourceCreate(props: ResourceProps) {
<FormItem>
<FormLabel>{t("request_reason")}</FormLabel>
<FormControl>
<TextAreaFormField
<Textarea
{...field}
rows={5}
placeholder={t("request_reason_placeholder")}
onChange={(value) => field.onChange(value.value)}
onChange={(e) => field.onChange(e.target.value)}
/>
</FormControl>
<FormDescription>
Expand Down

0 comments on commit 982787b

Please sign in to comment.