Skip to content

Commit

Permalink
add: sport type: Trail Running
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-29 committed Sep 28, 2023
1 parent 593e919 commit 29c096f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions run_page/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def safeget(dct, *keys):
"running": "Run",
"RUN": "Run",
"Run": "Run",
"trail_running": "Trail Running",
"cycling": "Ride",
"CYCLING": "Ride",
"Ride": "Ride",
Expand Down Expand Up @@ -81,6 +82,7 @@ def safeget(dct, *keys):
"VirtualRide",
"Rowing",
"Run",
"Trail Running",
"Swim",
"RoadTrip",
"Kayaking",
Expand Down
3 changes: 3 additions & 0 deletions src/utils/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const INFO_MESSAGE = IS_CHINESE ? CHINESE_INFO_MESSAGE : ENGLISH_INFO_MESSAGE;
const FULL_MARATHON_RUN_TITLE = IS_CHINESE ? '全程马拉松' : 'Full Marathon';
const HALF_MARATHON_RUN_TITLE = IS_CHINESE ? '半程马拉松' : 'Half Marathon';
const RUN_TITLE = IS_CHINESE ? '跑步' : 'Run';
const TRAIL_RUN_TITLE = IS_CHINESE ? '越野跑' : 'Trail Running';
const SWIM_TITLE = IS_CHINESE ? '游泳' : 'Swim';

const RIDE_TITLE = IS_CHINESE ? '骑行' : 'Ride';
Expand All @@ -68,6 +69,7 @@ const RUN_TITLES = {
FULL_MARATHON_RUN_TITLE,
HALF_MARATHON_RUN_TITLE,
RUN_TITLE,
TRAIL_RUN_TITLE,

RIDE_TITLE,
INDOOR_RIDE_TITLE,
Expand Down Expand Up @@ -126,3 +128,4 @@ export const PROVINCE_FILL_COLOR = '#47b8e0';
export const COUNTRY_FILL_COLOR = wpink;
export const KAYAKING_COLOR = red;
export const SNOWBOARD_COLOR = wpink;
export const TRAIL_RUNNING_COLOR = IKB;
5 changes: 5 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
RUN_COLOR,
KAYAKING_COLOR,
SNOWBOARD_COLOR,
TRAIL_RUNNING_COLOR,
} from './const';
import { FeatureCollection, LineString } from 'geojson';

Expand Down Expand Up @@ -195,6 +196,8 @@ const titleForType = (type: string): string => {
switch (type) {
case 'Run':
return RUN_TITLES.RUN_TITLE;
case 'Trail Running':
return RUN_TITLES.TRAIL_RUN_TITLE;
case 'Ride':
return RUN_TITLES.RIDE_TITLE;
case 'Indoor Ride':
Expand Down Expand Up @@ -240,6 +243,8 @@ const colorFromType = (workoutType: string): string => {
switch (workoutType) {
case 'Run':
return RUN_COLOR;
case 'Trail Running':
return TRAIL_RUNNING_COLOR;
case 'Ride':
case 'Indoor Ride':
return RIDE_COLOR;
Expand Down

0 comments on commit 29c096f

Please sign in to comment.