Skip to content

Commit

Permalink
Merge pull request #2 from SearchForSunnyD:staging
Browse files Browse the repository at this point in the history
Reorganizing and Minor Fixes
  • Loading branch information
SearchForSunnyD authored Sep 18, 2024
2 parents 8b9d4b2 + ca625ea commit d521324
Show file tree
Hide file tree
Showing 45 changed files with 892 additions and 1,332 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ venv/
__pycache__
node_modules/
coverage/
.bat
1 change: 0 additions & 1 deletion dnd-app/backend/buildSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ async function buildSlugDb() {
"armor",
"sections",
"spells",
"spelllist",
];

await Promise.all(calls.map((prefix) => fetchAndInsertData(prefix, url)));
Expand Down
2 changes: 1 addition & 1 deletion dnd-app/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Dnd Companion</title>
<title>Arcane Atlas</title>
</head>
<body>
<div id="root"></div>
Expand Down
Binary file removed dnd-app/frontend/public/icons/armor.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/backgrounds.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/classes.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/conditions.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/feats.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/magicitems.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/monsters.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/planes.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/races.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/sections.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/spelllist.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/spells.png
Binary file not shown.
Binary file removed dnd-app/frontend/public/icons/weapons.png
Binary file not shown.
Binary file modified dnd-app/frontend/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 60 additions & 85 deletions dnd-app/frontend/src/DetailRoutes/Armor.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
/* eslint-disable no-mixed-spaces-and-tabs */
import { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import {
Badge,
Card,
CardBody,
CardImg,
CardText,
CardTitle,
Col,
Container,
Row,
Spinner,
} from "reactstrap";
import { Badge, Card, CardBody, CardText, CardTitle, Col, Container, Row } from "reactstrap";
import DndApi from "../api";
import { Loading } from "../Loading";

import("../assets/styles/Details.css");

Expand Down Expand Up @@ -44,87 +34,72 @@ export function Armor() {
return (
<Container>
{loading ? (
<Container fluid className="mx-auto">
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
</Container>
<Loading />
) : (
<Row>
<CardImg src="/icons/armor.png" />
<Col>
<Card className="info bisque">
<CardBody>
<CardTitle tag="h1">{data.name}</CardTitle>
{data.category ? (
<>
<CardText>{data.category}</CardText>
<CardText className="text-capitalize">
{data.ac_string}
</CardText>
</>
<Container>
<Card className="info bisque">
<CardBody>
<CardTitle tag="h1">{data.name}</CardTitle>
{data.category ? (
<>
<CardText>{data.category}</CardText>
<CardText className="text-capitalize">{data.ac_string}</CardText>
</>
) : (
""
)}
<Row>
{data.cost ? (
<Col>
<strong>Price: </strong>
{data.cost}
</Col>
) : (
""
)}
<Row>
{data.cost ? (
<Col>
<strong>Price: </strong>
{data.cost}
</Col>
) : (
""
)}
<Col>
<strong>Strength Requirement: </strong>
{data.strength_requirement || "None"}
</Col>
<Col>
<strong>Stealth Disadvantage: </strong>
{data.stealth_disadvantage ? "Yes" : "No"}
</Col>
{data.base_ac ? (
<Col>
<strong>Strength Requirement: </strong>
{data.strength_requirement || "None"}
<strong>Armor Class: </strong>
{data.base_ac}
</Col>
) : (
""
)}
{data.plus_max ? (
<Col>
<strong>Stealth Disadvantage: </strong>
{data.stealth_disadvantage
? "Yes"
: "No"}
<strong>Max Dex: </strong>
{"+"}
{data.plus_max}
</Col>
{data.base_ac ? (
<Col>
<strong>Armor Class: </strong>
{data.base_ac}
</Col>
) : (
""
)}
{data.plus_max ? (
<Col>
<strong>Max Dex: </strong>
{"+"}
{data.plus_max}
</Col>
) : (
""
)}
{data.weight ? (
<Col>
<strong>Weight: </strong>
{data.weight}
</Col>
) : (
""
)}
</Row>
<CardText className="mt-3">
<strong>Source:</strong>{" "}
<Badge pill color="warning">
<a href={data.document__url}>
{data.document__title}
</a>
</Badge>
</CardText>
</CardBody>
</Card>
</Col>
</Row>
) : (
""
)}
{data.weight ? (
<Col>
<strong>Weight: </strong>
{data.weight}
</Col>
) : (
""
)}
</Row>
<CardText className="mt-3">
<strong>Source:</strong>{" "}
<Badge pill color="warning">
<a href={data.document__url}>{data.document__title}</a>
</Badge>
</CardText>
</CardBody>
</Card>
</Container>
)}
</Container>
);
Expand Down
114 changes: 43 additions & 71 deletions dnd-app/frontend/src/DetailRoutes/Backgrounds.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
import {
Badge,
Card,
CardBody,
CardImg,
CardText,
CardTitle,
Col,
Container,
Row,
Spinner,
} from "reactstrap";
import { Badge, Card, CardBody, CardText, CardTitle, Col, Container, Row } from "reactstrap";
import DndApi from "../api";
import { Loading } from "../Loading";

import("../assets/styles/Details.css");

Expand Down Expand Up @@ -46,67 +36,49 @@ export function Backgrounds() {
return (
<Container>
{loading ? (
<Container fluid className="mx-auto">
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
</Container>
<Loading />
) : (
<Row>
<CardImg src="/icons/backgrounds.png" />
<Col>
<Card className="bisque">
<CardBody>
<CardTitle tag="h1">{data.name}</CardTitle>
<CardText>{data.type}</CardText>
<CardText>{data.desc}</CardText>
<hr />
<CardText>
<strong>Equipment:</strong>{" "}
{data.equipment || "None"}
</CardText>
<Row>
<Col>
<CardText>
<strong>
Skill Proficiencies:
</strong>{" "}
{data.skill_proficiencies || "None"}
</CardText>
</Col>
<Col>
<CardText>
<strong>Tool Proficiencies:</strong>{" "}
{data.tool_proficiencies || "None"}
</CardText>
</Col>
<Col>
<CardText>
<strong>Languages:</strong>{" "}
{data.languages || "None"}
</CardText>
</Col>
</Row>
<hr />
<Container>
<Card className="bisque">
<CardBody>
<CardTitle tag="h1">{data.name}</CardTitle>
<CardText>{data.type}</CardText>
<CardText>{data.desc}</CardText>
<hr />
<CardText>
<strong>Equipment:</strong> {data.equipment || "None"}
</CardText>
<Row>
<Col>
<CardText>
<strong>Skill Proficiencies:</strong> {data.skill_proficiencies || "None"}
</CardText>
</Col>
<Col>
<CardText>
<strong>Tool Proficiencies:</strong> {data.tool_proficiencies || "None"}
</CardText>
</Col>
<Col>
<CardText>
<strong>Languages:</strong> {data.languages || "None"}
</CardText>
</Col>
</Row>
<hr />

<CardText>
<strong>{data.feature}:</strong>{" "}
{data.feature_desc}
</CardText>
<CardText className="mt-3">
<strong>Source:</strong>{" "}
<Badge pill color="warning">
<a href={data.document__url}>
{data.document__title}
</a>
</Badge>
</CardText>
</CardBody>
</Card>
</Col>
</Row>
<CardText>
<strong>{data.feature}:</strong> {data.feature_desc}
</CardText>
<CardText className="mt-3">
<strong>Source:</strong>{" "}
<Badge pill color="warning">
<a href={data.document__url}>{data.document__title}</a>
</Badge>
</CardText>
</CardBody>
</Card>
</Container>
)}
</Container>
);
Expand Down
59 changes: 19 additions & 40 deletions dnd-app/frontend/src/DetailRoutes/BasicCard.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import { useEffect, useState } from "react";
import ReactMarkdown from "react-markdown";
import { useParams } from "react-router-dom";
import {
Badge,
Card,
CardBody,
CardImg,
CardText,
CardTitle,
Col,
Container,
Row,
Spinner,
} from "reactstrap";
import { Badge, Card, CardBody, CardText, CardTitle, Container } from "reactstrap";
import DndApi from "../api";
import ReactMarkdown from "react-markdown";
import { Loading } from "../Loading";

import("../assets/styles/Details.css");

Expand Down Expand Up @@ -45,34 +35,23 @@ export function BasicCard({ type }) {
return (
<Container>
{loading ? (
<Container fluid className="mx-auto">
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
<Spinner type="grow" />
</Container>
<Loading />
) : (
<Row>
<CardImg src={`/icons/${type}.png`} />
<Col>
<Card className="info">
<CardBody>
<CardTitle tag="h1">{data.name}</CardTitle>
<CardText>{data.type}</CardText>
<ReactMarkdown>{data.desc}</ReactMarkdown>
<CardText className="mt-3">
<strong>Source:</strong>{" "}
<Badge pill color="warning">
<a href={data.document__url}>
{data.document__title}
</a>
</Badge>
</CardText>
</CardBody>
</Card>
</Col>
</Row>
<Container>
<Card className="info">
<CardBody>
<CardTitle tag="h1">{data.name}</CardTitle>
<CardText>{data.type}</CardText>
<ReactMarkdown>{data.desc}</ReactMarkdown>
<CardText className="mt-3">
<strong>Source:</strong>{" "}
<Badge pill color="warning">
<a href={data.document__url}>{data.document__title}</a>
</Badge>
</CardText>
</CardBody>
</Card>
</Container>
)}
</Container>
);
Expand Down
Loading

0 comments on commit d521324

Please sign in to comment.