Skip to content

Commit

Permalink
first batch of images
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingMaster121 committed Mar 8, 2025
1 parent d67b566 commit e402f90
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 14 deletions.
Binary file added scoutingapp/public/10004.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/10499.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/122.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/1908.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/2363.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/2534.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/2890.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/2998.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/422.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/4286.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/4575.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/619.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/6882.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/836.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/9214.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added scoutingapp/public/977.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 24 additions & 14 deletions scoutingapp/src/components/img/RobotImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React, {useEffect, useState} from "react"
import { ComponentSetup } from "../interface"

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

/>

export function RobotImage(props: ComponentSetup) {
Expand All @@ -14,19 +14,29 @@ export function RobotImage(props: ComponentSetup) {
useEffect(() => {
const interval = setInterval(() => {
if (robotNumber) {
setComponentInside(
<img
style={{ height: "300px", alignItems: 'center', justifyContent: 'center', margin: "auto"}}
src={`../${robotNumber}.jpeg`}
alt={`Image of robot ${robotNumber} not found.`}
/>
)
fileExists(`../${robotNumber}.jpeg`).then((exists) => {
console.log("Exists => ", exists)
if (exists) {
setComponentInside(
<img
style={{ height: "300px", alignItems: 'center', justifyContent: 'center', margin: "auto"}}
src={`../${robotNumber}.jpeg`}
/>
)
} else {
setComponentInside(
<img
style={{ height: "0px", alignItems: 'center', justifyContent: 'center', margin: "auto"}}
src={`../gray.png`}
/>
)
}
});
} else {
setComponentInside(
<img
style={{ height: "300px", alignItems: 'center', justifyContent: 'center', margin: "auto"}}
src={`../gray.png`}
alt={'Insert robot number above'}
style={{ height: "0px", alignItems: 'center', justifyContent: 'center', margin: "auto"}}
src={`../public/gray.png`}
/>
)
}
Expand All @@ -46,4 +56,4 @@ async function fileExists(imagePath: string): Promise<boolean> {
} catch {
return false;
}
}
}

0 comments on commit e402f90

Please sign in to comment.