forked from PalisadoesFoundation/talawa-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
71 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/components/InfiniteScrollLoader/InfiniteScrollLoader.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* InfiniteScrollLoader.module.css */ | ||
.simpleLoader { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.spinner { | ||
width: 2rem; | ||
height: 2rem; | ||
margin: 1rem 0; | ||
border: 4px solid transparent; /* Set all sides transparent */ | ||
border-top-color: var(--bs-gray-400); /* Color only the top border */ | ||
border-radius: 50%; | ||
animation: spin 0.6s linear infinite; | ||
} | ||
|
||
@keyframes spin { | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/components/InfiniteScrollLoader/InfiniteScrollLoader.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import InfiniteScrollLoader from './InfiniteScrollLoader'; | ||
|
||
describe('Testing InfiniteScrollLoader component', () => { | ||
test('Component should be rendered properly', () => { | ||
render(<InfiniteScrollLoader />); | ||
|
||
expect(screen.getByTestId('infiniteScrollLoader')).toBeInTheDocument(); | ||
expect( | ||
screen.getByTestId('infiniteScrollLoaderSpinner'), | ||
).toBeInTheDocument(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
src/components/InfiniteScrollLoader/InfiniteScrollLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import styles from './InfiniteScrollLoader.module.css'; | ||
|
||
const InfiniteScrollLoader = (): JSX.Element => { | ||
return ( | ||
<div data-testid="infiniteScrollLoader" className={styles.simpleLoader}> | ||
<div | ||
data-testid="infiniteScrollLoaderSpinner" | ||
className={styles.spinner} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default InfiniteScrollLoader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters