Skip to content

Commit

Permalink
move icon path to config
Browse files Browse the repository at this point in the history
  • Loading branch information
baby230211 committed Jul 25, 2023
1 parent 14db116 commit da5c3b3
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 44 deletions.
22 changes: 2 additions & 20 deletions components/venue/VenueDriveTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<script>
import i18n from '@/i18n/venue/index.i18n'
import VenueDivision from './VenueDivision.vue'
import { venueDriveIconConfig } from './config/venueIconConfig'
export default {
i18n,
name: 'VenueDriveTab',
Expand All @@ -135,26 +136,7 @@ export default {
},
computed: {
icon() {
if (this.$i18n.locale === 'en-us') {
return {
car: require('~/static/img/venue/car.svg'),
carWhite: require('~/static/img/venue/car-white.svg'),
motorWhite: require('~/static/img/venue/motor-white.svg'),
parking: require('~/static/img/venue/parking.svg'),
parkingPink: require('~/static/img/venue/parking-pink.svg'),
venueDestination: require('~/static/img/venue/en-us/venue-destination.svg'),
venueDestinationMd: require('~/static/img/venue/en-us/venue-destination-md.svg'),
}
}
return {
car: require('~/static/img/venue/car.svg'),
carWhite: require('~/static/img/venue/car-white.svg'),
motorWhite: require('~/static/img/venue/motor-white.svg'),
parking: require('~/static/img/venue/parking.svg'),
parkingPink: require('~/static/img/venue/parking-pink.svg'),
venueDestination: require('~/static/img/venue/venue-destination.svg'),
venueDestinationMd: require('~/static/img/venue/venue-destination-md.svg'),
}
return venueDriveIconConfig[this.$i18n.locale]
},
},
}
Expand Down
26 changes: 2 additions & 24 deletions components/venue/VenuePublicTransporterTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
<script>
import i18n from '@/i18n/venue/index.i18n'
import VenueDivision from './VenueDivision.vue'
import { venuePublicTransportIconConfig } from './config/venueIconConfig'
export default {
i18n,
Expand Down Expand Up @@ -243,30 +244,7 @@ export default {
computed: {
icon() {
if (this.$i18n.locale === 'en-us') {
return {
carWhite: require('~/static/img/venue/car-white.svg'),
busWhite: require('~/static/img/venue/bus-white.svg'),
publicTransporterGuide: require('~/static/img/venue/en-us/publicTransporterGuide.svg'),
publicTransporterGuideMd: require('~/static/img/venue/en-us/publicTransporterGuide-md.svg'),
taxiWhite: require('~/static/img/venue/taxi-white.svg'),
transporterWhite: require('~/static/img/venue/transporter-white.svg'),
uBike: require('~/static/img/venue/uBike.svg'),
parking: require('~/static/img/venue/parking.svg'),
airplane: require('~/static/img/venue/airplane.svg'),
}
}
return {
carWhite: require('~/static/img/venue/car-white.svg'),
busWhite: require('~/static/img/venue/bus-white.svg'),
publicTransporterGuide: require('~/static/img/venue/publicTransporterGuide.svg'),
publicTransporterGuideMd: require('~/static/img/venue/publicTransporterGuide-md.svg'),
taxiWhite: require('~/static/img/venue/taxi-white.svg'),
transporterWhite: require('~/static/img/venue/transporter-white.svg'),
uBike: require('~/static/img/venue/uBike.svg'),
parking: require('~/static/img/venue/parking.svg'),
airplane: require('~/static/img/venue/airplane.svg'),
}
return venuePublicTransportIconConfig[this.$i18n.locale]
},
},
}
Expand Down
45 changes: 45 additions & 0 deletions components/venue/config/venueIconConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
export const venueDriveIconConfig = {
'en-us': {
car: require('~/static/img/venue/car.svg'),
carWhite: require('~/static/img/venue/car-white.svg'),
motorWhite: require('~/static/img/venue/motor-white.svg'),
parking: require('~/static/img/venue/parking.svg'),
parkingPink: require('~/static/img/venue/parking-pink.svg'),
venueDestination: require('~/static/img/venue/en-us/venue-destination.svg'),
venueDestinationMd: require('~/static/img/venue/en-us/venue-destination-md.svg'),
},
'zh-hant': {
car: require('~/static/img/venue/car.svg'),
carWhite: require('~/static/img/venue/car-white.svg'),
motorWhite: require('~/static/img/venue/motor-white.svg'),
parking: require('~/static/img/venue/parking.svg'),
parkingPink: require('~/static/img/venue/parking-pink.svg'),
venueDestination: require('~/static/img/venue/venue-destination.svg'),
venueDestinationMd: require('~/static/img/venue/venue-destination-md.svg'),
},
}

export const venuePublicTransportIconConfig = {
'en-us': {
carWhite: require('~/static/img/venue/car-white.svg'),
busWhite: require('~/static/img/venue/bus-white.svg'),
publicTransporterGuide: require('~/static/img/venue/en-us/publicTransporterGuide.svg'),
publicTransporterGuideMd: require('~/static/img/venue/en-us/publicTransporterGuide-md.svg'),
taxiWhite: require('~/static/img/venue/taxi-white.svg'),
transporterWhite: require('~/static/img/venue/transporter-white.svg'),
uBike: require('~/static/img/venue/uBike.svg'),
parking: require('~/static/img/venue/parking.svg'),
airplane: require('~/static/img/venue/airplane.svg'),
},
'zh-hant': {
carWhite: require('~/static/img/venue/car-white.svg'),
busWhite: require('~/static/img/venue/bus-white.svg'),
publicTransporterGuide: require('~/static/img/venue/publicTransporterGuide.svg'),
publicTransporterGuideMd: require('~/static/img/venue/publicTransporterGuide-md.svg'),
taxiWhite: require('~/static/img/venue/taxi-white.svg'),
transporterWhite: require('~/static/img/venue/transporter-white.svg'),
uBike: require('~/static/img/venue/uBike.svg'),
parking: require('~/static/img/venue/parking.svg'),
airplane: require('~/static/img/venue/airplane.svg'),
},
}

0 comments on commit da5c3b3

Please sign in to comment.