|
1 | 1 | import React from 'react';
|
2 |
| -import PropTypes from 'prop-types'; |
3 |
| -import css from './ImageExample.scss'; |
4 | 2 |
|
5 |
| -// Note the global alias for images |
| 3 | +// Note the global alias for image |
| 4 | +// eslint-disable-next-line import/no-unresolved |
6 | 5 | import logo from 'images/256egghead.png';
|
| 6 | +// eslint-disable-next-line import/no-unresolved |
| 7 | +import legoIcon from 'images/lego_icon.svg'; |
| 8 | + |
| 9 | +import css from './ImageExample.scss'; |
7 | 10 | import bowerLogo from './bower.png';
|
8 | 11 | import blueprintIcon from './blueprint_icon.svg';
|
9 |
| -import legoIcon from 'images/lego_icon.svg'; |
10 |
| -const TestComponent = (props) => ( |
| 12 | + |
| 13 | +const TestComponent = (_props) => ( |
11 | 14 | <div>
|
12 | 15 | <h1 className={css.red}>This is a test of CSS module color red.</h1>
|
13 |
| - <hr/> |
| 16 | + <hr /> |
14 | 17 | <h1 className={css.background}>Here is a label with a background-image from the CSS modules
|
15 |
| - imported</h1> |
16 |
| - <img src={logo}/> |
17 |
| - <hr/> |
| 18 | + imported |
| 19 | + </h1> |
| 20 | + <img src={logo} alt="logo" /> |
| 21 | + <hr /> |
18 | 22 | <h1 className={css.backgroundSameDirectory}>This label has a background image from the same
|
19 |
| - directory. Below is an img tag in the same directory</h1> |
20 |
| - <img src={bowerLogo}/> |
21 |
| - <hr/> |
| 23 | + directory. Below is an img tag in the same directory |
| 24 | + </h1> |
| 25 | + <img src={bowerLogo} alt="bower logo" /> |
| 26 | + <hr /> |
22 | 27 | <h1> Below is an img tag of a svg in the same directory</h1>
|
23 |
| - <img src={blueprintIcon}/> |
24 |
| - <hr/> |
| 28 | + <img src={blueprintIcon} alt="blueprint icon" /> |
| 29 | + <hr /> |
25 | 30 | <h1>Below is a div with a background svg</h1>
|
26 |
| - <div className={css.googleLogo}/> |
27 |
| - <hr/> |
| 31 | + <div className={css.googleLogo} alt="google logo" /> |
| 32 | + <hr /> |
28 | 33 | <h1>SVG lego icon img tag with global path</h1>
|
29 |
| - <img src={legoIcon}/> |
30 |
| - <hr/> |
| 34 | + <img src={legoIcon} alt="lego icon" /> |
| 35 | + <hr /> |
31 | 36 | <h1>SVG lego icon with background image to global path</h1>
|
32 |
| - <div className={css.legoIcon}/> |
| 37 | + <div className={css.legoIcon} alt="lego icon again" /> |
33 | 38 | </div>
|
34 | 39 | );
|
35 | 40 |
|
36 |
| -TestComponent.propTypes = { |
37 |
| - message: PropTypes.string, |
38 |
| -}; |
39 |
| - |
40 | 41 | export default TestComponent;
|
0 commit comments