Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- export default class App extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- shirt: null,
- pant: null,
- sneaker: null,
- }
- }
- render() {
- return (
- <div style={{ textAlign: 'center' }}>
- <div>
- <div className="shirt">
- {this.state.shirt === null ?
- <p>Selecione uma camisa!</p> : <img style={{ width: 50, height: 50 }}
- alt="imagem da camisa que você selecionou"
- src={this.state.shirt} />
- }
- </div>
- <div className="pant">
- {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} />}
- </div>
- <div className="sneaker">
- {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} />}
- </div>
- </div>
- </div>
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement