Skip to content

Commit

Permalink
Feature/request count for post and user (#368)
Browse files Browse the repository at this point in the history
* style: update style

* feat: replace FormTextInput with FormTextArea

* feat: add count

* fix: reset submit state when error in edit post

* feat: update types

---------

Co-authored-by: Pjaijai <[email protected]>
  • Loading branch information
Pjaijai and pauljaijai authored May 9, 2024
1 parent 51b2467 commit d206ae3
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 23 deletions.
4 changes: 2 additions & 2 deletions client/modules/chat/components/forms/message/message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import useGetMediaPublicUrl from "@/hooks/api/storage/get-media-url"
import useUserStore from "@/hooks/state/user/store"
import { Form } from "@/components/ui/form"
import { useToast } from "@/components/ui/use-toast"
import FormTextInput from "@/components/customized-ui/form/input"
import FormTextArea from "@/components/customized-ui/form/text-area"
import { Icons } from "@/components/icons"

interface ISendMessageFormProps {
Expand Down Expand Up @@ -235,7 +235,7 @@ const SendMessageForm: React.FunctionComponent<ISendMessageFormProps> = ({
)}
<div className="flex w-full flex-row">
<div className="relative w-full">
<FormTextInput
<FormTextArea
control={form.control}
name="message"
placeholder={t("chat.form.message_placeholder")}
Expand Down
4 changes: 2 additions & 2 deletions client/modules/main/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const MainPageTemplate = ({

return (
<div className="relative mt-2 flex h-screen w-full flex-row items-center justify-center md:h-auto">
<div className="relative z-30 mx-auto h-full w-full max-w-7xl overflow-hidden p-4 ">
<div className="relative z-30 mx-auto h-fit w-full max-w-7xl overflow-hidden p-4 ">
<motion.div
initial={{
opacity: 0,
Expand Down Expand Up @@ -99,7 +99,7 @@ const MainPageTemplate = ({
<PostCarousel list={posts} />
</div>

<div className="mt-32 p-4">
<div className="mt-4 p-4 md:mt-32">
<ContactRequestCarousel list={contactList} />
</div>
</motion.div>
Expand Down
3 changes: 2 additions & 1 deletion client/modules/post/edit/template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useRouter } from "next/navigation"
import usePostTypeOptions from "@/modules/post/hooks/post-type-options"
import { useI18n } from "@/utils/services/internationalization/client"
import { zodResolver } from "@hookform/resolvers/zod"
import { useForm } from "react-hook-form"
import { set, useForm } from "react-hook-form"
import { z } from "zod"

import { ICityResponse } from "@/types/api/response/city"
Expand Down Expand Up @@ -249,6 +249,7 @@ const EditPostPageTemplate: React.FunctionComponent<
router.push(`${siteConfig.page.viewPost.href}/${postUuid}`)
},
onError: () => {
setIsSubmitting(false)
return toast({
title: t("general.error.title"),
description: t("general.error.description"),
Expand Down
Loading

0 comments on commit d206ae3

Please sign in to comment.