Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chennisden committed Jun 12, 2024
1 parent 61ddb15 commit f7c2c58
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 83 deletions.
1 change: 0 additions & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { AlertQueue, AlertQueueProvider } from "hooks/alerts";
import { AuthenticationProvider } from "hooks/auth";
import { ThemeProvider } from "hooks/theme";
import About from "pages/About";
import EditPartForm from "pages/EditPartForm";
import EditRobotForm from "pages/EditRobotForm";
import Home from "pages/Home";
import Login from "pages/Login";
Expand Down
162 changes: 82 additions & 80 deletions frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,86 +43,88 @@ const Home: React.FC = () => {
</Card>
</Col>
</Row>
{isAuthenticated && <>
<Row className="row-two">
<Col md={6} sm={12}>
<Button
variant={theme === "dark" ? "outline-light" : "outline-dark"}
size="lg"
style={{
backgroundColor: "light-purple",
borderColor: "secondary",
padding: "10px",
width: "100%",
}}
onClick={() => {
navigate("/robots/your/");
}}
>
View Your Robots
</Button>
</Col>
<Col md={6} sm={12}>
<Button
variant={theme === "dark" ? "outline-light" : "outline-dark"}
size="lg"
style={{
backgroundColor: "dark-purple",
borderColor: "secondary",
padding: "10px",
width: "100%",
}}
onClick={() => {
navigate("/parts/your/");
}}
>
View Your Parts
</Button>
</Col>
</Row>
<Row className="row-two">
<Col md={6} sm={12}>
<Button
variant="outline-primary"
size="lg"
style={{
color: isHoveredR ? colors.text_color : colors.buttonBorder,
backgroundColor: isHoveredR ? colors.buttonBorder : "",
borderColor: colors.buttonBorder,
padding: "10px",
width: "100%",
}}
onMouseEnter={handleMouseEnterR}
onMouseLeave={handleMouseLeaveR}
onClick={() => {
navigate("/robots/add");
}}
>
Make a Robot
</Button>
</Col>
<Col md={6} sm={12}>
<Button
variant="outline-primary"
size="lg"
style={{
color: isHoveredL ? colors.text_color : colors.buttonBorder,
backgroundColor: isHoveredL ? colors.buttonBorder : "",
borderColor: colors.buttonBorder,
padding: "10px",
width: "100%",
}}
onMouseEnter={handleMouseEnterL}
onMouseLeave={handleMouseLeaveL}
onClick={() => {
navigate("/parts/add");
}}
>
Make a Part
</Button>
</Col>
</Row>
</>}
{isAuthenticated && (
<>
<Row className="row-two">
<Col md={6} sm={12}>
<Button
variant={theme === "dark" ? "outline-light" : "outline-dark"}
size="lg"
style={{
backgroundColor: "light-purple",
borderColor: "secondary",
padding: "10px",
width: "100%",
}}
onClick={() => {
navigate("/robots/your/");
}}
>
View Your Robots
</Button>
</Col>
<Col md={6} sm={12}>
<Button
variant={theme === "dark" ? "outline-light" : "outline-dark"}
size="lg"
style={{
backgroundColor: "dark-purple",
borderColor: "secondary",
padding: "10px",
width: "100%",
}}
onClick={() => {
navigate("/parts/your/");
}}
>
View Your Parts
</Button>
</Col>
</Row>
<Row className="row-two">
<Col md={6} sm={12}>
<Button
variant="outline-primary"
size="lg"
style={{
color: isHoveredR ? colors.text_color : colors.buttonBorder,
backgroundColor: isHoveredR ? colors.buttonBorder : "",
borderColor: colors.buttonBorder,
padding: "10px",
width: "100%",
}}
onMouseEnter={handleMouseEnterR}
onMouseLeave={handleMouseLeaveR}
onClick={() => {
navigate("/robots/add");
}}
>
Make a Robot
</Button>
</Col>
<Col md={6} sm={12}>
<Button
variant="outline-primary"
size="lg"
style={{
color: isHoveredL ? colors.text_color : colors.buttonBorder,
backgroundColor: isHoveredL ? colors.buttonBorder : "",
borderColor: colors.buttonBorder,
padding: "10px",
width: "100%",
}}
onMouseEnter={handleMouseEnterL}
onMouseLeave={handleMouseLeaveL}
onClick={() => {
navigate("/parts/add");
}}
>
Make a Part
</Button>
</Col>
</Row>
</>
)}
</div>
);
};
Expand Down
5 changes: 3 additions & 2 deletions store/app/routers/part.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ async def get_part(part_id: str, crud: Annotated[Crud, Depends(Crud.get)]) -> Pa

@parts_router.get("/user/")
async def current_user(
crud: Annotated[Crud, Depends(Crud.get)], data: Annotated[ApiKeyData, Depends(get_api_key)]
crud: Annotated[Crud, Depends(Crud.get)],
token: Annotated[str, Depends(get_session_token)],
) -> str | None:
user_id = await crud.get_user_id_from_api_key(data.api_key)
user_id = await crud.get_user_id_from_session_token(token)
return str(user_id)


Expand Down

0 comments on commit f7c2c58

Please sign in to comment.