Skip to content

Commit

Permalink
rename component
Browse files Browse the repository at this point in the history
  • Loading branch information
jerader committed Feb 16, 2024
1 parent c5861b3 commit 0df6814
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ import * as React from 'react'
import { Svg } from '../../primitives'
import type { DeckDefinition, DeckSlot } from '@opentrons/shared-data'

export interface RobotCoordinateSpaceWithDOMCoordsRenderProps {
export interface RobotCoordinateSpaceWithRefRenderProps {
deckSlotsById: { [slotId: string]: DeckSlot }
}

interface RobotCoordinateSpaceWithDOMCoordsProps
interface RobotCoordinateSpaceWithRefProps
extends React.ComponentProps<typeof Svg> {
viewBox?: string | null
deckDef?: DeckDefinition
children?: (
props: RobotCoordinateSpaceWithDOMCoordsRenderProps
) => React.ReactNode
children?: (props: RobotCoordinateSpaceWithRefRenderProps) => React.ReactNode
}

export function RobotCoordinateSpaceWithDOMCoords(
props: RobotCoordinateSpaceWithDOMCoordsProps
export function RobotCoordinateSpaceWithRef(
props: RobotCoordinateSpaceWithRefProps
): JSX.Element | null {
const { children, deckDef, viewBox, ...restProps } = props
const wrapperRef = React.useRef<SVGSVGElement>(null)
Expand Down
2 changes: 1 addition & 1 deletion components/src/hardware-sim/RobotCoordinateSpace/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from './RobotCoordinateSpaceWithDOMCoords'
export * from './RobotCoordinateSpaceWithRef'
export * from './RobotCoordinateSpace'
6 changes: 3 additions & 3 deletions protocol-designer/src/components/DeckSetup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DeckFromLayers,
FlexTrash,
Module,
RobotCoordinateSpaceWithDOMCoords,
RobotCoordinateSpaceWithRef,
SingleSlotFixture,
StagingAreaFixture,
StagingAreaLocation,
Expand Down Expand Up @@ -553,7 +553,7 @@ export const DeckSetup = (): JSX.Element => {
{drilledDown && <BrowseLabwareModal />}

<div ref={wrapperRef} className={styles.deck_wrapper}>
<RobotCoordinateSpaceWithDOMCoords
<RobotCoordinateSpaceWithRef
height="100%"
deckDef={deckDef}
viewBox={`${deckDef.cornerOffsetFromOrigin[0]} ${
Expand Down Expand Up @@ -658,7 +658,7 @@ export const DeckSetup = (): JSX.Element => {
/>
</>
)}
</RobotCoordinateSpaceWithDOMCoords>
</RobotCoordinateSpaceWithRef>
</div>
</div>
)
Expand Down

0 comments on commit 0df6814

Please sign in to comment.