Skip to content

Commit

Permalink
get robot number properly (doesn't reload)
Browse files Browse the repository at this point in the history
  • Loading branch information
00magikarp committed Jul 22, 2024
1 parent 5fad031 commit 3c46c8a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scoutingapp/src/components/img/RobotImage.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import React from "react"
import { ComponentSetup } from "../interface"

interface RobotImageProps extends ComponentSetup {
robotNumber?: string;
}

export const emptyImage = <img
style={{width: "80%", height: "80%", alignItems: 'center', justifyContent: 'center'}}
src='../img/gray.png'
alt={`Picture of robot`}
/>

export function RobotImage({ robotNumber = "4099", ...props }: RobotImageProps) {
export function RobotImage(props: ComponentSetup) {
const robotNumber = props.getValue["TeamNumber"]

return (
<img
style={{ width: "60%", height: "60%", alignItems: 'center', justifyContent: 'center', margin: "auto"}}
style={{ width: "60%", height: "60%", alignItems: 'center', justifyContent: 'center', margin: "auto" }}
src={`./src/components/img/${robotNumber}.png`}
alt={`Picture of robot ${robotNumber}`}
/>
Expand Down

0 comments on commit 3c46c8a

Please sign in to comment.