refactor(block-menu): simplify useEffect dependencies in AllBlocksContent, IntegrationBlocks, and SuggestionContent components

This commit is contained in:
Abhimanyu Yadav
2025-06-17 21:48:57 +05:30
parent 9ea44b6267
commit aa4de454b2
3 changed files with 6 additions and 6 deletions

View File

@@ -38,7 +38,7 @@ export const AllBlocksContent: React.FC = () => {
useEffect(() => {
fetchBlocks();
}, [api, fetchBlocks]);
}, [fetchBlocks]);
const fetchMoreBlockOfACategory = async (category: string) => {
try {
@@ -68,7 +68,7 @@ export const AllBlocksContent: React.FC = () => {
if (loading) {
return (
<div className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200">
<div className="scrollbar-thumb-rounded scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200 h-full overflow-y-auto pt-4 transition-all duration-200">
<div className="w-full space-y-3 px-4 pb-4">
{Array.from({ length: 3 }).map((_, categoryIndex) => (
<Fragment key={categoryIndex}>
@@ -98,7 +98,7 @@ export const AllBlocksContent: React.FC = () => {
}
return (
<div className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200">
<div className="scrollbar-thumb-rounded scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200 h-full overflow-y-auto pt-4 transition-all duration-200">
<div className="w-full space-y-3 px-4 pb-4">
{categories.map((category, index) => (
<Fragment key={category.name}>

View File

@@ -37,7 +37,7 @@ export const IntegrationBlocks: React.FC = ({}) => {
useEffect(() => {
fetchBlocks();
}, [api, integration, fetchBlocks]);
}, [fetchBlocks]);
if (loading) {
return (

View File

@@ -37,7 +37,7 @@ export const SuggestionContent: React.FC = () => {
useEffect(() => {
fetchSuggestions();
}, [api, fetchSuggestions]);
}, [fetchSuggestions]);
if (error) {
return (
@@ -52,7 +52,7 @@ export const SuggestionContent: React.FC = () => {
}
return (
<div className="scrollbar-thumb-rounded h-full overflow-y-auto pt-4 transition-all duration-200 scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200">
<div className="scrollbar-thumb-rounded scrollbar-thin scrollbar-track-transparent scrollbar-thumb-transparent hover:scrollbar-thumb-zinc-200 h-full overflow-y-auto pt-4 transition-all duration-200">
<div className="w-full space-y-6 pb-4">
{/* Recent Searches */}
{/* <div className="-mb-2 space-y-2.5">