Skip to content

Commit 0b02b39

Browse files
authored
Added Feedback For "0 Tools Found" In the Tools Page[Closes-#1282] (#1462)
* added dynamic icons to the filter in tools page * added dynamic icons to the filter in tools page * added dynamic icons to the filter in tools page * added dynamic icons to the filter in tools page * added dynamic icons to the filter in tools page * to save before switching * added proper icons to each filter on tools page * Revert "added dynamic icons to the filter in tools page" This reverts commit b41272d. * Revert "added dynamic icons to the filter in tools page" This reverts commit 8b5c652. * Revert "to save before switching" This reverts commit 8e903d7. * reverting changes * reverting the changes in sublodules * revert submodule changes * fixed prettier errors * added a feedback box for 0 tools found * rolled back unnecessary changes
1 parent dead1e7 commit 0b02b39

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pages/tools/components/ToolingTable.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ interface ToolingTableProps {
2424
toolsByGroup: GroupedTools;
2525
transform: Transform;
2626
setTransform: Dispatch<SetStateAction<Transform>>;
27+
numberOfTools: number;
2728
}
2829

2930
const ToolingTable = ({
3031
toolsByGroup,
3132
transform,
3233
setTransform,
34+
numberOfTools,
3335
}: ToolingTableProps) => {
3436
const [selectedTool, setSelectedTool] = useState<JSONSchemaTool | null>(null);
3537
const [bowtieReport, setBowtieReport] = useState<BowtieReport | null>(null);
@@ -96,6 +98,15 @@ const ToolingTable = ({
9698
setSelectedTool(null);
9799
};
98100

101+
if (numberOfTools === 0) {
102+
return (
103+
<div className='text-center py-12 text-gray-500 dark:text-gray-400 border'>
104+
<p className='text-lg'>No Tools Found :(</p>
105+
<p className='text-sm'>Try Adjusting Your Filters to Find More Tools</p>
106+
</div>
107+
);
108+
}
109+
99110
return (
100111
<>
101112
{groups.map((group) => (

pages/tools/index.page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default function ToolingPage({
143143
<div className='grid grid-cols-1 lg:grid-cols-4 mx-4 md:mx-12 min-h-screen'>
144144
<div
145145
className={`absolute lg:static top-10 lg:top-auto left-0 lg:left-auto mt-24 w-screen lg:w-auto h-full lg:h-auto bg-white dark:bg-slate-800 lg:bg-transparent transition-transform lg:transform-none duration-300 lg:duration-0 ease-in-out overflow-y-auto ${isSidebarOpen ? '-translate-x-0' : '-translate-x-full'} z-5`}
146-
style={{ height: 'calc(100% - 8rem)' }}
146+
style={{ height: 'calc(100% - 4rem)' }}
147147
>
148148
<div className='hidden lg:block'>
149149
<h1 className='text-h1mobile md:text-h1 font-bold lg:ml-4 lg:mt-6'>
@@ -222,6 +222,7 @@ export default function ToolingPage({
222222
toolsByGroup={toolsByGroup}
223223
transform={transform}
224224
setTransform={setTransform}
225+
numberOfTools={numberOfTools}
225226
/>
226227

227228
<DocsHelp />

0 commit comments

Comments
 (0)