From 4a10ee6f95be6bd02d06cd9d3a2ea63c8e994d51 Mon Sep 17 00:00:00 2001 From: Sophie Stadler Date: Thu, 29 Feb 2024 10:34:54 -0500 Subject: [PATCH] Remove import cycle --- src/constants/fieldMaps.ts | 12 +----------- .../preferences/preferencesTabs/ProfileTab.tsx | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/constants/fieldMaps.ts b/src/constants/fieldMaps.ts index 2325ba668d..6498d3177e 100644 --- a/src/constants/fieldMaps.ts +++ b/src/constants/fieldMaps.ts @@ -1,5 +1,3 @@ -import { getDateCopy } from "utils/string"; - export const timeZones = [ { str: "Coordinated Universal Time", @@ -167,7 +165,7 @@ export const timeZones = [ }, ]; -const listOfDateFormatStrings = [ +export const listOfDateFormatStrings = [ "MM-dd-yyyy", "dd-MM-yyyy", "yyyy-MM-dd", @@ -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", diff --git a/src/pages/preferences/preferencesTabs/ProfileTab.tsx b/src/pages/preferences/preferencesTabs/ProfileTab.tsx index 5cb51876c3..56187cb671 100644 --- a/src/pages/preferences/preferencesTabs/ProfileTab.tsx +++ b/src/pages/preferences/preferencesTabs/ProfileTab.tsx @@ -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, @@ -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"; + +export 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();