Skip to content

Commit

Permalink
Merge pull request #128 from softy-dev/main
Browse files Browse the repository at this point in the history
Make verbiage of remaining items consistent
  • Loading branch information
jacc authored Dec 5, 2024
2 parents 6f0e937 + 46c1f21 commit 5c39892
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
8 changes: 2 additions & 6 deletions src/pages/bundles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,7 @@ export default function Bundles() {
}, 0);
completed = completedCount >= 30;
if (!completed) {
additionalDescription = ` - ${
30 - completedCount
} more bundles to complete the community center`;
additionalDescription = ` - ${30 - completedCount} bundles left`;
}
}

Expand All @@ -509,9 +507,7 @@ export default function Bundles() {
activePlayer?.general?.jojaMembership?.developmentProjects?.length;
completed = completedCount >= 5;
if (!completed) {
additionalDescription = ` - ${
5 - completedCount
} more Joja Community Development projects needed`;
additionalDescription = ` - ${5 - completedCount} projects left`;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/cooking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function Cooking() {
completed = cookedCount >= reqs[name];

if (!completed) {
additionalDescription = ` - ${reqs[name] - cookedCount} more`;
additionalDescription = ` - ${reqs[name] - cookedCount} left`;
}
return { completed, additionalDescription };
};
Expand Down
2 changes: 1 addition & 1 deletion src/pages/crafting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function Crafting() {
completed = craftedCount >= reqs[name];

if (!completed) {
additionalDescription = ` - ${reqs[name] - craftedCount} more`;
additionalDescription = ` - ${reqs[name] - craftedCount} left`;
}

return { completed, additionalDescription };
Expand Down
4 changes: 2 additions & 2 deletions src/pages/fishing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ export default function Fishing() {
const totalCaught = activePlayer?.fishing?.totalCaught ?? 0;
completed = totalCaught >= reqs[name];
if (!completed) {
additionalDescription = ` - ${reqs[name] - totalCaught} more`;
additionalDescription = ` - ${reqs[name] - totalCaught} left`;
}
} else {
completed = fishCaught.size >= reqs[name];
if (!completed) {
additionalDescription = ` - ${reqs[name] - fishCaught.size} more`;
additionalDescription = ` - ${reqs[name] - fishCaught.size} left`;
}
}
return { completed, additionalDescription };
Expand Down
2 changes: 1 addition & 1 deletion src/pages/museum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function Museum() {

if (!activePlayer || !activePlayer.museum)
return { completed, additionalDescription };

const collection =
museumArtifactCollected.size + museumMineralCollected.size;

Expand Down
26 changes: 13 additions & 13 deletions src/pages/relationships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function Relationships() {

let fiveHeartCount = 0;
for (const relationship of Object.values(
activePlayer.social.relationships
activePlayer.social.relationships,
)) {
if (relationship.points >= 250 * 5) fiveHeartCount++;
}
Expand All @@ -67,7 +67,7 @@ export default function Relationships() {

let tenHeartCount = 0;
for (const relationship of Object.values(
activePlayer.social.relationships
activePlayer.social.relationships,
)) {
if (relationship.points >= 250 * 10) tenHeartCount++;
}
Expand All @@ -89,19 +89,19 @@ export default function Relationships() {
// use 5 heart count relationships
completed = fiveHeartCount >= reqs[name];
if (!completed) {
additionalDescription = ` - ${reqs[name] - fiveHeartCount} more`;
additionalDescription = ` - ${reqs[name] - fiveHeartCount} left`;
}
} else if (ten.has(name)) {
// use 10 heart count relationships
completed = tenHeartCount >= reqs[name];
if (!completed) {
additionalDescription = ` - ${reqs[name] - tenHeartCount} more`;
additionalDescription = ` - ${reqs[name] - tenHeartCount} left`;
}
} else if (house.has(name)) {
// house upgrades
completed = (activePlayer.social.houseUpgradeLevel ?? 0) >= reqs[name];
if (!completed) {
additionalDescription = ` - ${activePlayer.social.houseUpgradeLevel}/${reqs[name]}`;
additionalDescription = ` - ${reqs[name] - (activePlayer.social.houseUpgradeLevel ?? 0)} left`;
}
} else {
// get married and have two kids
Expand All @@ -113,7 +113,7 @@ export default function Relationships() {
completed = true;
}
if (!completed) {
additionalDescription = ` - ${activePlayer.social.childrenCount}/2 kids`;
additionalDescription = ` - ${2 - (activePlayer.social.childrenCount ?? 0)} left`;
}
}
return { completed, additionalDescription };
Expand Down Expand Up @@ -155,9 +155,9 @@ export default function Relationships() {
/>
</Head>
<main
className={`flex min-h-screen md:border-l border-neutral-200 dark:border-neutral-800 pt-2 pb-8 px-5 md:px-8`}
className={`flex min-h-screen border-neutral-200 px-5 pb-8 pt-2 dark:border-neutral-800 md:border-l md:px-8`}
>
<div className="mx-auto w-full space-y-4 mt-4">
<div className="mx-auto mt-4 w-full space-y-4">
<h1 className="ml-1 text-2xl font-semibold text-gray-900 dark:text-white">
Social & Family Tracker
</h1>
Expand Down Expand Up @@ -243,7 +243,7 @@ export default function Relationships() {
.filter(
(a) =>
a.description.includes("house") ||
a.description.includes("married")
a.description.includes("married"),
)
.map((a) => {
const { completed, additionalDescription } =
Expand All @@ -268,8 +268,8 @@ export default function Relationships() {
<h2 className="ml-1 text-xl font-semibold text-gray-900 dark:text-white">
All Villagers
</h2>
<div className="grid grid-cols-1 lg:flex justify-between gap-2">
<div className="grid grid-cols-2 gap-2 sm:gap-3 sm:flex">
<div className="grid grid-cols-1 justify-between gap-2 lg:flex">
<div className="grid grid-cols-2 gap-2 sm:flex sm:gap-3">
<FilterButton
target={"0"}
_filter={_filter}
Expand All @@ -283,15 +283,15 @@ export default function Relationships() {
setFilter={setFilter}
/>
</div>
<div className="grid grid-cols-1 sm:flex gap-2 items-stretch">
<div className="grid grid-cols-1 items-stretch gap-2 sm:flex">
<FilterSearch
_filter={sort}
title="Sort By"
data={sort_filters}
setFilter={setSort}
icon={IconAdjustments}
/>
<Command className="border border-b-0 max-w-xs dark:border-neutral-800">
<Command className="max-w-xs border border-b-0 dark:border-neutral-800">
<CommandInput
onValueChange={(v) => setSearch(v)}
placeholder="Search Villagers"
Expand Down

0 comments on commit 5c39892

Please sign in to comment.