Skip to content

Commit

Permalink
Merge pull request #476 from MeetDOD/issue-472
Browse files Browse the repository at this point in the history
Feat: Added loader in update post by admin page successfully issue 472
  • Loading branch information
Ultimateutkarsh11 authored Jul 22, 2024
2 parents 0d32879 + 49431bd commit 9766f56
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion admin/src/components/UpdatePost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useRecoilValue } from "recoil";
import { tokenState } from "../store/atoms/auth";
import { IPost } from "../types";
import CodeEditorAndPreview from "../components/CodeEditorAndPreview";
import { ColorRing } from 'react-loader-spinner';

const UpdatePost = () => {
const [post, setPost] = useState<IPost | null>(null);
Expand Down Expand Up @@ -68,7 +69,14 @@ const UpdatePost = () => {
}
};

if (!post) return <>Loading...</>;
if (!post) return <div className="flex justify-center items-center h-80">
<ColorRing
visible={true}
height="100"
width="100"
colors={['#000435', 'rgb(14 165 233)', 'rgb(243 244 246)','#000435','rgb(14 165 233)']}
/>
</div>;

return (
<div>
Expand Down

0 comments on commit 9766f56

Please sign in to comment.