Skip to content

Commit

Permalink
create empty image property
Browse files Browse the repository at this point in the history
  • Loading branch information
00magikarp committed Jul 22, 2024
1 parent d0315b3 commit 5fad031
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
6 changes: 6 additions & 0 deletions scoutingapp/src/components/img/RobotImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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) {
return (
<img
Expand Down
11 changes: 2 additions & 9 deletions scoutingapp/src/components/pages/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ComponentSetup, PageSetup } from "../interface"
import { GenericCheckboxSelect, GenericDropdown, GenericRadioSelect, GenericToggle, ChargedUpGridSelect } from "../selects"
import { GenericHeaderOne, GenericHeaderTwo, QRCodeModal, Timer } from "../texts"
import { CycleCounter } from "../monitor"
import { RobotImage } from "../img/RobotImage"
import { RobotImage, emptyImage } from "../img/RobotImage"
import ChargedUpStartingPosition from "../selects/ChargedUpStartingPosition"

interface ImportedComponentSetup extends ComponentSetup {
Expand All @@ -33,14 +33,7 @@ export function Page(props: PageSetup) {
"ChargedUpGridSelect": [ChargedUpGridSelect, []],
"ChargedUpStartingPosition": [ChargedUpStartingPosition, ""],
"ConeCubeIncrementInput": [ConeCubeIncrementInput, []],
"RobotImage": [
RobotImage,
<img
style={{width: "80%", height: "80%", alignItems: 'center', justifyContent: 'center'}}
src='../img/gray.png'
alt={`Picture of robot`}
/>
]
"RobotImage": [RobotImage, emptyImage]
}

let componentSetup: any = {}
Expand Down

0 comments on commit 5fad031

Please sign in to comment.