From 60f74759216fffdc67b2e8858cf06cd023fe1afd Mon Sep 17 00:00:00 2001 From: Michael Stedman <46408716+recondesigns@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:36:41 -0600 Subject: [PATCH] removed code comments and added prop type descriptions --- .../Cards/ResourceCard/ResourceCard.tsx | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/components/Cards/ResourceCard/ResourceCard.tsx b/components/Cards/ResourceCard/ResourceCard.tsx index b923e50ba..afc8fac68 100644 --- a/components/Cards/ResourceCard/ResourceCard.tsx +++ b/components/Cards/ResourceCard/ResourceCard.tsx @@ -153,45 +153,50 @@ export const possibleUserVotes = { none: null, }; -// ResourceCard.propTypes = { -// description: string, -// downvotes: number, -// href: string.isRequired, -// name: string.isRequired, -// id: number.isRequired, -// category: string, -// languages: oneOfType([string, array]), -// isFree: bool, -// handleVote: func, -// upvotes: number, -// userVote: oneOf(Object.values(possibleUserVotes)), -// }; - export type ResourceCardPropType = { + /** + * Url path for the link. + */ href: string; + /** + * Name of the resource applied to the resource title link. + */ name: string; + /** + * Applies an id to the component. + */ id: number; + /** + * Optional description of the resource. + */ description?: string; + /** + * Number of "down" votes. + */ downvotes?: number; + /** + * Sets the category text. + */ category?: string; + /** + * Applies the resource languages. + */ languages?: string | string[]; + /** + * Sets indictor that resource is free. + */ isFree?: boolean; + /** + * Function to handle the vote. + */ handleVote?: () => void; + /** + * Number of "up" votes. + */ upvotes?: number; userVote?: keyof typeof possibleUserVotes | null; }; -// ResourceCard.defaultProps = { -// description: '', -// downvotes: 0, -// category: '', -// languages: [], -// isFree: false, -// handleVote: () => {}, -// upvotes: 0, -// userVote: possibleUserVotes.none, -// }; - function ResourceCard({ description = '', downvotes = 0,