Guest User

Untitled

a guest
Oct 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import React from 'react'
  2. import { Link } from 'react-router-dom'
  3. import { Map } from '../App'
  4. import { cities } from '../data'
  5.  
  6. function CityPage ({ match, ...props }) {
  7. const city = cities.find(city => city.value === match.params.city)
  8. return (
  9. <>
  10. <Map
  11. center={[121.450496, 31.165072]}
  12. style='mapbox://styles/mapbox/light-v9'
  13. containerStyle={{
  14. height: '200px',
  15. width: '100vw'
  16. }}
  17. zoom={[7]}
  18. />
  19. <div style={{
  20. padding: '20px'
  21. }}>
  22. <Link to='/'>voltar</Link>
  23. <h1 className='title'>{city.name}</h1>
  24. {city.data.map((data, index) => (
  25. <div key={index} style={{ paddingBottom: '15px' }}>
  26. <p style={{ fontWeight: 'bold' }}>{data.title}</p>
  27. <p style={{ textAlign: 'justify', textJustify: 'inter-word' }}>{data.value}</p>
  28. </div>
  29. ))}
  30. </div>
  31. </>
  32. )
  33. }
  34.  
  35. export default CityPage
Add Comment
Please, Sign In to add comment