Skip to content

Commit

Permalink
cleanup multiple defs of StepAnnotation
Browse files Browse the repository at this point in the history
  • Loading branch information
graue committed Aug 29, 2024
1 parent 56df5bf commit 62262d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/ItineraryBikeLeg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { BikeLeg, RouteInstruction } from '../lib/BikeHopperClient';
import { BIKEHOPPER_THEME_COLOR } from '../lib/colors';
import formatDistance from '../lib/formatDistance';
import formatMajorStreets from '../lib/formatMajorStreets';
import { describeBikeInfra, STEP_ANNOTATIONS } from '../lib/geometry';
import { describeBikeInfra } from '../lib/geometry';
import type { StepAnnotation } from '../lib/geometry';
import { formatDurationBetween } from '../lib/time';
import InstructionSigns from '../lib/InstructionSigns';
import useScrollToRef from '../hooks/useScrollToRef';
Expand All @@ -14,7 +15,6 @@ import ItinerarySpacer from './ItinerarySpacer';

import BikeIcon from 'iconoir/icons/bicycle.svg?react';

type StepAnnotation = (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS];
type StepWithInfra = RouteInstruction & {
bikeInfra: StepAnnotation[];
};
Expand Down
3 changes: 1 addition & 2 deletions src/components/ItineraryBikeStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import classnames from 'classnames';

import BorderlessButton from './BorderlessButton';
import { STEP_ANNOTATIONS, describeStepAnnotation } from '../lib/geometry';
import type { StepAnnotation } from '../lib/geometry';
import InstructionSigns from '../lib/InstructionSigns';
import ItineraryStep from './ItineraryStep';
import type { RouteInstruction } from '../lib/BikeHopperClient';
Expand All @@ -21,8 +22,6 @@ import TriangleFlag from 'iconoir/icons/triangle-flag.svg?react';
import QuestionMarkCircle from 'iconoir/icons/help-circle.svg?react';
import ArrowTrCircle from 'iconoir/icons/arrow-up-right-circle.svg?react';

type StepAnnotation = (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS];

let _warnedOfFallback = false;
const spacerWithMiddot = ' \u00B7 ';

Expand Down
3 changes: 2 additions & 1 deletion src/lib/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ export const STEP_ANNOTATIONS = {
steepHill: 11,
verySteepHill: 12,
};
type StepAnnotation = (typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS];
export type StepAnnotation =
(typeof STEP_ANNOTATIONS)[keyof typeof STEP_ANNOTATIONS];

export function describeStepAnnotation(
sa: StepAnnotation | null,
Expand Down

0 comments on commit 62262d2

Please sign in to comment.