From 8a5fa47a84f4be17761cc9a6f81cf7c28fdf9db2 Mon Sep 17 00:00:00 2001 From: Nathan Musoke Date: Tue, 18 Jul 2023 18:24:51 -0400 Subject: [PATCH] feat: Get grade context from sandbag sandbag now has grade contexts that previously were part of openbeta-graphql. Use them instead of maintaining a parallel implementation in open-tacos. --- src/js/grades/Grade.ts | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/src/js/grades/Grade.ts b/src/js/grades/Grade.ts index fb86b476e..5304361da 100644 --- a/src/js/grades/Grade.ts +++ b/src/js/grades/Grade.ts @@ -1,44 +1,7 @@ -import { GradeScales, getScale } from '@openbeta/sandbag' +import { gradeContextToGradeScales, getScale } from '@openbeta/sandbag' import { RulesType, GradeContextType, GradeValuesType, ClimbDisciplineRecord } from '../types' import { EditableClimbType } from '../../components/crag/cragSummary' -const gradeContextToGradeScales = { - US: { - trad: GradeScales.YDS, - sport: GradeScales.YDS, - bouldering: GradeScales.VSCALE, - tr: GradeScales.YDS, - alpine: GradeScales.YDS, - mixed: GradeScales.YDS, - aid: GradeScales.YDS, - snow: GradeScales.YDS, // is this the same as alpine? - ice: GradeScales.YDS // is this the same as alpine? - }, - FR: { - trad: GradeScales.FRENCH, - sport: GradeScales.FRENCH, - bouldering: GradeScales.FONT, - tr: GradeScales.FRENCH, - alpine: GradeScales.FRENCH, - mixed: GradeScales.FRENCH, - aid: GradeScales.FRENCH, - snow: GradeScales.FRENCH, // is this the same as alpine? - ice: GradeScales.FRENCH // is this the same as alpine? - }, - AU: { - trad: GradeScales.EWBANK, - sport: GradeScales.EWBANK, - bouldering: GradeScales.VSCALE, - tr: GradeScales.EWBANK, - deepwatersolo: GradeScales.EWBANK, - alpine: GradeScales.YDS, - mixed: GradeScales.YDS, - aid: GradeScales.AID, - snow: GradeScales.YDS, // is this the same as alpine? - ice: GradeScales.WI - } -} - export default class Grade { context: GradeContextType values: GradeValuesType