Skip to content

Commit

Permalink
refactor loader class name
Browse files Browse the repository at this point in the history
  • Loading branch information
lihnick committed Aug 9, 2021
1 parent c847702 commit 9efd607
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/Loader/Loader.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
}
}

.loader {
.Loader {
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: center;
}

.loader::before {
.Loader::before {
content: '';
background-color: transparent;
position: absolute;
Expand All @@ -32,7 +32,7 @@
animation-delay: 0s;
}

.loader::after {
.Loader::after {
content: '';
background-color: transparent;
position: absolute;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Loader/Loader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ describe('Loader', () => {
describe('when rendered with additional class names', () => {
it('should not replace the default classes', () => {
const { getByTestId } = render(
<Loader data-testid="loaderElem" className="loader" />
<Loader data-testid="loaderElem" className="Loader" />
);

const loaderElem = getByTestId('loaderElem') as HTMLDivElement;
const loaderClasses = loaderElem.className
.split(' ')
.filter((classes) => classes.match('\\w*(loader)\\w*'));
.filter((classes) => classes.match('\\w*(Loader)\\w*'));
expect(loaderClasses.length).toBe(2);
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Loader/Loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface LoaderProps extends React.HTMLAttributes<HTMLDivElement> {

const Loader: React.FC<LoaderProps> = ({ size = 'lg', ...rest }) => {
const mainClass = classNames(
styles.loader,
styles.Loader,
rest.className,
`${styles[size]}`
);
Expand Down

0 comments on commit 9efd607

Please sign in to comment.