From bfb6e9da4f72bdbdec669c42bdd10062558039cd Mon Sep 17 00:00:00 2001 From: ben_29 Date: Mon, 21 Nov 2022 14:53:22 +0800 Subject: [PATCH] add: workouts type: Kayaking --- scripts/config.py | 12 +++++++++++- src/utils/const.js | 4 ++++ src/utils/utils.js | 7 ++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index c4cbff2657e..c653a6322cf 100644 --- a/scripts/config.py +++ b/scripts/config.py @@ -64,9 +64,19 @@ def safeget(dct, *keys): "rowing": "Rowing", "RoadTrip": "RoadTrip", "flight": "Flight", + "kayaking": "Kayaking", } -MAPPING_TYPE = ["Hike", "Ride", "VirtualRide", "Rowing", "Run", "Swim", "RoadTrip"] +MAPPING_TYPE = [ + "Hike", + "Ride", + "VirtualRide", + "Rowing", + "Run", + "Swim", + "RoadTrip", + "Kayaking", +] STRAVA_GARMIN_TYPE_DICT = { "Hike": "hiking", diff --git a/src/utils/const.js b/src/utils/const.js index 7ca8d93e136..9330b56d1f6 100644 --- a/src/utils/const.js +++ b/src/utils/const.js @@ -41,6 +41,7 @@ const RIDE_TITLE = IS_CHINESE ? '骑行' : 'Ride'; const INDOOR_RIDE_TITLE = IS_CHINESE ? '室内骑行' : 'Indoor Ride'; const HIKE_TITLE = IS_CHINESE ? '徒步' : 'Hike'; const ROWING_TITLE = IS_CHINESE ? '划船' : 'Rowing'; +const KAYAKING_TITLE = IS_CHINESE ? '皮划艇' : 'Kayaking'; const ROAD_TRIP_TITLE = IS_CHINESE ? '自驾' : 'RoadTrip'; const FLIGHT_TITLE = IS_CHINESE ? '飞行' : 'Flight'; @@ -53,6 +54,7 @@ const RUN_TITLES = { INDOOR_RIDE_TITLE, HIKE_TITLE, ROWING_TITLE, + KAYAKING_TITLE, SWIM_TITLE, ROAD_TRIP_TITLE, FLIGHT_TITLE, @@ -82,6 +84,7 @@ const wpink = 'rgb(228,212,220)'; const gold = 'rgb(242,190,69)'; const purple = 'rgb(154,118,252)'; const veryPeri = 'rgb(105,106,173)';//长春花蓝 +const red = 'rgb(255,0,0)';//大红色 // If your map has an offset please change this line // issues #92 and #198 @@ -97,3 +100,4 @@ export const ROAD_TRIP_COLOR = purple; export const FLIGHT_COLOR = wpink; export const PROVINCE_FILL_COLOR = '#47b8e0'; export const COUNTRY_FILL_COLOR = wpink; +export const KAYAKING_COLOR = red; diff --git a/src/utils/utils.js b/src/utils/utils.js index e011c4ed09e..d6e40e876f0 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -15,7 +15,8 @@ import { ROWING_COLOR, ROAD_TRIP_COLOR, FLIGHT_COLOR, - RUN_COLOR + RUN_COLOR, + KAYAKING_COLOR } from './const'; const titleForShow = (run) => { @@ -181,6 +182,8 @@ const titleForRun = (run) => { return RUN_TITLES.ROAD_TRIP_TITLE; case 'Flight': return RUN_TITLES.FLIGHT_TITLE; + case 'Kayaking': + return RUN_TITLES.KAYAKING_TITLE; default: return RUN_TITLES.RUN_TITLE; } @@ -205,6 +208,8 @@ const colorFromType = (workoutType) => { return ROAD_TRIP_COLOR; case 'Flight': return FLIGHT_COLOR; + case 'Kayaking': + return KAYAKING_COLOR; default: return MAIN_COLOR; }