-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature(lazy+suspense): use react lazy + suspense instead of react-lo…
…adable
- Loading branch information
Showing
43 changed files
with
293 additions
and
525 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
66 changes: 66 additions & 0 deletions
66
frontend/src/components/ContentLoader/__tests__/__snapshots__/contentLoader.spec.tsx.snap
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,66 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BodyContentLoader should renders correctly 1`] = ` | ||
<div | ||
className="bodyContentLoader" | ||
> | ||
<ContentLoader | ||
height={200} | ||
primaryColor="#f3f3f3" | ||
secondaryColor="#d7d6d8" | ||
speed={1} | ||
width={400} | ||
> | ||
<rect | ||
height="15.1" | ||
rx="4" | ||
ry="4" | ||
width="76.63" | ||
x="160.5" | ||
y="11" | ||
/> | ||
<rect | ||
height="151.36" | ||
rx="1" | ||
ry="1" | ||
width="275.4" | ||
x="60.5" | ||
y="35.05" | ||
/> | ||
</ContentLoader> | ||
</div> | ||
`; | ||
|
||
exports[`FooterContentLoader should renders correctly 1`] = ` | ||
<ContentLoader | ||
height={400} | ||
primaryColor="#f3f3f3" | ||
secondaryColor="#d7d6d8" | ||
speed={1} | ||
width={2500} | ||
> | ||
<rect | ||
height="400" | ||
width="2500" | ||
x="0" | ||
y="0" | ||
/> | ||
</ContentLoader> | ||
`; | ||
|
||
exports[`HeaderContentLoader should renders correctly 1`] = ` | ||
<ContentLoader | ||
height={95} | ||
primaryColor="#f3f3f3" | ||
secondaryColor="#d7d6d8" | ||
speed={1} | ||
width={2500} | ||
> | ||
<rect | ||
height="95" | ||
width="2500" | ||
x="0" | ||
y="0" | ||
/> | ||
</ContentLoader> | ||
`; |
37 changes: 37 additions & 0 deletions
37
frontend/src/components/ContentLoader/__tests__/contentLoader.spec.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,37 @@ | ||
import React from 'react'; | ||
import ShallowRenderer from 'react-test-renderer/shallow'; | ||
|
||
import { BodyContentLoader, FooterContentLoader, HeaderContentLoader } from '../contentLoader'; | ||
|
||
describe('HeaderContentLoader', () => { | ||
it('should renders correctly', () => { | ||
const renderer = ShallowRenderer.createRenderer(); | ||
const result = renderer.render( | ||
<HeaderContentLoader />, | ||
); | ||
expect(result).toMatchSnapshot(); | ||
renderer.unmount(); | ||
}); | ||
}); | ||
|
||
describe('BodyContentLoader', () => { | ||
it('should renders correctly', () => { | ||
const renderer = ShallowRenderer.createRenderer(); | ||
const result = renderer.render( | ||
<BodyContentLoader />, | ||
); | ||
expect(result).toMatchSnapshot(); | ||
renderer.unmount(); | ||
}); | ||
}); | ||
|
||
describe('FooterContentLoader', () => { | ||
it('should renders correctly', () => { | ||
const renderer = ShallowRenderer.createRenderer(); | ||
const result = renderer.render( | ||
<FooterContentLoader />, | ||
); | ||
expect(result).toMatchSnapshot(); | ||
renderer.unmount(); | ||
}); | ||
}); |
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,3 @@ | ||
.bodyContentLoader { | ||
margin: auto; | ||
} |
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,43 @@ | ||
import React from 'react'; | ||
import ContentLoader from 'react-content-loader'; | ||
|
||
const styles = require('./contentLoader.scss'); | ||
|
||
export const BodyContentLoader = () => ( | ||
<div className={styles.bodyContentLoader}> | ||
<ContentLoader | ||
height={200} | ||
width={400} | ||
speed={1} | ||
primaryColor='#f3f3f3' | ||
secondaryColor='#d7d6d8' | ||
> | ||
<rect x='160.5' y='11' rx='4' ry='4' width='76.63' height='15.1' /> | ||
<rect x='60.5' y='35.05' rx='1' ry='1' width='275.4' height='151.36' /> | ||
</ContentLoader> | ||
</div> | ||
); | ||
|
||
export const HeaderContentLoader = () => ( | ||
<ContentLoader | ||
height={95} | ||
width={2500} | ||
speed={1} | ||
primaryColor='#f3f3f3' | ||
secondaryColor='#d7d6d8' | ||
> | ||
<rect x='0' y='0' width='2500' height='95' /> | ||
</ContentLoader> | ||
); | ||
|
||
export const FooterContentLoader = () => ( | ||
<ContentLoader | ||
height={400} | ||
width={2500} | ||
speed={1} | ||
primaryColor='#f3f3f3' | ||
secondaryColor='#d7d6d8' | ||
> | ||
<rect x='0' y='0' width='2500' height='400' /> | ||
</ContentLoader> | ||
); |
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 @@ | ||
export { BodyContentLoader, HeaderContentLoader, FooterContentLoader } from './contentLoader'; |
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
12 changes: 6 additions & 6 deletions
12
frontend/src/components/Dropdown/__tests__/dropdown.spec.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
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
32 changes: 0 additions & 32 deletions
32
...ges/HomePage/components/ContentLoader/__tests__/__snapshots__/contentLoader.spec.tsx.snap
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
frontend/src/pages/HomePage/components/ContentLoader/__tests__/contentLoader.spec.tsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
frontend/src/pages/HomePage/components/ContentLoader/contentLoader.scss
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.