Skip to content

Commit 8ea2388

Browse files
fixed ui loader on docs page
1 parent 31a0c88 commit 8ea2388

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/pages/Doc/index.jsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,29 @@ const DocList = () => {
2828
};
2929

3030
fetchDocs();
31-
}, []);
31+
}, []);
3232

3333

3434

35-
if (loading) return <div className="flex justify-center items-center h-screen"><Spin size="large" /></div>;
3635
if (error) return <Alert message="Error" description={error} type="error" />;
3736

3837
return (
3938
<Layout>
4039
<div className="container mx-auto p-4 min-h-screen">
4140
<MainTitle highlight={'Documentation'} />
42-
<ul className='grid gap-5 mx-auto md:max-w-2xl'>
41+
{loading ? (
42+
<div className='grid place-content-center mx-auto md:max-w-2xl aspect-video'>
43+
<Spin size="large" />
44+
</div>
45+
) : (<ul className='grid gap-5 mx-auto md:max-w-2xl'>
4346
{
4447
docs.map(item =>
45-
<Link to={item.title} className='capitalize group flex items-center justify-between bg-white/10 p-5 rounded-md'>{item.title.replace(/_/g, ' ')}
48+
<Link key={item.title} to={item.title} className='capitalize group flex items-center justify-between bg-white/10 p-5 rounded-md'>{item.title.replace(/_/g, ' ')}
4649
<FaArrowRight className="dark:text-white opacity-0 group-hover:opacity-100 -translate-x-10 group-hover:translate-x-0 transition duration-300" />
4750
</Link>
4851
)
4952
}
50-
</ul>
53+
</ul>)}
5154
</div>
5255
</Layout>
5356
);

0 commit comments

Comments
 (0)