Guest User

Untitled

a guest
Mar 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. import React, { Component } from "react"
  2. import { Form, Radio, Tab, Icon, Table, Image, Label, Segment, Grid, Divider, Accordion } from "semantic-ui-react"
  3. import ReviewFlight from "../review-flight/ReviewFlight"
  4. import classnames from "classnames"
  5. import Collapsible from "react-collapsible"
  6.  
  7. const radioButton = () => (
  8. <Form.Field>
  9. <Radio name="radioGroup" />
  10. </Form.Field>
  11. );
  12.  
  13. class FlightResult extends Component {
  14. constructor(props) {
  15. super(props)
  16. this.state = { show: false, activeIndex: 0 }
  17. }
  18.  
  19. handleClick = (e, titleProps) => {
  20. const { index } = titleProps
  21. const { activeIndex } = this.state
  22. const newIndex = activeIndex === index ? -1 : index
  23.  
  24. this.setState({ activeIndex: newIndex })
  25. }
  26.  
  27. handleChange = (e, { value }) => {
  28. this.setState({
  29. show: false,
  30. value
  31. })
  32. }
  33. render() {
  34. return (
  35. <Table className="tabela-buscador tabela-voos ui table accordion" compact>
  36. <Table.Header>
  37. <Table.Row>
  38. <Table.HeaderCell className="link-cabecalho-tabela">
  39. SELECIONAR VOO
  40. </Table.HeaderCell>
  41. <Table.HeaderCell className="link-cabecalho-tabela">
  42. VOO
  43. </Table.HeaderCell>
  44. <Table.HeaderCell className="link-cabecalho-tabela">
  45. ORIGEM
  46. </Table.HeaderCell>
  47. <Table.HeaderCell className="link-cabecalho-tabela">
  48. PARTIDA
  49. </Table.HeaderCell>
  50. <Table.HeaderCell className="link-cabecalho-tabela">
  51. PARADA
  52. </Table.HeaderCell>
  53. <Table.HeaderCell className="link-cabecalho-tabela">
  54. CHEGADA
  55. </Table.HeaderCell>
  56. <Table.HeaderCell className="link-cabecalho-tabela">
  57. DESTINO
  58. </Table.HeaderCell>
  59. <Table.HeaderCell className="link-cabecalho-tabela pontos">
  60. PONTOS
  61. </Table.HeaderCell>
  62. <Table.HeaderCell className="link-cabecalho-tabela pontos">
  63. PREÇO
  64. </Table.HeaderCell>
  65. </Table.Row>
  66. </Table.Header>
  67.  
  68. <Table.Body className="ui title">
  69. {this.props.data.map((row, i) => {
  70. return (
  71. (this.CiaClass = classnames({
  72. ciaAzul: row.airline == "Azul",
  73. ciaGol: row.airline == "GOL (G3)",
  74. ciaLatam: row.airline == "LATAM AIRLINES BRASIL",
  75. ciaAvianca: row.airline == "Avianca Brasil",
  76. ciaDelta: row.airline == "DELTA",
  77. ciaCopa: row.airline == "COPA"
  78. })),
  79. (
  80. <Table.Row>
  81. <Table.Cell>Selecione</Table.Cell>
  82. <Table.Cell>
  83. <div>
  84. <Image size="tiny" className={this.CiaClass} />
  85. {row.flightNumber}
  86. </div>
  87. </Table.Cell>
  88. <Table.Cell>{row.from}</Table.Cell>
  89. <Table.Cell>{row.departureDate.slice(11, 16)}</Table.Cell>
  90. <Table.Cell>{row.stops} paradas</Table.Cell>
  91. <Table.Cell>{row.arrivalDate.slice(11, 16)}</Table.Cell>
  92. <Table.Cell>{row.to}</Table.Cell>
  93. <Table.Cell>{row.miles}</Table.Cell>
  94.  
  95. <Table.Cell>
  96. {" "}
  97. R$ 100.00
  98. <Label as="a" color="teal" tag>
  99. Promoção
  100. </Label>
  101. </Table.Cell>
  102. </Table.Row>
  103. )
  104. );
  105. })}
  106. <ReviewFlight data={this.state} />
  107. </Table.Body>
  108. </Table>
  109. )
  110. }
  111. }
  112.  
  113. export default FlightResult;
Add Comment
Please, Sign In to add comment