Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Remove import cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad committed Feb 29, 2024
1 parent fde4455 commit 4ff87cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
12 changes: 1 addition & 11 deletions src/constants/fieldMaps.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { getDateCopy } from "utils/string";

export const timeZones = [
{
str: "Coordinated Universal Time",
Expand Down Expand Up @@ -167,7 +165,7 @@ export const timeZones = [
},
];

const listOfDateFormatStrings = [
export const listOfDateFormatStrings = [
"MM-dd-yyyy",
"dd-MM-yyyy",
"yyyy-MM-dd",
Expand All @@ -177,14 +175,6 @@ const listOfDateFormatStrings = [
"MMM d, yyyy",
];

export const dateFormats = listOfDateFormatStrings.map((format) => ({
value: format,
str: `${format} - ${getDateCopy("08/31/2022", {
dateFormat: format,
dateOnly: true,
})}`,
}));

export enum TimeFormat {
TwelveHour = "h:mm:ss aa",
TwentyFourHour = "H:mm:ss",
Expand Down
16 changes: 14 additions & 2 deletions src/pages/preferences/preferencesTabs/ProfileTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import { Skeleton } from "antd";
import { usePreferencesAnalytics } from "analytics";
import { SettingsCard } from "components/SettingsCard";
import { SpruceForm } from "components/SpruceForm";
import { timeZones, dateFormats, TimeFormat } from "constants/fieldMaps";
import {
listOfDateFormatStrings,
timeZones,
TimeFormat,
} from "constants/fieldMaps";
import { useToastContext } from "context/toast";
import {
UpdateUserSettingsMutation,
Expand All @@ -16,7 +20,15 @@ import {
import { UPDATE_USER_SETTINGS } from "gql/mutations";
import { AWS_REGIONS } from "gql/queries";
import { useUserSettings } from "hooks";
import { omitTypename } from "utils/string";
import { getDateCopy, omitTypename } from "utils/string";

const dateFormats = listOfDateFormatStrings.map((format) => ({
value: format,
str: `${format} - ${getDateCopy("08/31/2022", {
dateFormat: format,
dateOnly: true,
})}`,
}));

export const ProfileTab: React.FC = () => {
const { sendEvent } = usePreferencesAnalytics();
Expand Down

0 comments on commit 4ff87cf

Please sign in to comment.