Skip to content

Commit

Permalink
Update const naming, remove unused export
Browse files Browse the repository at this point in the history
  • Loading branch information
evadecker committed Nov 17, 2024
1 parent 1a42c47 commit 5d9e8a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions convex/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,21 +335,19 @@ export type Cost = {
description: string;
};

export const FREE = "free";

/**
* Estimated time units.
* Used to display estimated time in quest details.
*/
export const ESTIMATED_TIME_UNITS = {
export const TIME_UNITS = {
minutes: "Minutes",
hours: "Hours",
days: "Days",
weeks: "Weeks",
months: "Months",
} as const;

export type TimeRequiredUnit = keyof typeof ESTIMATED_TIME_UNITS;
export type TimeRequiredUnit = keyof typeof TIME_UNITS;

export type TimeRequired = {
min: number;
Expand Down
4 changes: 2 additions & 2 deletions convex/validators.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { v } from "convex/values";
import {
CATEGORIES,
ESTIMATED_TIME_UNITS,
FIELDS,
GROUP_QUESTS_BY,
JURISDICTIONS,
ROLES,
STATUS,
THEMES,
TIME_UNITS,
} from "./constants";

export const jurisdiction = v.union(
Expand Down Expand Up @@ -41,5 +41,5 @@ export const category = v.union(
);

export const timeRequiredUnit = v.union(
...Object.keys(ESTIMATED_TIME_UNITS).map((unit) => v.literal(unit)),
...Object.keys(TIME_UNITS).map((unit) => v.literal(unit)),
);
4 changes: 2 additions & 2 deletions src/routes/_authenticated/admin/quests/$questId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import {
type Category,
type Cost,
DEFAULT_TIME_REQUIRED,
ESTIMATED_TIME_UNITS,
JURISDICTIONS,
type Jurisdiction,
TIME_UNITS,
type TimeRequired,
type TimeRequiredUnit,
} from "@convex/constants";
Expand Down Expand Up @@ -191,7 +191,7 @@ const TimeRequiredInput = memo(function TimeRequiredInput({
})
}
>
{Object.entries(ESTIMATED_TIME_UNITS).map(([key, label]) => (
{Object.entries(TIME_UNITS).map(([key, label]) => (
<SelectItem key={key} id={key}>
{label}
</SelectItem>
Expand Down

0 comments on commit 5d9e8a0

Please sign in to comment.