diff --git a/src/app/(default)/climb/[[...slug]]/components/ClimbData.tsx b/src/app/(default)/climb/[[...slug]]/components/ClimbData.tsx index 96e8d9d7e..67ff941e4 100644 --- a/src/app/(default)/climb/[[...slug]]/components/ClimbData.tsx +++ b/src/app/(default)/climb/[[...slug]]/components/ClimbData.tsx @@ -1,13 +1,23 @@ import { ArrowsVertical } from '@phosphor-icons/react/dist/ssr' -// import RouteGradeChip from '@/components/ui/RouteGradeChip' +import RouteGradeChip from '@/components/ui/RouteGradeChip' import RouteTypeChips from '@/components/ui/RouteTypeChips' import { ArticleLastUpdate } from '@/components/edit/ArticleLastUpdate' -import { Climb } from '@/js/types' +import { ClimbType, AreaType } from '@/js/types' +import Grade from '@/js/grades/Grade' +import { removeTypenameFromDisciplines } from '@/js/utils' -export const ClimbData: React.FC = (props) => { - const { name, type, safety, length, grades, fa: legacyFA, authorMetadata } = props - console.log(safety, grades) +export const ClimbData: React.FC & { isBoulder: boolean }> = (props) => { + const { name, type, safety, length, grades, fa: legacyFA, authorMetadata, gradeContext, isBoulder } = props + + const sanitizedDisciplines = removeTypenameFromDisciplines(type) + + const gradeStr = new Grade( + gradeContext, + grades, + sanitizedDisciplines, + isBoulder + ).toString() return ( <>

@@ -15,9 +25,9 @@ export const ClimbData: React.FC = (props) => {

- {/* {gradeStr != null && ( + {gradeStr != null && ( - )} */} + )}
diff --git a/src/app/(default)/climb/[[...slug]]/page.tsx b/src/app/(default)/climb/[[...slug]]/page.tsx index 2addfa902..58f34614a 100644 --- a/src/app/(default)/climb/[[...slug]]/page.tsx +++ b/src/app/(default)/climb/[[...slug]]/page.tsx @@ -36,7 +36,7 @@ export default async function Page ({ params }: PageWithCatchAllUuidProps): Prom const photoList = climb.media const { - id, name, ancestors, pathTokens, parent + id, name, type, ancestors, pathTokens, parent } = climb const correctSlug = getFriendlySlug(name) @@ -72,7 +72,7 @@ export default async function Page ({ params }: PageWithCatchAllUuidProps): Prom } leftRightNav={} summary={{ - left: , + left: , right: }} map={( diff --git a/src/app/(default)/components/AreaAndClimbPageActions.tsx b/src/app/(default)/components/AreaAndClimbPageActions.tsx index 90fa03a5d..e66acb89a 100644 --- a/src/app/(default)/components/AreaAndClimbPageActions.tsx +++ b/src/app/(default)/components/AreaAndClimbPageActions.tsx @@ -27,13 +27,13 @@ export const AreaAndClimbPageActions: React.FC<{ uuid: string, name: string, tar } return (
    - + {editLabel} - + Map diff --git a/src/app/(default)/components/SharePageURLButton.tsx b/src/app/(default)/components/SharePageURLButton.tsx index 20b19307a..1233ef03d 100644 --- a/src/app/(default)/components/SharePageURLButton.tsx +++ b/src/app/(default)/components/SharePageURLButton.tsx @@ -25,7 +25,7 @@ export const SharePageURLButton: React.FC<{ path: string, name: string }> = ({ p return ( Copied
} open={clicked}>