diff --git a/components/tools/CardData.tsx b/components/tools/CardData.tsx index 96bdbe3d910..6071529ed4e 100644 --- a/components/tools/CardData.tsx +++ b/components/tools/CardData.tsx @@ -50,6 +50,7 @@ export const CardData = ({ }; const domNode = useRef(null); + // Decide whether to show full description or not in the card based on the number of lines occupied by the description. useEffect(() => { const divHeight = domNode.current?.offsetHeight || 0; const numberOfLines = divHeight / 20; @@ -61,6 +62,7 @@ export const CardData = ({ } }, [visible]); + // Decide whether the user click outside this component (card description) or not. useEffect(() => { const maybeHandler = (event: MouseEvent) => { setOutsideClick(true); diff --git a/components/tools/CategoryDropdown.tsx b/components/tools/CategoryDropdown.tsx index 522bcd299f1..f8b934c7f29 100644 --- a/components/tools/CategoryDropdown.tsx +++ b/components/tools/CategoryDropdown.tsx @@ -26,7 +26,6 @@ export default function CategoryDropdown({ setopenCategory }: CategoryDropdownPr {categoryName} ); } - return null; })} diff --git a/components/tools/Tags.tsx b/components/tools/Tags.tsx index b1c9e5ccda9..0608277df7d 100644 --- a/components/tools/Tags.tsx +++ b/components/tools/Tags.tsx @@ -5,7 +5,7 @@ interface SelectTagsProps { }; /** - * @description This component displays tags. + * @description This component displays tags. These tags are displayed for languages and technologies in the tools card. * * @param {SelectTagsProps} props - The props for the Select Tags component. * @param {string} props.name - The content to be displayed inside the tag. diff --git a/components/tools/ToolsList.tsx b/components/tools/ToolsList.tsx index 6f1bb4780a0..30259a52ce0 100644 --- a/components/tools/ToolsList.tsx +++ b/components/tools/ToolsList.tsx @@ -20,24 +20,26 @@ export default function ToolsList({ toolsListData }: ToolsListProp) { return (
{Object.keys(toolsListData).map((categoryName, index) => { - if (toolsListData[categoryName].toolsList.length > 0) return ( -
- - {categoryName} - - - {toolsListData[categoryName].description} - -
-
- {toolsListData[categoryName].toolsList.map((tool, toolIndex) => ( - - ))} + if (toolsListData[categoryName].toolsList.length > 0) { + return ( +
+ + {categoryName} + + + {toolsListData[categoryName].description} + +
+
+ {toolsListData[categoryName].toolsList.map((tool, toolIndex) => ( + + ))} +
-
- ); - - return null; + ); + } else { + return null; + } })}
); diff --git a/scripts/tools/categorylist.ts b/scripts/tools/categorylist.js similarity index 97% rename from scripts/tools/categorylist.ts rename to scripts/tools/categorylist.js index 0f8d029658f..b9fe03f2904 100644 --- a/scripts/tools/categorylist.ts +++ b/scripts/tools/categorylist.js @@ -1,7 +1,5 @@ -import { Category } from "@/types/components/tools/ToolDataType"; - // Various categories to define the category in which a tool has to be listed -const categoryList: Category[] = [ +const categoryList = [ { name: "APIs", tag: "api",