mirror of
https://github.com/zhigang1992/uber-cities.git
synced 2026-04-29 17:54:56 +08:00
push links to algolia
This commit is contained in:
10065
data/single/old-uber.js
10065
data/single/old-uber.js
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,10 @@ const newArray = data.reduce((acc, curr) => {
|
||||
if (acc.find(a => curr.info.place_id === a.info.place_id)) {
|
||||
const current = acc.find(a => curr.info.place_id === a.info.place_id)
|
||||
|
||||
if (curr.link) {
|
||||
current.link = curr.link
|
||||
}
|
||||
|
||||
if (!current.company.includes(curr.company))
|
||||
current.company.push(curr.company)
|
||||
} else {
|
||||
|
||||
@@ -43,15 +43,14 @@
|
||||
"osmosis": "^1.1.8",
|
||||
"preact-cli": "^2.2.1",
|
||||
"prettier": "^1.15.2",
|
||||
"react-country-flag": "^1.0.1"
|
||||
"dotenv": "^6.1.0",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
"require-dir": "^1.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"algoliasearch": "^3.30.0",
|
||||
"dotenv": "^6.1.0",
|
||||
"emotion": "^9.2.12",
|
||||
"emotion-theming": "^9.2.9",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
"limiter": "^1.1.3",
|
||||
"lodash.uniqby": "^4.7.0",
|
||||
"mobile-detect": "^1.4.3",
|
||||
"preact": "^8.3.1",
|
||||
@@ -61,7 +60,7 @@
|
||||
"react-emotion": "^9.2.12",
|
||||
"react-emotion-flexboxgrid": "^9.0.0",
|
||||
"remove-accents": "^0.4.2",
|
||||
"require-dir": "^1.1.0"
|
||||
"react-country-flag": "^1.0.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
|
||||
@@ -15,7 +15,6 @@ 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 = {
|
||||
@@ -54,8 +53,6 @@ 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 (
|
||||
@@ -78,7 +75,7 @@ class City extends Component {
|
||||
</Wrapper>,
|
||||
<a
|
||||
style={{ textDecoration: 'none' }}
|
||||
href={match ? `https://www.uber.com${match.link}` : null}
|
||||
href={`https://www.uber.com${city.link}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user