add link to city page

This commit is contained in:
Sara Vieira
2018-11-26 11:48:57 +01:00
parent 6019ac8485
commit 72266052b7
4 changed files with 10979 additions and 125 deletions

10065
data/single/old-uber.js Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@ import { search } from '../../utils/algolia'
import edgeCases from '../../utils/edgeCases'
import ReactCountryFlag from 'react-country-flag'
import { getAppStoreLink } from '../../utils/appStores'
import uberData from '../../../data/single/uber'
class City extends Component {
state = {
@@ -53,6 +54,8 @@ class City extends Component {
render({}, { cities, loaded }) {
const city = cities[0]
const match =
city && uberData.find(a => a.info.place_id === city.info.place_id)
if (!loaded) {
return (
@@ -73,10 +76,17 @@ class City extends Component {
height={window.innerHeight}
/>
</Wrapper>,
<Title>
YES 🚗{' '}
<ReactCountryFlag code={city.info.country.short_name} />
</Title>,
<a
style={{ textDecoration: 'none' }}
href={match ? `https://www.uber.com${match.link}` : null}
target="_blank"
rel="noopener noreferrer"
>
<Title>
YES 🚗{' '}
<ReactCountryFlag code={city.info.country.short_name} />
</Title>
</a>,
<Message>{edgeCases(cities[0])}</Message>,
]
) : (
@@ -94,8 +104,10 @@ class City extends Component {
{city.company
.filter(item => item !== 'uber')
.map(c => (
<Company href={getAppStoreLink(c)} target="_blank">{c}</Company>
))}
<Company href={getAppStoreLink(c)} target="_blank">
{c}
</Company>
))}
</Alternative>
</div>
) : null}

View File

@@ -31,4 +31,10 @@ export default injectGlobal`
padding: 0;
margin: 0;
}
a {
position: relative;
z-index: 99;
}
`