Skip to content

Commit

Permalink
fix robot page
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed Jun 3, 2024
1 parent 65a5354 commit f602511
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 64 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/auth/AuthComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import GoogleAuthComponent from "./GoogleAuthComponent";
const AuthComponent = () => {
return (
<>
<Row>
{/* <Row>
<Col>
<EmailAuthComponent />
</Col>
Expand All @@ -14,7 +14,7 @@ const AuthComponent = () => {
<Col xs="auto">
<GoogleAuthComponent />
</Col>
</Row>
</Row> */}
</>
);
};
Expand Down
62 changes: 4 additions & 58 deletions frontend/src/pages/RobotDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ interface RobotDetailsResponse {
}

const RobotDetails = () => {
const navigate = useNavigate();

const { id } = useParams();
const [show, setShow] = useState(false);
const [robot, setRobot] = useState<RobotDetailsResponse | null>(null);
Expand Down Expand Up @@ -67,65 +69,9 @@ const RobotDetails = () => {
}

const response: RobotDetailsResponse = robot;
// This is a placeholder before the backend is hooked up.
// const response: RobotDetailsResponse = {
// name: "Stompy",
// owner: "K-Scale Labs",
// description: `Stompy is an open-source humanoid robot that anyone can 3D print.

// ## Purpose

// Stompy is designed to be a versatile platform for research and development in legged robotics.

// ## Links

// - [Wiki Entry](https://humanoids.wiki/w/Stompy)

// ### Full Body Sim Artifacts

// - [URDF (with STLs)](https://media.kscale.dev/stompy/latest_stl_urdf.tar.gz)
// - [URDF (with OBJs)](https://media.kscale.dev/stompy/latest_obj_urdf.tar.gz)
// - [MJCF](https://media.kscale.dev/stompy/latest_mjcf.tar.gz)

// ### Single Arm Sim Artifacts

// - [URDF (with STLs)](https://media.kscale.dev/stompy/arm_latest_stl_urdf.tar.gz)
// - [URDF (with OBJs)](https://media.kscale.dev/stompy/arm_latest_obj_urdf.tar.gz)
// - [MJCF](https://media.kscale.dev/stompy/arm_latest_mjcf.tar.gz)
// `,
// images: [
// {
// url: "https://media.robolist.xyz/stompy.png",
// caption: "Stompy the robot 1",
// },
// {
// url: "https://media.robolist.xyz/stompy.png",
// caption: "Stompy the robot 2",
// },
// {
// url: "https://media.robolist.xyz/stompy.png",
// caption: "Stompy the robot 3",
// },
// ],
// bom: [
// {
// name: "Actuator",
// id: "1234",
// quantity: 10,
// price: 100,
// },
// {
// name: "Sensor",
// id: "5678",
// quantity: 5,
// price: 50,
// },
// ],
// };

const { name, owner, description, images } = robot;

const navigate = useNavigate();

return (
<>
Expand Down Expand Up @@ -240,7 +186,7 @@ const RobotDetails = () => {
)}
</Row>

<Modal
{images && <Modal
show={show}
onHide={handleClose}
fullscreen="md-down"
Expand Down Expand Up @@ -282,7 +228,7 @@ const RobotDetails = () => {
</Button>
</ButtonGroup>
</Modal.Footer>
</Modal>
</Modal>}
</>
);
};
Expand Down
20 changes: 16 additions & 4 deletions store/app/api/routers/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Defines the main API endpoint."""

import logging
from typing import Union
from typing import List,Union

import boto3
from botocore.exceptions import ClientError
Expand All @@ -22,20 +22,32 @@
# Configure your DynamoDB client
dynamodb = boto3.resource(
"dynamodb",
region_name="us-east-1", # Replace with your AWS region
aws_access_key_id="something", # Replace with your AWS access key
aws_secret_access_key="something", # Replace with your AWS secret key
# region_name="us-east-1", # Replace with your AWS region
# aws_access_key_id="something", # Replace with your AWS access key
# aws_secret_access_key="something", # Replace with your AWS secret key
)

# Replace 'Robots' with your DynamoDB table name
table = dynamodb.Table("Robots")

class Bom(BaseModel):
name: str
id: str
quantity: int
price: float


class Image(BaseModel):
url: str
caption: str

class Robot(BaseModel):
robot_id: str
name: str
description: str
owner: str
bom: List[Bom]
images: List[Image]


@api_router.get("/robots/{robot_id}", response_model=Robot)
Expand Down

0 comments on commit f602511

Please sign in to comment.