![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@commont/react
Advanced tools
Effortlessly add a comment section to your website, and start the discussion on your content.
To use Commont, you need to create a new account via our signup page. You can sign up using an email and password or by using GitHub or Google. Once you have an account, you can access the Commont dashboard. Initially, you'll see one default project that you can configure as you need.
👀 Read the docs for more information.
yarn add @commont/react commont # npm install @commont/react
The package exports a useComments
hook that you can use to fetch the comments
for your project.
useComments
fetches comments from the backend on mount and whenever take or
skip change.
useComments
takes an object with the following parameters:
import { useComments, CommentStatus } from '@commont/react';
const Post = ({ projectId }) => {
const { comments, count, loading, refetch, error } = useComments({
projectId,
topic: 'post-id'
take: 10, skip: 0
});
return (
<section>
<h3>{count} comments</h3>
{loading ? (
<p>Loading...</p>
) : (
<div>
{comments.map(({ author, content, createdAt, status }) => (
<article key={createdAt} className="bg-gray-100 rounded my-6 p-4">
<div className="font-bold mb-2">
{author} ・ {new Date(createdAt).toLocaleDateString()}
</div>
<p className="text-gray-700">{content}</p>
</article>
))}
</div>
)}
</section>
)
}
interface UseCommentsComment {
topic: string;
author: string;
content: string;
createdAt: string;
status?: UseCommentsStatus;
details?: Record<string, any>;
}
When a user adds a new comment, it will be in one of four states:
type UseCommentsStatus =
| 'sending'
| 'added'
| 'delivered-awaiting-approval'
| 'failed';
interface UseCommentsParameters {
projectId: string;
topic: string;
take?: number;
skip?: number;
}
interface UseComentsResult {
comments: UseCommentsComment[];
addComment: ({
content,
author,
}: Pick<UseCommentsComment, 'content' | 'author' | 'details'>) => void;
refetch: () => void;
count: number;
loading: boolean;
error: string | null;
}
FAQs
Effortlessly add a comment section to your website, and start the discussion on your content.
We found that @commont/react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.