Skip to content

Commit

Permalink
fix: pin functionality issue in the comment dropdown menu
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysingh2219 committed Aug 12, 2024
1 parent 349ea5a commit 5848298
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
3 changes: 0 additions & 3 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
'use client';

import { Button } from '@/components/ui/button';
import { InfoIcon } from 'lucide-react';
import Link from 'next/link';
import { useEffect } from 'react';

export default function ErrorPage({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
Expand Down
4 changes: 2 additions & 2 deletions src/components/comment/CommentApproveForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const CommentApproveForm = ({
});
};
return (
<form onSubmit={handleFormSubmit}>
<button type="submit" disabled={isLoading}>
<form className="w-full" onSubmit={handleFormSubmit}>
<button className="w-full" type="submit" disabled={isLoading}>
<div className="flex items-center gap-1">
Approve Chapters <CheckIcon className="h-4 w-4" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/comment/CommentDeleteForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const CommentDeleteForm = ({ commentId }: { commentId: number }) => {
});
};
return (
<form onSubmit={handleFormSubmit}>
<button type="submit" disabled={isLoading}>
<form className="w-full" onSubmit={handleFormSubmit}>
<button className="w-full" type="submit" disabled={isLoading}>
<div className="flex items-center gap-x-2">
Delete <Trash2Icon className="h-4 w-4" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/comment/CommentPinForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const CommentPinForm = ({
});
};
return (
<form onSubmit={handleFormSubmit}>
<button type="submit" disabled={isLoading}>
<form className="w-full" onSubmit={handleFormSubmit}>
<button className="w-full" type="submit" disabled={isLoading}>
<div className="flex items-center gap-1">
Pin <PinIcon className="h-4 w-4" />
</div>
Expand Down
10 changes: 5 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"paths": {
"@/*": ["./src/*"],
"@public/*": ["./public/*"]
}
"@public/*": ["./public/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}

0 comments on commit 5848298

Please sign in to comment.