Skip to content

Commit

Permalink
Make loading messages visible
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdentarikcan committed Dec 16, 2024
1 parent a7bc926 commit 80dce92
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/FullscreenLoading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export const FullscreenLoading = ({
<Loader2
className="h-16 w-16 animate-spin text-primary"
/>
<span className="sr-only">Loading</span>
{!takingLong && (
<div className="ml-4 text-lg font-normal duration-500 animate-in fade-in">
Loading...
</div>
)}
{takingLong && (
<div className="ml-4 text-lg font-normal duration-500 animate-in fade-in">
This is taking a while...
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/SearchQuestionsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export const SearchQuestionsList = () => {
<Loader2
className="h-16 w-16 animate-spin text-primary"
/>
<span className="sr-only">Loading</span>
<div className="ml-4 text-lg font-normal duration-500 animate-in fade-in">
Loading...
</div>
</div>
)}
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/SearchTagsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export const SearchTagsList = () => {
<Loader2
className="h-16 w-16 animate-spin text-primary"
/>
<span className="sr-only">Loading</span>
<div className="ml-4 text-lg font-normal duration-500 animate-in fade-in">
Loading...
</div>
</div>
)}
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export default function TagsPage() {
<Loader2
className="h-16 w-16 animate-spin text-primary"
/>
<span className="sr-only">Loading</span>
<div className="ml-4 text-lg font-normal duration-500 animate-in fade-in">
Loading...
</div>
</div>
)}
</div>
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/routes/bookmarks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export const BookmarkedQuestions = () => {
<Loader2
className="h-16 w-16 animate-spin text-primary"
/>
<span className="sr-only">Loading</span>
<div className="ml-4 text-lg font-normal duration-500 animate-in fade-in">
Loading...
</div>
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/profile.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe("Profile component", () => {

render(<RouterProvider router={router} />);

expect(screen.getByLabelText(/loading/i)).toBeInTheDocument();
expect(screen.getByText("Loading...")).toBeInTheDocument();
});

it("displays user data correctly", async () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/routes/search.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("Search component", () => {
</MemoryRouter>,
);

expect(screen.getByLabelText(/loading/i)).toBeInTheDocument();
expect(screen.getByText("Loading...")).toBeInTheDocument();
});

it("renders tags correctly", () => {
Expand Down

0 comments on commit 80dce92

Please sign in to comment.