Skip to content

Commit

Permalink
solved duplicate comment error
Browse files Browse the repository at this point in the history
  • Loading branch information
mvp5464 committed Jun 16, 2024
1 parent 7bab81c commit e9e92f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/components/Certificate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,7 @@ export const CertificateComponent = ({
</Button>
<div className="flex items-center justify-center">
<Button
<<<<<<< tailwind-prettier
className="share-button mr-2 flex items-center bg-transparent"
=======
className="share-button flex items-center mr-2"
>>>>>>> main
onClick={handleShareLinkedIn}
>
<FaLinkedin className="mr-1" /> Share on LinkedIn
Expand Down
10 changes: 8 additions & 2 deletions src/components/comment/CommentInputForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CommentInputForm = ({
const currentPath = usePathname();
const formRef = React.useRef<HTMLFormElement>(null);
const textareaRef = React.useRef<HTMLTextAreaElement>(null);
const { execute, fieldErrors } = useAction(createMessage, {
const { execute, isLoading, fieldErrors } = useAction(createMessage, {
onSuccess: () => {
toast('Comment added');
formRef.current?.reset();
Expand Down Expand Up @@ -62,7 +62,13 @@ const CommentInputForm = ({
/>
<FormErrors id="content" errors={fieldErrors} />
<div className="flex justify-end gap-2">
<Button type="submit">Comment</Button>
<Button
type="submit"
className={`${isLoading && 'opacity-80'}`}
disabled={isLoading}
>
Comment
</Button>
</div>
</form>
);
Expand Down

0 comments on commit e9e92f5

Please sign in to comment.