Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Loading Bar to center #122

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/components/HashtagTool/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function HashTagToolProvider({ children, filterTags }) {

return (
<HashTagContext.Provider value={contextValue}>
{isLoading ? <Spinner /> : children}
{children}
</HashTagContext.Provider>
);
}
Expand Down Expand Up @@ -270,11 +270,8 @@ export function HashtagTool() {
}

function handleLoadMore() {
// Set the loading state before fetching more posts
setLoadingMorePosts(true);
// Call the LoadMoreMedia function to fetch more posts
LoadMoreMedia().then(() => {
// Reset the loading state after posts are fetched
setLoadingMorePosts(false);
});
}
Expand All @@ -284,6 +281,7 @@ export function HashtagTool() {
<div className="flex flex-col md:flex-row min-h-screen">
<Sidebar />
<main className="flex-1 overflow-y-auto">
{isLoading && <Spinner />}
<Feed
notes={notes}
onLoadMore={handleLoadMore}
Expand Down
5 changes: 3 additions & 2 deletions src/components/Spinner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ function Spinner() {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100vh',
backgroundColor: 'white', // This sets the background color to black
minHeight: '50vh',
marginTop: '25vh',
backgroundColor: 'transparent',
}}>
<div className="lds-ellipsis">
<div></div>
Expand Down
Loading