Advertisement
Guest User

Untitled

a guest
May 25th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. export default class App extends React.Component {
  4.  
  5. constructor(props) {
  6. super(props);
  7. this.state = {
  8. shirt: null,
  9. pant: null,
  10. sneaker: null,
  11.  
  12. }
  13. }
  14.  
  15. render() {
  16. return (
  17. <div style={{ textAlign: 'center' }}>
  18. <div>
  19. <div className="shirt">
  20. {this.state.shirt === null ?
  21. <p>Selecione uma camisa!</p> : <img style={{ width: 50, height: 50 }}
  22. alt="imagem da camisa que você selecionou"
  23. src={this.state.shirt} />
  24. }
  25. </div>
  26. <div className="pant">
  27. {this.state.pant === null ? <p>Selecione uma calça!</p> : <img style={{ width: 50, height: 50 }} alt="imagem da calça que você selecionou" src={this.state.pant} />}
  28. </div>
  29. <div className="sneaker">
  30. {this.state.sneaker === null ? <p>Selecione um tênis!</p> : <img style={{ width: 50, height: 50 }} alt="imagem do tênis que você selecionou" src={this.state.sneaker} />}
  31. </div>
  32. </div>
  33. </div>
  34. );
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement