* ```
*/
-export const useTheme = (className: string) => {
- const { baseTheme } = useContext(ThemeContext);
+export const getThemedClass = (className: string, baseTheme: Theme) => {
return `${className}-${baseTheme === Theme.LIGHT ? 'light' : 'dark'}`;
};
+
+/**
+ * Returns the accent color hex code for a given accent color enum value
+ * @param accentColor - the accent color enum value
+ * @returns the hex code for the accent color
+ *
+ * @example
+ * ```tsx
+ *
Hello World
+ * ```
+ */
+export const getAccentColor = (accentColor: AccentColor) => {
+ switch (accentColor) {
+ case AccentColor.BLUE:
+ return themeConstants.accent.blue;
+ case AccentColor.GREEN:
+ return themeConstants.accent.green;
+ case AccentColor.PINK:
+ return themeConstants.accent.pink;
+ case AccentColor.YELLOW:
+ return themeConstants.accent.yellow;
+ case AccentColor.ORANGE:
+ return themeConstants.accent.orange;
+ default:
+ return themeConstants.accent.blue;
+ }
+};
diff --git a/utils/organizer-utils.ts b/utils/organizer-utils.ts
index 1ac35b14..c45f10af 100644
--- a/utils/organizer-utils.ts
+++ b/utils/organizer-utils.ts
@@ -42,26 +42,6 @@ export const generateScheduleB = (teams: TeamData[], judges: UserData[]) => {
return sessionsB;
};
-/**
- * Handles submission of the Manage Form with the specified role data.
- * @param {ManageFormFields} roleData - The form data for the role being managed.
- * @param {ScopedMutator} mutate - The scoped mutator function to update the query cache.
- */
-export const handleManageFormSubmit = async (roleData: ManageFormFields, mutate: ScopedMutator) => {
- const res = await fetch(`/api/manage-role`, {
- method: 'PATCH',
- headers: {
- 'Content-Type': 'application/json',
- },
- body: JSON.stringify({ formData: roleData }),
- });
-
- if (res.ok) {
- mutate('/api/manage-role');
- handleSubmitSuccess();
- } else handleSubmitFailure(await res.text());
-};
-
/**
* Handles pre-add user deletion with the specified user data.
* @param {PreAddData} user - The user data object to be deleted from pre-add.