From 7fe55774a1c3d7e979b0c61e0207de08d6e27eab Mon Sep 17 00:00:00 2001 From: Graham Tackley Date: Wed, 24 Apr 2024 11:14:45 +0100 Subject: [PATCH] refactor: switch to using `@/` for in-app imports (#1170) Use `@/name` for app imports, as opposed to just `name` as previously. This is the modern convention for web apps, and makes clearer when imports are coming from the application as opposed to npm modules. There's a few deep `../../` style imports remaining - these get worse if I move them to `@/`-style imports, and I think are better left until we move the files around a bit more in a subsequent PR. --- src/App.tsx | 22 ++++++------ src/ErrorBoundary.tsx | 2 +- src/auth/components/AdvertiserAddress.tsx | 6 ++-- src/auth/components/AdvertiserAgreed.tsx | 4 +-- src/auth/components/AdvertiserDetailsForm.tsx | 22 ++++++------ src/auth/components/types.ts | 2 +- src/auth/context/auth.hook.ts | 2 +- src/auth/context/auth.interface.ts | 2 +- src/auth/hooks/mutations/useGetLink.ts | 2 +- src/auth/hooks/mutations/useRegister.ts | 8 ++--- src/auth/hooks/mutations/useSignIn.ts | 4 +-- src/auth/hooks/mutations/useSignOut.ts | 4 +-- src/auth/hooks/queries/useAdvertiser.ts | 6 ++-- src/auth/hooks/queries/useAuthorize.ts | 4 +-- src/auth/hooks/queries/useIsAuthenticated.ts | 2 +- src/auth/hooks/queries/useUser.ts | 2 +- src/auth/index.tsx | 4 +-- src/auth/lib/index.ts | 10 +++--- src/auth/registration/AccountChoice.tsx | 8 ++--- .../registration/AdvertiserRegistered.tsx | 6 ++-- .../registration/BraveAdsContactFrame.tsx | 6 ++-- src/auth/registration/BrowserForm.tsx | 6 ++-- src/auth/registration/BrowserRegister.tsx | 16 ++++----- src/auth/registration/MarketingChannel.tsx | 2 +- src/auth/registration/MarketingOptIn.tsx | 2 +- src/auth/registration/Register.tsx | 4 +-- .../registration/RegistrationContainer.tsx | 12 +++---- src/auth/registration/SearchForm.tsx | 8 ++--- src/auth/registration/SearchRegister.tsx | 14 ++++---- src/auth/views/AuthVerify.tsx | 6 ++-- src/auth/views/LandingPage.tsx | 16 ++++----- src/auth/views/Login.tsx | 6 ++-- src/auth/views/MagicLink.tsx | 6 ++-- src/auth/views/MobileAdsBenefits.tsx | 6 ++-- src/auth/views/components/AuthContainer.tsx | 6 ++-- .../BasicAttentionTokenLandingPage.tsx | 14 ++++---- src/checkout/hooks/useCreatePaymentSession.ts | 4 +-- .../hooks/useValidatePaymentSession.ts | 2 +- src/checkout/lib/index.ts | 2 +- src/components/AppBar/LandingPageAppBar.tsx | 10 +++--- src/components/Assets/AdvertiserAssets.tsx | 18 +++++----- src/components/Assets/ImageAutocomplete.tsx | 6 ++-- src/components/Assets/ImagePreview.tsx | 4 +-- src/components/Assets/UploadImage.tsx | 6 ++-- src/components/Assets/hooks/useUploadFile.ts | 10 +++--- src/components/Background/Background.tsx | 4 +-- src/components/Button/LearnMoreButton.tsx | 2 +- src/components/Button/SubmitPanel.tsx | 2 +- .../Campaigns/CampaignAgeFilter.tsx | 2 +- .../Campaigns/CampaignDateRange.tsx | 2 +- src/components/Campaigns/CloneCampaign.tsx | 14 ++++---- src/components/Campaigns/Status.tsx | 2 +- .../Conversion/ConversionDisplay.tsx | 4 +-- .../Conversion/ConversionFields.tsx | 2 +- src/components/Country/CountryPicker.tsx | 2 +- src/components/Country/useCountries.ts | 2 +- .../Creatives/CreateCreativeButton.tsx | 8 ++--- .../Creatives/CreativeCampaigns.tsx | 8 ++--- src/components/Creatives/CreativeForm.tsx | 34 +++++++++---------- src/components/Creatives/CreativeList.tsx | 22 ++++++------ src/components/Creatives/CreativeSelect.tsx | 14 ++++---- .../Creatives/CreativeSpecificPreview.tsx | 12 +++---- .../Creatives/CreativeStatusSwitch.tsx | 8 ++--- src/components/Creatives/CreativeType.tsx | 4 +-- src/components/Creatives/NewsPreview.tsx | 6 ++-- .../Creatives/NotificationPreview.tsx | 4 +-- .../Creatives/SelectCreativeHeader.tsx | 4 +-- .../Creatives/hooks/useGetCreativeDetails.tsx | 6 ++-- .../Creatives/hooks/useSubmitCreative.tsx | 10 +++--- src/components/Datagrid/renderers.tsx | 18 +++++----- src/components/Drawer/MiniSideBar.tsx | 8 ++--- src/components/Drawer/SupportMenu.tsx | 6 ++-- src/components/Error/ErrorDetail.tsx | 2 +- src/components/Location/LocationPicker.tsx | 4 +-- src/components/Navigation/DraftMenu.tsx | 2 +- src/components/Navigation/Navbar.tsx | 14 ++++---- .../Navigation/NewCampaignButton.tsx | 2 +- .../Navigation/NewCreativeButton.tsx | 2 +- src/components/Navigation/NewImageButton.tsx | 2 +- src/components/Route/ProtectedRoute.tsx | 4 +-- src/components/Segment/SegmentPicker.tsx | 6 ++-- src/components/Steps/ActionButtons.tsx | 4 +-- src/components/Steps/StepDrawer.tsx | 4 +-- src/components/Switch/OnOff.tsx | 2 +- src/components/Url/use-url-validation.ts | 2 +- src/form/FormikHelpers.tsx | 2 +- src/form/PersistFormValues.tsx | 4 +-- src/form/PersistRegistrationValues.tsx | 2 +- src/form/fragmentUtil.ts | 6 ++-- src/index.tsx | 10 +++--- src/state/context.ts | 2 +- src/theme.tsx | 2 +- src/user/User.tsx | 22 ++++++------ src/user/adSet/AdSetList.tsx | 20 +++++------ src/user/ads/AdList.tsx | 14 ++++---- src/user/ads/AdsExistingAd.tsx | 18 +++++----- src/user/ads/InlineContentAd.tsx | 14 ++++---- src/user/ads/NewAd.tsx | 8 ++--- src/user/ads/NotificationAd.tsx | 10 +++--- src/user/ads/ShowAdsButton.tsx | 2 +- .../components/BaseBarChart.tsx | 2 +- .../components/BasePieChart.tsx | 2 +- .../components/EngagementHeader.tsx | 4 +-- .../analyticsOverview/components/LiveFeed.tsx | 2 +- .../components/MetricFilter.tsx | 8 ++--- .../components/ReportUtils.tsx | 8 ++--- .../hooks/usePersistMetricFilter.ts | 2 +- .../analyticsOverview/lib/ads.library.ts | 6 ++-- .../analyticsOverview/lib/os.library.ts | 2 +- .../analyticsOverview/lib/overview.library.ts | 4 +-- .../reports/campaign/EngagementsOverview.tsx | 8 ++--- .../reports/os/OsOverview.tsx | 2 +- .../reports/os/components/OsBarChart.tsx | 5 ++- .../reports/os/components/OsPieChart.tsx | 4 +-- src/user/analytics/renderers/index.tsx | 10 +++--- src/user/analytics/search/AdSetBreakdown.tsx | 12 +++---- src/user/analytics/search/MetricSelector.tsx | 2 +- src/user/analytics/search/MetricsList.tsx | 4 +-- src/user/analytics/search/OverTimeGraph.tsx | 4 +-- src/user/analytics/search/RenderMetric.tsx | 2 +- src/user/analytics/search/metrics.ts | 4 +-- src/user/analytics/search/series.test.ts | 2 +- src/user/analytics/search/series.ts | 2 +- src/user/campaignList/CampaignList.tsx | 24 ++++++------- src/user/campaignList/EditButton.tsx | 4 +-- src/user/campaignList/MetricValue.tsx | 2 +- src/user/hooks/useAdvertiserCreatives.ts | 4 +-- src/user/hooks/useAdvertiserWithPrices.tsx | 10 +++--- src/user/hooks/useGenerateApiKey.tsx | 4 +-- src/user/library/index.test.ts | 14 +++++--- src/user/library/index.ts | 10 +++--- src/user/reporting/ReportMenu.tsx | 2 +- src/user/reporting/csv.library.tsx | 4 +-- src/user/settings/NewKeyPairModal.tsx | 8 ++--- src/user/settings/Settings.tsx | 14 ++++---- src/user/settings/UserApiKey.tsx | 6 ++-- src/user/settings/UserForm.tsx | 16 ++++----- src/user/views/adsManager/types/index.ts | 8 ++--- .../advanced/components/adSet/AdSetFields.tsx | 22 ++++++------ .../advanced/components/adSet/NewAdSet.tsx | 6 ++-- .../components/adSet/fields/AdSetAds.tsx | 24 ++++++------- .../adSet/fields/ConversionField.tsx | 6 ++-- .../components/adSet/fields/PickerFields.tsx | 12 +++---- .../components/campaign/CampaignSettings.tsx | 24 ++++++------- .../components/BillingModelSelect.tsx | 16 ++++----- .../campaign/components/CustomPriceSelect.tsx | 6 ++-- .../campaign/fields/BudgetField.tsx | 4 +-- .../campaign/fields/FormatField.tsx | 14 ++++---- .../campaign/fields/LocationField.tsx | 4 +-- .../campaign/fields/PaymentMethodField.tsx | 10 +++--- .../completionForm/CompletionForm.tsx | 4 +-- .../advanced/components/form/EditCampaign.tsx | 18 +++++----- .../advanced/components/form/NewCampaign.tsx | 24 ++++++------- .../components/form/components/BaseForm.tsx | 14 ++++---- .../form/components/PaymentButton.tsx | 6 ++-- .../advanced/components/review/Review.tsx | 4 +-- .../review/components/AdSetReview.tsx | 10 +++--- .../review/components/CampaignReview.tsx | 6 ++-- .../review/components/ReviewContainer.tsx | 2 +- src/user/views/user/AdDetailTable.tsx | 8 ++--- src/user/views/user/CampaignDetails.tsx | 12 +++---- .../views/user/CampaignReportViewSelector.tsx | 8 ++--- src/user/views/user/CampaignView.tsx | 18 +++++----- src/user/views/user/Profile.tsx | 8 ++--- .../user/reports/ConsultAccountManager.tsx | 2 +- .../reports/OriginalCampaignReportView.tsx | 14 ++++---- .../user/reports/SearchCampaignReportView.tsx | 26 +++++++------- src/util/campaign.ts | 2 +- src/util/displayState.ts | 2 +- src/validation/CampaignSchema.test.ts | 4 +-- src/validation/CampaignSchema.tsx | 14 ++++---- src/validation/CreativeSchema.tsx | 2 +- src/validation/RegistrationSchema.test.ts | 4 +-- src/validation/RegistrationSchema.tsx | 2 +- tsconfig.json | 7 ++-- 175 files changed, 659 insertions(+), 651 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 06c608ea..cc5c14b4 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,23 +2,23 @@ import { useState } from "react"; import { Redirect, Route, Switch } from "react-router-dom"; -import { DraftContext, getAllDrafts } from "state/context"; -import { User } from "user/User"; +import { DraftContext, getAllDrafts } from "@/state/context"; +import { User } from "@/user/User"; import { CssBaseline, StyledEngineProvider, ThemeProvider, } from "@mui/material"; -import { theme } from "theme"; -import { CampaignForm } from "user/views/adsManager/types"; -import { AuthVerify } from "auth/views/AuthVerify"; -import { Login } from "auth/views/Login"; -import { MagicLink } from "auth/views/MagicLink"; -import { Register } from "auth/registration/Register"; -import { LandingPage } from "auth/views/LandingPage"; -import { BraveAdsContactFrame } from "auth/registration/BraveAdsContactFrame"; +import { theme } from "./theme"; +import { CampaignForm } from "@/user/views/adsManager/types"; +import { AuthVerify } from "@/auth/views/AuthVerify"; +import { Login } from "@/auth/views/Login"; +import { MagicLink } from "@/auth/views/MagicLink"; +import { Register } from "@/auth/registration/Register"; +import { LandingPage } from "@/auth/views/LandingPage"; +import { BraveAdsContactFrame } from "@/auth/registration/BraveAdsContactFrame"; import { useMatomo } from "@jonkoops/matomo-tracker-react"; -import { BasicAttentionTokenLandingPage } from "basic-attention-token/BasicAttentionTokenLandingPage"; +import { BasicAttentionTokenLandingPage } from "@/basic-attention-token/BasicAttentionTokenLandingPage"; export function App() { const { enableLinkTracking } = useMatomo(); diff --git a/src/ErrorBoundary.tsx b/src/ErrorBoundary.tsx index 479e01b3..ea272a91 100644 --- a/src/ErrorBoundary.tsx +++ b/src/ErrorBoundary.tsx @@ -1,5 +1,5 @@ import { Component, PropsWithChildren } from "react"; -import { ErrorDetail } from "components/Error/ErrorDetail"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; interface State { error: unknown | null; diff --git a/src/auth/components/AdvertiserAddress.tsx b/src/auth/components/AdvertiserAddress.tsx index 7bf27a24..be54c63e 100644 --- a/src/auth/components/AdvertiserAddress.tsx +++ b/src/auth/components/AdvertiserAddress.tsx @@ -1,8 +1,8 @@ import { Box, Stack } from "@mui/material"; -import { FormikTextField } from "form/FormikHelpers"; -import { CountryPicker } from "components/Country/CountryPicker"; +import { FormikTextField } from "@/form/FormikHelpers"; +import { CountryPicker } from "@/components/Country/CountryPicker"; import { PropsWithChildren } from "react"; -import { AdvertiserBillingAddressFragment } from "graphql/advertiser.generated"; +import { AdvertiserBillingAddressFragment } from "@/graphql/advertiser.generated"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/auth/components/AdvertiserAgreed.tsx b/src/auth/components/AdvertiserAgreed.tsx index be60e679..28d0d355 100644 --- a/src/auth/components/AdvertiserAgreed.tsx +++ b/src/auth/components/AdvertiserAgreed.tsx @@ -1,8 +1,8 @@ import { Box, Link, Stack } from "@mui/material"; -import { FormikCheckbox } from "form/FormikHelpers"; +import { FormikCheckbox } from "@/form/FormikHelpers"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; export function AdvertiserAgreed(props: { requiresPaymentAgree: boolean }) { const { _ } = useLingui(); diff --git a/src/auth/components/AdvertiserDetailsForm.tsx b/src/auth/components/AdvertiserDetailsForm.tsx index 78054e99..0ae2c15d 100644 --- a/src/auth/components/AdvertiserDetailsForm.tsx +++ b/src/auth/components/AdvertiserDetailsForm.tsx @@ -1,22 +1,22 @@ import { Box, Card, Container, Skeleton } from "@mui/material"; import Typography from "@mui/material/Typography"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Form, Formik } from "formik"; -import { AdvertiserAddress } from "auth/components/AdvertiserAddress"; -import { useAuthContext } from "auth/context/auth.hook"; +import { AdvertiserAddress } from "@/auth/components/AdvertiserAddress"; +import { useAuthContext } from "@/auth/context/auth.hook"; import { useAdvertiserBillingAddressQuery, useUpdateAdvertiserMutation, -} from "graphql/advertiser.generated"; -import { getUser } from "auth/lib"; -import { AdvertiserForm, initialAdvertiserForm } from "auth/components/types"; +} from "@/graphql/advertiser.generated"; +import { getUser } from "@/auth/lib"; +import { AdvertiserForm, initialAdvertiserForm } from "@/auth/components/types"; import { useHistory } from "react-router-dom"; -import { PaymentType } from "graphql/types"; -import { AdvertiserAgreed } from "auth/components/AdvertiserAgreed"; -import { FormikSubmitButton } from "form/FormikButton"; -import { AdvertiserSchema } from "validation/AdvertiserSchema"; +import { PaymentType } from "@/graphql/types"; +import { AdvertiserAgreed } from "@/auth/components/AdvertiserAgreed"; +import { FormikSubmitButton } from "@/form/FormikButton"; +import { AdvertiserSchema } from "@/validation/AdvertiserSchema"; import { useState } from "react"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import _ from "lodash"; import { msg, Trans } from "@lingui/macro"; diff --git a/src/auth/components/types.ts b/src/auth/components/types.ts index 7126a67e..5c8db00f 100644 --- a/src/auth/components/types.ts +++ b/src/auth/components/types.ts @@ -1,4 +1,4 @@ -import { AdvertiserBillingAddressFragment } from "graphql/advertiser.generated"; +import { AdvertiserBillingAddressFragment } from "@/graphql/advertiser.generated"; export type AdvertiserForm = { tracking: boolean; diff --git a/src/auth/context/auth.hook.ts b/src/auth/context/auth.hook.ts index a9e4bab6..94a5ca23 100644 --- a/src/auth/context/auth.hook.ts +++ b/src/auth/context/auth.hook.ts @@ -1,5 +1,5 @@ import { useContext } from "react"; -import { IAuthContext } from "auth/context/auth.state"; +import { IAuthContext } from "@/auth/context/auth.state"; export function useAuthContext() { return useContext(IAuthContext); diff --git a/src/auth/context/auth.interface.ts b/src/auth/context/auth.interface.ts index 01def0b6..cb52b02b 100644 --- a/src/auth/context/auth.interface.ts +++ b/src/auth/context/auth.interface.ts @@ -1,6 +1,6 @@ import { ReactNode } from "react"; import { ResponseUser } from "../lib"; -import { PaymentType } from "graphql/types"; +import { PaymentType } from "@/graphql/types"; export type IAdvertiser = { id: string; diff --git a/src/auth/hooks/mutations/useGetLink.ts b/src/auth/hooks/mutations/useGetLink.ts index 83057b60..3248b99e 100644 --- a/src/auth/hooks/mutations/useGetLink.ts +++ b/src/auth/hooks/mutations/useGetLink.ts @@ -1,5 +1,5 @@ import { useCallback, useState } from "react"; -import { getLink } from "auth/lib"; +import { getLink } from "@/auth/lib"; import { t } from "@lingui/macro"; interface Options { diff --git a/src/auth/hooks/mutations/useRegister.ts b/src/auth/hooks/mutations/useRegister.ts index 9e3b217d..c8223288 100644 --- a/src/auth/hooks/mutations/useRegister.ts +++ b/src/auth/hooks/mutations/useRegister.ts @@ -1,8 +1,8 @@ import { useCallback, useState } from "react"; -import { RegistrationForm } from "auth/registration/types"; -import { sendMarketingEmail, submitRegistration } from "auth/lib"; -import { clearRegistrationValues } from "form/PersistRegistrationValues"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { RegistrationForm } from "@/auth/registration/types"; +import { sendMarketingEmail, submitRegistration } from "@/auth/lib"; +import { clearRegistrationValues } from "@/form/PersistRegistrationValues"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { t } from "@lingui/macro"; import { useHistory } from "react-router-dom"; diff --git a/src/auth/hooks/mutations/useSignIn.ts b/src/auth/hooks/mutations/useSignIn.ts index cca2740d..f9d98707 100644 --- a/src/auth/hooks/mutations/useSignIn.ts +++ b/src/auth/hooks/mutations/useSignIn.ts @@ -1,6 +1,6 @@ import { useCallback, useState } from "react"; -import { useAuthContext } from "auth/context/auth.hook"; -import { getCredentials } from "auth/lib"; +import { useAuthContext } from "@/auth/context/auth.hook"; +import { getCredentials } from "@/auth/lib"; interface Options { onError?: (message: string) => void; diff --git a/src/auth/hooks/mutations/useSignOut.ts b/src/auth/hooks/mutations/useSignOut.ts index 792a588e..d5bb5b13 100644 --- a/src/auth/hooks/mutations/useSignOut.ts +++ b/src/auth/hooks/mutations/useSignOut.ts @@ -1,6 +1,6 @@ import { useCallback, useState } from "react"; -import { useAuthContext } from "auth/context/auth.hook"; -import { clearCredentials } from "auth/lib"; +import { useAuthContext } from "@/auth/context/auth.hook"; +import { clearCredentials } from "@/auth/lib"; interface Options { onSuccess?: () => void; diff --git a/src/auth/hooks/queries/useAdvertiser.ts b/src/auth/hooks/queries/useAdvertiser.ts index 83164060..990460b7 100644 --- a/src/auth/hooks/queries/useAdvertiser.ts +++ b/src/auth/hooks/queries/useAdvertiser.ts @@ -1,6 +1,6 @@ -import { useAuthContext } from "auth/context/auth.hook"; -import { IAdvertiser } from "auth/context/auth.interface"; -import { PaymentType } from "graphql/types"; +import { useAuthContext } from "@/auth/context/auth.hook"; +import { IAdvertiser } from "@/auth/context/auth.interface"; +import { PaymentType } from "@/graphql/types"; export function useAdvertiser(): { advertiser: IAdvertiser; diff --git a/src/auth/hooks/queries/useAuthorize.ts b/src/auth/hooks/queries/useAuthorize.ts index 3b2f1476..5739b414 100644 --- a/src/auth/hooks/queries/useAuthorize.ts +++ b/src/auth/hooks/queries/useAuthorize.ts @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { useAuthContext } from "auth/context/auth.hook"; -import { authorize, ResponseUser } from "auth/lib"; +import { useAuthContext } from "@/auth/context/auth.hook"; +import { authorize, ResponseUser } from "@/auth/lib"; interface Options { variables: { diff --git a/src/auth/hooks/queries/useIsAuthenticated.ts b/src/auth/hooks/queries/useIsAuthenticated.ts index 5bad90fd..2aa1677c 100644 --- a/src/auth/hooks/queries/useIsAuthenticated.ts +++ b/src/auth/hooks/queries/useIsAuthenticated.ts @@ -1,4 +1,4 @@ -import { useAuthContext } from "auth/context/auth.hook"; +import { useAuthContext } from "@/auth/context/auth.hook"; export function useIsAuthenticated(): boolean | undefined { const { isInitialized, isAuthenticated } = useAuthContext(); diff --git a/src/auth/hooks/queries/useUser.ts b/src/auth/hooks/queries/useUser.ts index 0d06f479..61fa6025 100644 --- a/src/auth/hooks/queries/useUser.ts +++ b/src/auth/hooks/queries/useUser.ts @@ -1,4 +1,4 @@ -import { useAuthContext } from "auth/context/auth.hook"; +import { useAuthContext } from "@/auth/context/auth.hook"; type User = { userId?: string; diff --git a/src/auth/index.tsx b/src/auth/index.tsx index ca90789a..5327ebcd 100644 --- a/src/auth/index.tsx +++ b/src/auth/index.tsx @@ -3,8 +3,8 @@ import { IAdvertiser, IAuthProviderProps, IAuthState, -} from "auth/context/auth.interface"; -import { IAuthContext, initialState } from "auth/context/auth.state"; +} from "@/auth/context/auth.interface"; +import { IAuthContext, initialState } from "@/auth/context/auth.state"; import { getUser, ResponseUser } from "./lib"; import _ from "lodash"; import { setActiveAdvertiser } from "./util"; diff --git a/src/auth/lib/index.ts b/src/auth/lib/index.ts index 8ac34875..e5240bab 100644 --- a/src/auth/lib/index.ts +++ b/src/auth/lib/index.ts @@ -1,11 +1,11 @@ -import { UserFragment } from "graphql/user.generated"; -import { AdvertiserFragment } from "graphql/advertiser.generated"; -import { PaymentType } from "graphql/types"; +import { UserFragment } from "@/graphql/user.generated"; +import { AdvertiserFragment } from "@/graphql/advertiser.generated"; +import { PaymentType } from "@/graphql/types"; import { buildAdServerEndpoint, buildAdServerV2Endpoint, -} from "util/environment"; -import { RegistrationForm } from "auth/registration/types"; +} from "@/util/environment"; +import { RegistrationForm } from "@/auth/registration/types"; import { t } from "@lingui/macro"; export type Advertiser = Pick< diff --git a/src/auth/registration/AccountChoice.tsx b/src/auth/registration/AccountChoice.tsx index 6bb593c9..c695768c 100644 --- a/src/auth/registration/AccountChoice.tsx +++ b/src/auth/registration/AccountChoice.tsx @@ -12,10 +12,10 @@ import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { MessageDescriptor } from "@lingui/core"; import { useState } from "react"; -import logo from "assets/images/brave-icon-release-color.svg"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; -import { useIsMobile } from "hooks/useIsMobile"; -import { AuthContainer } from "auth/views/components/AuthContainer"; +import logo from "@/assets/images/brave-icon-release-color.svg"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; +import { useIsMobile } from "@/hooks/useIsMobile"; +import { AuthContainer } from "@/auth/views/components/AuthContainer"; interface ChoiceOptions { title: MessageDescriptor; diff --git a/src/auth/registration/AdvertiserRegistered.tsx b/src/auth/registration/AdvertiserRegistered.tsx index feb1efe0..fc9d067b 100644 --- a/src/auth/registration/AdvertiserRegistered.tsx +++ b/src/auth/registration/AdvertiserRegistered.tsx @@ -1,8 +1,8 @@ import { Link, Stack, Typography } from "@mui/material"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; -import { AuthContainer } from "auth/views/components/AuthContainer"; -import logo from "assets/images/brave-icon-release-color.svg"; +import { AuthContainer } from "@/auth/views/components/AuthContainer"; +import logo from "@/assets/images/brave-icon-release-color.svg"; export function AdvertiserRegistered() { useTrackMatomoPageView({ documentTitle: "Advertiser Registration Complete" }); diff --git a/src/auth/registration/BraveAdsContactFrame.tsx b/src/auth/registration/BraveAdsContactFrame.tsx index d5c334e8..b3b39fc8 100644 --- a/src/auth/registration/BraveAdsContactFrame.tsx +++ b/src/auth/registration/BraveAdsContactFrame.tsx @@ -1,7 +1,7 @@ import { Box, Stack, Toolbar, Typography } from "@mui/material"; -import { LandingPageAppBar } from "components/AppBar/LandingPageAppBar"; -import { Background } from "components/Background/Background"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { LandingPageAppBar } from "@/components/AppBar/LandingPageAppBar"; +import { Background } from "@/components/Background/Background"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; export function BraveAdsContactFrame() { diff --git a/src/auth/registration/BrowserForm.tsx b/src/auth/registration/BrowserForm.tsx index 641c9e71..3f2c56a6 100644 --- a/src/auth/registration/BrowserForm.tsx +++ b/src/auth/registration/BrowserForm.tsx @@ -1,8 +1,8 @@ -import { FormikTextField } from "form/FormikHelpers"; -import { MarketingOptIn } from "auth/registration/MarketingOptIn"; +import { FormikTextField } from "@/form/FormikHelpers"; +import { MarketingOptIn } from "@/auth/registration/MarketingOptIn"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; -import { MarketingChannel } from "auth/registration/MarketingChannel"; +import { MarketingChannel } from "@/auth/registration/MarketingChannel"; import { Box } from "@mui/material"; export function BrowserForm() { diff --git a/src/auth/registration/BrowserRegister.tsx b/src/auth/registration/BrowserRegister.tsx index 76691b5a..aea933b8 100644 --- a/src/auth/registration/BrowserRegister.tsx +++ b/src/auth/registration/BrowserRegister.tsx @@ -1,14 +1,14 @@ import { Form, Formik } from "formik"; -import { initialValues, RegistrationForm } from "auth/registration/types"; -import { FormikSubmitButton } from "form/FormikButton"; -import { useRegister } from "auth/hooks/mutations/useRegister"; +import { initialValues, RegistrationForm } from "@/auth/registration/types"; +import { FormikSubmitButton } from "@/form/FormikButton"; +import { useRegister } from "@/auth/hooks/mutations/useRegister"; import { Box } from "@mui/material"; -import { PersistRegistrationValues } from "form/PersistRegistrationValues"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { PersistRegistrationValues } from "@/form/PersistRegistrationValues"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg } from "@lingui/macro"; -import { RegistrationContainer } from "auth/registration/RegistrationContainer"; -import { BrowserForm } from "auth/registration/BrowserForm"; -import { RegistrationSchema } from "validation/RegistrationSchema"; +import { RegistrationContainer } from "@/auth/registration/RegistrationContainer"; +import { BrowserForm } from "@/auth/registration/BrowserForm"; +import { RegistrationSchema } from "@/validation/RegistrationSchema"; export function BrowserRegister() { useTrackMatomoPageView({ diff --git a/src/auth/registration/MarketingChannel.tsx b/src/auth/registration/MarketingChannel.tsx index 0b2c9f12..b7ece086 100644 --- a/src/auth/registration/MarketingChannel.tsx +++ b/src/auth/registration/MarketingChannel.tsx @@ -1,4 +1,4 @@ -import { FormikSelect, FormikTextField } from "form/FormikHelpers"; +import { FormikSelect, FormikTextField } from "@/form/FormikHelpers"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { useField } from "formik"; diff --git a/src/auth/registration/MarketingOptIn.tsx b/src/auth/registration/MarketingOptIn.tsx index 8973eba4..c4786fc1 100644 --- a/src/auth/registration/MarketingOptIn.tsx +++ b/src/auth/registration/MarketingOptIn.tsx @@ -1,4 +1,4 @@ -import { FormikCheckbox } from "form/FormikHelpers"; +import { FormikCheckbox } from "@/form/FormikHelpers"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; import { Box } from "@mui/material"; diff --git a/src/auth/registration/Register.tsx b/src/auth/registration/Register.tsx index 1215e71d..eeca72c5 100644 --- a/src/auth/registration/Register.tsx +++ b/src/auth/registration/Register.tsx @@ -1,6 +1,6 @@ -import { AdvertiserRegistered } from "auth/registration/AdvertiserRegistered"; +import { AdvertiserRegistered } from "@/auth/registration/AdvertiserRegistered"; import { Route, Switch } from "react-router-dom"; -import { BrowserRegister } from "auth/registration/BrowserRegister"; +import { BrowserRegister } from "@/auth/registration/BrowserRegister"; import { SearchRegister } from "./SearchRegister"; import { AccountChoice } from "./AccountChoice"; diff --git a/src/auth/registration/RegistrationContainer.tsx b/src/auth/registration/RegistrationContainer.tsx index 0c4a1029..df47ea34 100644 --- a/src/auth/registration/RegistrationContainer.tsx +++ b/src/auth/registration/RegistrationContainer.tsx @@ -1,12 +1,12 @@ import { PropsWithChildren } from "react"; -import { PaddedCardContainer } from "components/Card/PaddedCardContainer"; -import logo from "assets/images/brave-icon-release-color.svg"; +import { PaddedCardContainer } from "@/components/Card/PaddedCardContainer"; +import logo from "@/assets/images/brave-icon-release-color.svg"; import Typography from "@mui/material/Typography"; import { Trans } from "@lingui/macro"; -import { PrivacyPolicy } from "basic-attention-token/PrivacyPolicy"; -import { useIsMobile } from "hooks/useIsMobile"; -import { LandingPageAppBar } from "components/AppBar/LandingPageAppBar"; -import { Background } from "components/Background/Background"; +import { PrivacyPolicy } from "@/basic-attention-token/PrivacyPolicy"; +import { useIsMobile } from "@/hooks/useIsMobile"; +import { LandingPageAppBar } from "@/components/AppBar/LandingPageAppBar"; +import { Background } from "@/components/Background/Background"; import { Toolbar } from "@mui/material"; export function RegistrationContainer(props: PropsWithChildren) { diff --git a/src/auth/registration/SearchForm.tsx b/src/auth/registration/SearchForm.tsx index 14b6d6c3..55537bc2 100644 --- a/src/auth/registration/SearchForm.tsx +++ b/src/auth/registration/SearchForm.tsx @@ -1,10 +1,10 @@ import { Box } from "@mui/material"; -import { FormikTextField } from "form/FormikHelpers"; -import { MarketingOptIn } from "auth/registration/MarketingOptIn"; +import { FormikTextField } from "@/form/FormikHelpers"; +import { MarketingOptIn } from "@/auth/registration/MarketingOptIn"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; -import { MarketingChannel } from "auth/registration/MarketingChannel"; -import { CountryPicker } from "components/Country/CountryPicker"; +import { MarketingChannel } from "@/auth/registration/MarketingChannel"; +import { CountryPicker } from "@/components/Country/CountryPicker"; export function SearchForm() { const { _ } = useLingui(); diff --git a/src/auth/registration/SearchRegister.tsx b/src/auth/registration/SearchRegister.tsx index 10c40f7d..c0d4b1f6 100644 --- a/src/auth/registration/SearchRegister.tsx +++ b/src/auth/registration/SearchRegister.tsx @@ -1,13 +1,13 @@ import { Form, Formik } from "formik"; -import { initialValues, RegistrationForm } from "auth/registration/types"; -import { FormikSubmitButton } from "form/FormikButton"; -import { useRegister } from "auth/hooks/mutations/useRegister"; +import { initialValues, RegistrationForm } from "@/auth/registration/types"; +import { FormikSubmitButton } from "@/form/FormikButton"; +import { useRegister } from "@/auth/hooks/mutations/useRegister"; import { Box } from "@mui/material"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg } from "@lingui/macro"; -import { RegistrationContainer } from "auth/registration/RegistrationContainer"; -import { RegistrationSchema } from "validation/RegistrationSchema"; -import { SearchForm } from "auth/registration/SearchForm"; +import { RegistrationContainer } from "@/auth/registration/RegistrationContainer"; +import { RegistrationSchema } from "@/validation/RegistrationSchema"; +import { SearchForm } from "@/auth/registration/SearchForm"; export function SearchRegister() { useTrackMatomoPageView({ diff --git a/src/auth/views/AuthVerify.tsx b/src/auth/views/AuthVerify.tsx index e1e51a82..a0bac75f 100644 --- a/src/auth/views/AuthVerify.tsx +++ b/src/auth/views/AuthVerify.tsx @@ -1,10 +1,10 @@ -import { AuthContainer } from "auth/views/components/AuthContainer"; -import { useAuthorize } from "auth/hooks/queries/useAuthorize"; +import { AuthContainer } from "@/auth/views/components/AuthContainer"; +import { useAuthorize } from "@/auth/hooks/queries/useAuthorize"; import { Link as RouterLink, useHistory } from "react-router-dom"; import { CircularProgress, Link, Stack, Typography } from "@mui/material"; import VerifiedIcon from "@mui/icons-material/Verified"; import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; export function AuthVerify() { diff --git a/src/auth/views/LandingPage.tsx b/src/auth/views/LandingPage.tsx index 833f4deb..68a96897 100644 --- a/src/auth/views/LandingPage.tsx +++ b/src/auth/views/LandingPage.tsx @@ -1,13 +1,13 @@ -import { Background } from "components/Background/Background"; -import { LandingPageAppBar } from "components/AppBar/LandingPageAppBar"; +import { Background } from "@/components/Background/Background"; +import { LandingPageAppBar } from "@/components/AppBar/LandingPageAppBar"; import { Box, Button, Link, Stack, Toolbar, Typography } from "@mui/material"; -import benefits from "assets/images/ad-benefits.svg"; -import { useIsAuthenticated } from "auth/hooks/queries/useIsAuthenticated"; +import benefits from "@/assets/images/ad-benefits.svg"; +import { useIsAuthenticated } from "@/auth/hooks/queries/useIsAuthenticated"; import { Link as RouterLink } from "react-router-dom"; -import { useIsMobile } from "hooks/useIsMobile"; -import { MobileAdsBenefits } from "auth/views/MobileAdsBenefits"; -import { GradientText } from "components/Typography/GradientText"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { useIsMobile } from "@/hooks/useIsMobile"; +import { MobileAdsBenefits } from "@/auth/views/MobileAdsBenefits"; +import { GradientText } from "@/components/Typography/GradientText"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/auth/views/Login.tsx b/src/auth/views/Login.tsx index 77bcdcbb..79897a59 100644 --- a/src/auth/views/Login.tsx +++ b/src/auth/views/Login.tsx @@ -2,9 +2,9 @@ import { Alert, Link, TextField, Typography } from "@mui/material"; import { LoadingButton } from "@mui/lab"; import { useState } from "react"; import { Link as RouterLink, useHistory } from "react-router-dom"; -import { useSignIn } from "auth/hooks/mutations/useSignIn"; -import { AuthContainer } from "auth/views/components/AuthContainer"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { useSignIn } from "@/auth/hooks/mutations/useSignIn"; +import { AuthContainer } from "@/auth/views/components/AuthContainer"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { Trans, msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/auth/views/MagicLink.tsx b/src/auth/views/MagicLink.tsx index 41036344..bf7346f1 100644 --- a/src/auth/views/MagicLink.tsx +++ b/src/auth/views/MagicLink.tsx @@ -2,10 +2,10 @@ import { useState } from "react"; import { Link, TextField, Typography } from "@mui/material"; import { Link as RouterLink } from "react-router-dom"; -import { useGetLink } from "auth/hooks/mutations/useGetLink"; +import { useGetLink } from "@/auth/hooks/mutations/useGetLink"; import { LoadingButton } from "@mui/lab"; -import { AuthContainer } from "auth/views/components/AuthContainer"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { AuthContainer } from "@/auth/views/components/AuthContainer"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/auth/views/MobileAdsBenefits.tsx b/src/auth/views/MobileAdsBenefits.tsx index 9689c182..947460eb 100644 --- a/src/auth/views/MobileAdsBenefits.tsx +++ b/src/auth/views/MobileAdsBenefits.tsx @@ -1,8 +1,8 @@ import { Card, CardMedia, List, ListItem, Typography } from "@mui/material"; -import allSizes from "assets/images/all_sizes_frame.svg"; -import powerfulFormats from "assets/images/powerful_format_frame.svg"; -import privacyFocused from "assets/images/privacy_focused_frame.svg"; +import allSizes from "@/assets/images/all_sizes_frame.svg"; +import powerfulFormats from "@/assets/images/powerful_format_frame.svg"; +import privacyFocused from "@/assets/images/privacy_focused_frame.svg"; import { msg } from "@lingui/macro"; import { MessageDescriptor } from "@lingui/core"; import { Trans } from "@lingui/react"; diff --git a/src/auth/views/components/AuthContainer.tsx b/src/auth/views/components/AuthContainer.tsx index bf621812..7b687ef8 100644 --- a/src/auth/views/components/AuthContainer.tsx +++ b/src/auth/views/components/AuthContainer.tsx @@ -1,8 +1,8 @@ import { Box } from "@mui/material"; -import { Background } from "components/Background/Background"; -import { LandingPageAppBar } from "components/AppBar/LandingPageAppBar"; +import { Background } from "@/components/Background/Background"; +import { LandingPageAppBar } from "@/components/AppBar/LandingPageAppBar"; import { ReactNode } from "react"; -import { PaddedCardContainer } from "components/Card/PaddedCardContainer"; +import { PaddedCardContainer } from "@/components/Card/PaddedCardContainer"; interface Props { children?: ReactNode; diff --git a/src/basic-attention-token/BasicAttentionTokenLandingPage.tsx b/src/basic-attention-token/BasicAttentionTokenLandingPage.tsx index 70560ca9..378b4e7d 100644 --- a/src/basic-attention-token/BasicAttentionTokenLandingPage.tsx +++ b/src/basic-attention-token/BasicAttentionTokenLandingPage.tsx @@ -1,15 +1,15 @@ import { useTrackMatomoEvent, useTrackMatomoPageView, -} from "hooks/useTrackWithMatomo"; -import { useIsMobile } from "hooks/useIsMobile"; -import { Background } from "components/Background/Background"; -import { LandingPageAppBar } from "components/AppBar/LandingPageAppBar"; +} from "@/hooks/useTrackWithMatomo"; +import { useIsMobile } from "@/hooks/useIsMobile"; +import { Background } from "@/components/Background/Background"; +import { LandingPageAppBar } from "@/components/AppBar/LandingPageAppBar"; import { Box, Button, Link, Stack, Toolbar, Typography } from "@mui/material"; import { Link as RouterLink } from "react-router-dom"; -import notification from "assets/images/newsfeed.png"; -import mobileAd from "assets/images/news-mobile.png"; -import bat from "assets/images/basic-attention-token.svg"; +import notification from "@/assets/images/newsfeed.png"; +import mobileAd from "@/assets/images/news-mobile.png"; +import bat from "@/assets/images/basic-attention-token.svg"; import { Trans } from "@lingui/macro"; export function BasicAttentionTokenLandingPage() { diff --git a/src/checkout/hooks/useCreatePaymentSession.ts b/src/checkout/hooks/useCreatePaymentSession.ts index af496db3..46bbb91e 100644 --- a/src/checkout/hooks/useCreatePaymentSession.ts +++ b/src/checkout/hooks/useCreatePaymentSession.ts @@ -1,6 +1,6 @@ -import { createPaymentSession } from "checkout/lib"; +import { createPaymentSession } from "@/checkout/lib"; import { useCallback, useState } from "react"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { useHistory } from "react-router-dom"; import { t } from "@lingui/macro"; diff --git a/src/checkout/hooks/useValidatePaymentSession.ts b/src/checkout/hooks/useValidatePaymentSession.ts index c1b877d1..1327aa70 100644 --- a/src/checkout/hooks/useValidatePaymentSession.ts +++ b/src/checkout/hooks/useValidatePaymentSession.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { fetchPaymentSession } from "checkout/lib"; +import { fetchPaymentSession } from "@/checkout/lib"; interface Props { sessionId: string | null; diff --git a/src/checkout/lib/index.ts b/src/checkout/lib/index.ts index a59d9cdb..4707dd0f 100644 --- a/src/checkout/lib/index.ts +++ b/src/checkout/lib/index.ts @@ -1,4 +1,4 @@ -import { buildAdServerEndpoint } from "util/environment"; +import { buildAdServerEndpoint } from "@/util/environment"; import { t } from "@lingui/macro"; export async function createPaymentSession( diff --git a/src/components/AppBar/LandingPageAppBar.tsx b/src/components/AppBar/LandingPageAppBar.tsx index 2dffffda..49ad49a2 100644 --- a/src/components/AppBar/LandingPageAppBar.tsx +++ b/src/components/AppBar/LandingPageAppBar.tsx @@ -7,14 +7,14 @@ import { Toolbar, Typography, } from "@mui/material"; -import ads from "assets/images/logo.svg"; +import ads from "@/assets/images/logo.svg"; import { Link as RouterLink, useRouteMatch } from "react-router-dom"; -import { useIsAuthenticated } from "auth/hooks/queries/useIsAuthenticated"; -import { useSignOut } from "auth/hooks/mutations/useSignOut"; -import { useIsMobile } from "hooks/useIsMobile"; +import { useIsAuthenticated } from "@/auth/hooks/queries/useIsAuthenticated"; +import { useSignOut } from "@/auth/hooks/mutations/useSignOut"; +import { useIsMobile } from "@/hooks/useIsMobile"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; -import { SupportMenu } from "components/Drawer/SupportMenu"; +import { SupportMenu } from "@/components/Drawer/SupportMenu"; export function LandingPageAppBar() { const match = useRouteMatch(); diff --git a/src/components/Assets/AdvertiserAssets.tsx b/src/components/Assets/AdvertiserAssets.tsx index bf764eb6..ddef2bfe 100644 --- a/src/components/Assets/AdvertiserAssets.tsx +++ b/src/components/Assets/AdvertiserAssets.tsx @@ -1,17 +1,17 @@ import { AdvertiserImageFragment, useAdvertiserImagesQuery, -} from "graphql/advertiser.generated"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { CardContainer } from "components/Card/CardContainer"; +} from "@/graphql/advertiser.generated"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Grid, LinearProgress, Typography } from "@mui/material"; -import MiniSideBar from "components/Drawer/MiniSideBar"; -import { ImagePreview } from "components/Assets/ImagePreview"; -import { CampaignFormat } from "graphql/types"; -import { RouteSelectionButton } from "components/Route/RouteSelectionButton"; +import MiniSideBar from "@/components/Drawer/MiniSideBar"; +import { ImagePreview } from "@/components/Assets/ImagePreview"; +import { CampaignFormat } from "@/graphql/types"; +import { RouteSelectionButton } from "@/components/Route/RouteSelectionButton"; import Box from "@mui/material/Box"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/components/Assets/ImageAutocomplete.tsx b/src/components/Assets/ImageAutocomplete.tsx index 9da82320..c63c2ede 100644 --- a/src/components/Assets/ImageAutocomplete.tsx +++ b/src/components/Assets/ImageAutocomplete.tsx @@ -1,9 +1,9 @@ -import { useAdvertiserImagesQuery } from "graphql/advertiser.generated"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiserImagesQuery } from "@/graphql/advertiser.generated"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Autocomplete, createFilterOptions, TextField } from "@mui/material"; import { useEffect, useState } from "react"; import { useField } from "formik"; -import { UploadImage } from "components/Assets/UploadImage"; +import { UploadImage } from "@/components/Assets/UploadImage"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/components/Assets/ImagePreview.tsx b/src/components/Assets/ImagePreview.tsx index 4afa7cb1..672339b7 100644 --- a/src/components/Assets/ImagePreview.tsx +++ b/src/components/Assets/ImagePreview.tsx @@ -1,6 +1,6 @@ import { Box, Link, Skeleton } from "@mui/material"; -import { useGetImagePreviewUrl } from "components/Assets/hooks/useGetImagePreviewUrl"; -import { ErrorDetail } from "components/Error/ErrorDetail"; +import { useGetImagePreviewUrl } from "@/components/Assets/hooks/useGetImagePreviewUrl"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/components/Assets/UploadImage.tsx b/src/components/Assets/UploadImage.tsx index ca6e686d..a14944ca 100644 --- a/src/components/Assets/UploadImage.tsx +++ b/src/components/Assets/UploadImage.tsx @@ -14,9 +14,9 @@ import { StepLabel, Stepper, } from "@mui/material"; -import { CampaignFormat } from "graphql/types"; -import { useUploadFile } from "components/Assets/hooks/useUploadFile"; -import { NewImageButton } from "components/Navigation/NewImageButton"; +import { CampaignFormat } from "@/graphql/types"; +import { useUploadFile } from "@/components/Assets/hooks/useUploadFile"; +import { NewImageButton } from "@/components/Navigation/NewImageButton"; import { Trans } from "@lingui/macro"; export interface UploadConfig { diff --git a/src/components/Assets/hooks/useUploadFile.ts b/src/components/Assets/hooks/useUploadFile.ts index b91aadbc..7944c713 100644 --- a/src/components/Assets/hooks/useUploadFile.ts +++ b/src/components/Assets/hooks/useUploadFile.ts @@ -1,13 +1,13 @@ -import { buildAdServerEndpoint, getEnvConfig } from "util/environment"; +import { buildAdServerEndpoint, getEnvConfig } from "@/util/environment"; import { useCallback, useState } from "react"; import _ from "lodash"; import { refetchAdvertiserImagesQuery, useUploadAdvertiserImageMutation, -} from "graphql/advertiser.generated"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { CampaignFormat } from "graphql/types"; -import { UploadConfig } from "components/Assets/UploadImage"; +} from "@/graphql/advertiser.generated"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { CampaignFormat } from "@/graphql/types"; +import { UploadConfig } from "@/components/Assets/UploadImage"; import { t } from "@lingui/macro"; interface PutUploadResponse { diff --git a/src/components/Background/Background.tsx b/src/components/Background/Background.tsx index 2939c94e..bfd1d3fe 100644 --- a/src/components/Background/Background.tsx +++ b/src/components/Background/Background.tsx @@ -1,7 +1,7 @@ import { PropsWithChildren } from "react"; -import gradient from "assets/images/darker-gradient.svg"; +import gradient from "@/assets/images/darker-gradient.svg"; import { Container } from "@mui/material"; -import { useIsMobile } from "hooks/useIsMobile"; +import { useIsMobile } from "@/hooks/useIsMobile"; export function Background({ children }: PropsWithChildren) { const isMobile = useIsMobile(); diff --git a/src/components/Button/LearnMoreButton.tsx b/src/components/Button/LearnMoreButton.tsx index a0055f5a..e3103280 100644 --- a/src/components/Button/LearnMoreButton.tsx +++ b/src/components/Button/LearnMoreButton.tsx @@ -1,5 +1,5 @@ import { Link } from "@mui/material"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; import { TypographyOwnProps } from "@mui/material/Typography"; diff --git a/src/components/Button/SubmitPanel.tsx b/src/components/Button/SubmitPanel.tsx index 0cffc538..a949b5dc 100644 --- a/src/components/Button/SubmitPanel.tsx +++ b/src/components/Button/SubmitPanel.tsx @@ -5,7 +5,7 @@ import { extractErrors, FormikDialogButton, FormikSubmitButton, -} from "form/FormikButton"; +} from "@/form/FormikButton"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { MessageDescriptor } from "@lingui/core"; diff --git a/src/components/Campaigns/CampaignAgeFilter.tsx b/src/components/Campaigns/CampaignAgeFilter.tsx index 4621f7bf..40283818 100644 --- a/src/components/Campaigns/CampaignAgeFilter.tsx +++ b/src/components/Campaigns/CampaignAgeFilter.tsx @@ -1,7 +1,7 @@ import { FormControlLabel, Switch, Typography } from "@mui/material"; import _ from "lodash"; import { useContext } from "react"; -import { FilterContext } from "state/context"; +import { FilterContext } from "@/state/context"; import { Trans } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/components/Campaigns/CampaignDateRange.tsx b/src/components/Campaigns/CampaignDateRange.tsx index 2518f04f..d85c7323 100644 --- a/src/components/Campaigns/CampaignDateRange.tsx +++ b/src/components/Campaigns/CampaignDateRange.tsx @@ -5,7 +5,7 @@ import { useField } from "formik"; import { useState } from "react"; import { getDefaultTimezone, TimeZonePicker } from "../TimeZonePicker"; import { TimezoneAwareDatePicker } from "../TimeZonePicker/TimezoneAwareDatePicker"; -import { useIsEdit } from "form/FormikHelpers"; +import { useIsEdit } from "@/form/FormikHelpers"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/components/Campaigns/CloneCampaign.tsx b/src/components/Campaigns/CloneCampaign.tsx index 9827adf3..edcd14df 100644 --- a/src/components/Campaigns/CloneCampaign.tsx +++ b/src/components/Campaigns/CloneCampaign.tsx @@ -13,16 +13,16 @@ import { CampaignSummaryFragment, useCreateCampaignMutation, useLoadCampaignLazyQuery, -} from "graphql/campaign.generated"; +} from "@/graphql/campaign.generated"; import { useHistory } from "react-router-dom"; import { useContext, useState } from "react"; -import { refetchAdvertiserCampaignsQuery } from "graphql/advertiser.generated"; -import { createCampaignFromFragment } from "form/fragmentUtil"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { refetchAdvertiserCampaignsQuery } from "@/graphql/advertiser.generated"; +import { createCampaignFromFragment } from "@/form/fragmentUtil"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import ContentCopyIcon from "@mui/icons-material/ContentCopy"; -import { useUser } from "auth/hooks/queries/useUser"; -import { FilterContext } from "state/context"; -import { CampaignFormat, CampaignSource } from "graphql/types"; +import { useUser } from "@/auth/hooks/queries/useUser"; +import { FilterContext } from "@/state/context"; +import { CampaignFormat, CampaignSource } from "@/graphql/types"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/components/Campaigns/Status.tsx b/src/components/Campaigns/Status.tsx index 5e3281d1..674434fc 100644 --- a/src/components/Campaigns/Status.tsx +++ b/src/components/Campaigns/Status.tsx @@ -1,7 +1,7 @@ import { Chip, Tooltip } from "@mui/material"; import { calcColorForState } from "./stateColors"; import _ from "lodash"; -import { isDateInThePast, isDateInTheFuture } from "util/isAfterEndDate"; +import { isDateInThePast, isDateInTheFuture } from "@/util/isAfterEndDate"; interface Props { state: string; diff --git a/src/components/Conversion/ConversionDisplay.tsx b/src/components/Conversion/ConversionDisplay.tsx index ade5383f..06d0f59e 100644 --- a/src/components/Conversion/ConversionDisplay.tsx +++ b/src/components/Conversion/ConversionDisplay.tsx @@ -1,6 +1,6 @@ -import { Conversion } from "user/views/adsManager/types"; +import { Conversion } from "@/user/views/adsManager/types"; import { FormikErrors } from "formik"; -import { ReviewField } from "user/views/adsManager/views/advanced/components/review/components/ReviewField"; +import { ReviewField } from "@/user/views/adsManager/views/advanced/components/review/components/ReviewField"; import _ from "lodash"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/components/Conversion/ConversionFields.tsx b/src/components/Conversion/ConversionFields.tsx index 39b0d484..02f97cda 100644 --- a/src/components/Conversion/ConversionFields.tsx +++ b/src/components/Conversion/ConversionFields.tsx @@ -1,5 +1,5 @@ import { Box } from "@mui/material"; -import { FormikRadioControl, FormikTextField } from "form/FormikHelpers"; +import { FormikRadioControl, FormikTextField } from "@/form/FormikHelpers"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/components/Country/CountryPicker.tsx b/src/components/Country/CountryPicker.tsx index 85e30658..9e717730 100644 --- a/src/components/Country/CountryPicker.tsx +++ b/src/components/Country/CountryPicker.tsx @@ -1,6 +1,6 @@ import { Autocomplete, Box, TextField } from "@mui/material"; import { useField } from "formik"; -import { useCountries } from "components/Country/useCountries"; +import { useCountries } from "@/components/Country/useCountries"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/components/Country/useCountries.ts b/src/components/Country/useCountries.ts index 6eef3562..41749c6e 100644 --- a/src/components/Country/useCountries.ts +++ b/src/components/Country/useCountries.ts @@ -1,4 +1,4 @@ -import { buildAdServerV2Endpoint } from "util/environment"; +import { buildAdServerV2Endpoint } from "@/util/environment"; import { useEffect, useState } from "react"; export function useCountries() { diff --git a/src/components/Creatives/CreateCreativeButton.tsx b/src/components/Creatives/CreateCreativeButton.tsx index 1a3eb019..c9cd5c6c 100644 --- a/src/components/Creatives/CreateCreativeButton.tsx +++ b/src/components/Creatives/CreateCreativeButton.tsx @@ -3,16 +3,16 @@ import { CampaignForm, Creative, initialCreative, -} from "user/views/adsManager/types"; +} from "@/user/views/adsManager/types"; import _ from "lodash"; import { refetchAdvertiserCreativesQuery, useCreateCreativeMutation, -} from "graphql/creative.generated"; +} from "@/graphql/creative.generated"; import { useField, useFormikContext } from "formik"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { LoadingButton } from "@mui/lab"; -import { validCreativeFields } from "user/library"; +import { validCreativeFields } from "@/user/library"; import { Trans } from "@lingui/macro"; export function CreateCreativeButton() { diff --git a/src/components/Creatives/CreativeCampaigns.tsx b/src/components/Creatives/CreativeCampaigns.tsx index dfac2f3b..2f4bf704 100644 --- a/src/components/Creatives/CreativeCampaigns.tsx +++ b/src/components/Creatives/CreativeCampaigns.tsx @@ -1,4 +1,4 @@ -import { CampaignsForCreativeQuery } from "graphql/creative.generated"; +import { CampaignsForCreativeQuery } from "@/graphql/creative.generated"; import { Link as RouterLink } from "react-router-dom"; import { Link, @@ -8,10 +8,10 @@ import { TableHead, TableRow, } from "@mui/material"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { CardContainer } from "components/Card/CardContainer"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { CardContainer } from "@/components/Card/CardContainer"; import _ from "lodash"; -import { Status } from "components/Campaigns/Status"; +import { Status } from "@/components/Campaigns/Status"; import { ApolloError } from "@apollo/client"; import { msg, Trans } from "@lingui/macro"; diff --git a/src/components/Creatives/CreativeForm.tsx b/src/components/Creatives/CreativeForm.tsx index 38edcc11..8f3c1399 100644 --- a/src/components/Creatives/CreativeForm.tsx +++ b/src/components/Creatives/CreativeForm.tsx @@ -1,24 +1,24 @@ import { Box, Container, LinearProgress } from "@mui/material"; import { Form, Formik } from "formik"; import { useParams } from "react-router-dom"; -import { CardContainer } from "components/Card/CardContainer"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { CreativeSchema } from "validation/CreativeSchema"; -import MiniSideBar from "components/Drawer/MiniSideBar"; -import { CreativeType } from "components/Creatives/CreativeType"; -import { NotificationAd } from "user/ads/NotificationAd"; -import { InlineContentAd } from "user/ads/InlineContentAd"; -import { SubmitPanel } from "components/Button/SubmitPanel"; -import { useGetCreativeDetails } from "components/Creatives/hooks/useGetCreativeDetails"; -import { useSubmitCreative } from "components/Creatives/hooks/useSubmitCreative"; -import CreativeCampaigns from "components/Creatives/CreativeCampaigns"; -import { useCampaignsForCreativeQuery } from "graphql/creative.generated"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { CreativeInput } from "graphql/types"; -import { CampaignFragment } from "graphql/campaign.generated"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { CreativeSchema } from "@/validation/CreativeSchema"; +import MiniSideBar from "@/components/Drawer/MiniSideBar"; +import { CreativeType } from "@/components/Creatives/CreativeType"; +import { NotificationAd } from "@/user/ads/NotificationAd"; +import { InlineContentAd } from "@/user/ads/InlineContentAd"; +import { SubmitPanel } from "@/components/Button/SubmitPanel"; +import { useGetCreativeDetails } from "@/components/Creatives/hooks/useGetCreativeDetails"; +import { useSubmitCreative } from "@/components/Creatives/hooks/useSubmitCreative"; +import CreativeCampaigns from "@/components/Creatives/CreativeCampaigns"; +import { useCampaignsForCreativeQuery } from "@/graphql/creative.generated"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { CreativeInput } from "@/graphql/types"; +import { CampaignFragment } from "@/graphql/campaign.generated"; import _ from "lodash"; -import { isReviewableState } from "util/displayState"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { isReviewableState } from "@/util/displayState"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; interface Params { diff --git a/src/components/Creatives/CreativeList.tsx b/src/components/Creatives/CreativeList.tsx index 29bbe869..5af19c5e 100644 --- a/src/components/Creatives/CreativeList.tsx +++ b/src/components/Creatives/CreativeList.tsx @@ -1,20 +1,20 @@ import { CreativeFragment, useAdvertiserCreativesQuery, -} from "graphql/creative.generated"; -import { uiTextForCreativeTypeCode } from "user/library"; -import { CardContainer } from "components/Card/CardContainer"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import MiniSideBar from "components/Drawer/MiniSideBar"; +} from "@/graphql/creative.generated"; +import { uiTextForCreativeTypeCode } from "@/user/library"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import MiniSideBar from "@/components/Drawer/MiniSideBar"; import { Box, Link, List, Typography } from "@mui/material"; -import { Status } from "components/Campaigns/Status"; +import { Status } from "@/components/Campaigns/Status"; import { Link as RouterLink } from "react-router-dom"; import { DataGrid, GridColDef } from "@mui/x-data-grid"; -import { CreativeStatusSwitch } from "components/Creatives/CreativeStatusSwitch"; -import { CustomToolbar } from "components/Datagrid/CustomToolbar"; -import { RouteSelectionButton } from "components/Route/RouteSelectionButton"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { CreativeStatusSwitch } from "@/components/Creatives/CreativeStatusSwitch"; +import { CustomToolbar } from "@/components/Datagrid/CustomToolbar"; +import { RouteSelectionButton } from "@/components/Route/RouteSelectionButton"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg } from "@lingui/macro"; import { Trans, useLingui } from "@lingui/react"; import { MessageDescriptor } from "@lingui/core"; diff --git a/src/components/Creatives/CreativeSelect.tsx b/src/components/Creatives/CreativeSelect.tsx index 64b8190e..af78efc7 100644 --- a/src/components/Creatives/CreativeSelect.tsx +++ b/src/components/Creatives/CreativeSelect.tsx @@ -1,14 +1,14 @@ import { Box, Button, Stack, Typography } from "@mui/material"; -import { BoxContainer } from "components/Box/BoxContainer"; -import { NotificationPreview } from "components/Creatives/NotificationPreview"; -import { SelectCreativeHeader } from "components/Creatives/SelectCreativeHeader"; -import { CampaignForm, Creative } from "user/views/adsManager/types"; +import { BoxContainer } from "@/components/Box/BoxContainer"; +import { NotificationPreview } from "@/components/Creatives/NotificationPreview"; +import { SelectCreativeHeader } from "@/components/Creatives/SelectCreativeHeader"; +import { CampaignForm, Creative } from "@/user/views/adsManager/types"; import _ from "lodash"; import { PropsWithChildren, useContext, useState } from "react"; -import { FormContext } from "state/context"; +import { FormContext } from "@/state/context"; import { useFormikContext } from "formik"; -import { CampaignFormat } from "graphql/types"; -import { ImagePreview } from "components/Assets/ImagePreview"; +import { CampaignFormat } from "@/graphql/types"; +import { ImagePreview } from "@/components/Assets/ImagePreview"; import { Trans } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/components/Creatives/CreativeSpecificPreview.tsx b/src/components/Creatives/CreativeSpecificPreview.tsx index b8141212..8b5548e8 100644 --- a/src/components/Creatives/CreativeSpecificPreview.tsx +++ b/src/components/Creatives/CreativeSpecificPreview.tsx @@ -1,12 +1,12 @@ -import { CampaignFormat } from "graphql/types"; -import { BoxContainer } from "components/Box/BoxContainer"; -import { NotificationPreview } from "components/Creatives/NotificationPreview"; +import { CampaignFormat } from "@/graphql/types"; +import { BoxContainer } from "@/components/Box/BoxContainer"; +import { NotificationPreview } from "@/components/Creatives/NotificationPreview"; import { Stack, Typography } from "@mui/material"; import { PropsWithChildren } from "react"; import { useField } from "formik"; -import { Creative } from "user/views/adsManager/types"; -import { DisplayError } from "user/views/adsManager/views/advanced/components/review/components/ReviewField"; -import { ImagePreview } from "components/Assets/ImagePreview"; +import { Creative } from "@/user/views/adsManager/types"; +import { DisplayError } from "@/user/views/adsManager/views/advanced/components/review/components/ReviewField"; +import { ImagePreview } from "@/components/Assets/ImagePreview"; import { Trans } from "@lingui/macro"; interface Props extends PropsWithChildren { diff --git a/src/components/Creatives/CreativeStatusSwitch.tsx b/src/components/Creatives/CreativeStatusSwitch.tsx index 4505dc28..0fe3ac66 100644 --- a/src/components/Creatives/CreativeStatusSwitch.tsx +++ b/src/components/Creatives/CreativeStatusSwitch.tsx @@ -4,8 +4,8 @@ import { refetchCampaignsForCreativeQuery, useCampaignsForCreativeLazyQuery, useUpdateCreativeMutation, -} from "graphql/creative.generated"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +} from "@/graphql/creative.generated"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Box, Button, @@ -20,8 +20,8 @@ import { } from "@mui/material"; import { useState } from "react"; import _ from "lodash"; -import { validCreativeFields } from "user/library"; -import { isReviewableState } from "util/displayState"; +import { validCreativeFields } from "@/user/library"; +import { isReviewableState } from "@/util/displayState"; import { Trans } from "@lingui/macro"; interface Props { diff --git a/src/components/Creatives/CreativeType.tsx b/src/components/Creatives/CreativeType.tsx index 68415b38..88db52ea 100644 --- a/src/components/Creatives/CreativeType.tsx +++ b/src/components/Creatives/CreativeType.tsx @@ -1,7 +1,7 @@ import { Box, ListItemButton, List, Typography, Stack } from "@mui/material"; import { useFormikContext } from "formik"; -import { CreativeInput } from "graphql/types"; -import { FormatHelp } from "components/Button/FormatHelp"; +import { CreativeInput } from "@/graphql/types"; +import { FormatHelp } from "@/components/Button/FormatHelp"; import { msg } from "@lingui/macro"; import { Trans } from "@lingui/react"; diff --git a/src/components/Creatives/NewsPreview.tsx b/src/components/Creatives/NewsPreview.tsx index 9d7d63f4..c5da7443 100644 --- a/src/components/Creatives/NewsPreview.tsx +++ b/src/components/Creatives/NewsPreview.tsx @@ -1,8 +1,8 @@ import { Box, Card, Typography } from "@mui/material"; -import { ImagePreview } from "components/Assets/ImagePreview"; +import { ImagePreview } from "@/components/Assets/ImagePreview"; import { useField, useFormikContext } from "formik"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { CreativeInput } from "graphql/types"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { CreativeInput } from "@/graphql/types"; import { Trans } from "@lingui/macro"; export function NewsPreview() { diff --git a/src/components/Creatives/NotificationPreview.tsx b/src/components/Creatives/NotificationPreview.tsx index 1595cd86..dd60c44c 100644 --- a/src/components/Creatives/NotificationPreview.tsx +++ b/src/components/Creatives/NotificationPreview.tsx @@ -1,7 +1,7 @@ import { Box, Paper, Stack, Typography } from "@mui/material"; -import logo from "assets/images/brave_logo_icon.png"; +import logo from "@/assets/images/brave_logo_icon.png"; import { useField, useFormikContext } from "formik"; -import { CreativeInput } from "graphql/types"; +import { CreativeInput } from "@/graphql/types"; import { Trans } from "@lingui/macro"; export function NotificationPreview(props: { diff --git a/src/components/Creatives/SelectCreativeHeader.tsx b/src/components/Creatives/SelectCreativeHeader.tsx index 6dc151f9..80a588b7 100644 --- a/src/components/Creatives/SelectCreativeHeader.tsx +++ b/src/components/Creatives/SelectCreativeHeader.tsx @@ -1,8 +1,8 @@ import { Box, IconButton, Typography } from "@mui/material"; import CheckBoxIcon from "@mui/icons-material/CheckBox"; import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank"; -import { Creative } from "user/views/adsManager/types"; -import { Status } from "components/Campaigns/Status"; +import { Creative } from "@/user/views/adsManager/types"; +import { Status } from "@/components/Campaigns/Status"; import { useEffect, useState } from "react"; export const SelectCreativeHeader = (props: { diff --git a/src/components/Creatives/hooks/useGetCreativeDetails.tsx b/src/components/Creatives/hooks/useGetCreativeDetails.tsx index cb8dc00c..d5a5fb8f 100644 --- a/src/components/Creatives/hooks/useGetCreativeDetails.tsx +++ b/src/components/Creatives/hooks/useGetCreativeDetails.tsx @@ -1,6 +1,6 @@ -import { useLoadCreativeQuery } from "graphql/creative.generated"; -import { CreativeInput } from "graphql/types"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useLoadCreativeQuery } from "@/graphql/creative.generated"; +import { CreativeInput } from "@/graphql/types"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/components/Creatives/hooks/useSubmitCreative.tsx b/src/components/Creatives/hooks/useSubmitCreative.tsx index c6dd76c6..b01f29c1 100644 --- a/src/components/Creatives/hooks/useSubmitCreative.tsx +++ b/src/components/Creatives/hooks/useSubmitCreative.tsx @@ -2,14 +2,14 @@ import { refetchAdvertiserCreativesQuery, useCreateCreativeMutation, useUpdateCreativeMutation, -} from "graphql/creative.generated"; +} from "@/graphql/creative.generated"; import { useCallback } from "react"; -import { CreativeInput } from "graphql/types"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { CreativeInput } from "@/graphql/types"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { useHistory } from "react-router-dom"; -import { validCreativeFields } from "user/library"; +import { validCreativeFields } from "@/user/library"; import _ from "lodash"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; export function useSubmitCreative(props: { id: string }) { const { trackMatomoEvent } = useTrackMatomoEvent(); diff --git a/src/components/Datagrid/renderers.tsx b/src/components/Datagrid/renderers.tsx index aecdbfd2..5e8bb5a5 100644 --- a/src/components/Datagrid/renderers.tsx +++ b/src/components/Datagrid/renderers.tsx @@ -6,15 +6,15 @@ import { refetchLoadCampaignAdsQuery, refetchLoadCampaignQuery, useUpdateCampaignMutation, -} from "graphql/campaign.generated"; -import { useUpdateAdSetMutation } from "graphql/ad-set.generated"; -import { OnOff } from "components/Switch/OnOff"; -import { displayFromCampaignState } from "util/displayState"; -import { CampaignExtras } from "user/adSet/AdSetList"; -import { FilterContext } from "state/context"; -import { refetchAdvertiserCampaignsQuery } from "graphql/advertiser.generated"; -import { UpdateAdSetInput } from "graphql/types"; -import { toLocaleString } from "util/bignumber"; +} from "@/graphql/campaign.generated"; +import { useUpdateAdSetMutation } from "@/graphql/ad-set.generated"; +import { OnOff } from "@/components/Switch/OnOff"; +import { displayFromCampaignState } from "@/util/displayState"; +import { CampaignExtras } from "@/user/adSet/AdSetList"; +import { FilterContext } from "@/state/context"; +import { refetchAdvertiserCampaignsQuery } from "@/graphql/advertiser.generated"; +import { UpdateAdSetInput } from "@/graphql/types"; +import { toLocaleString } from "@/util/bignumber"; import BigNumber from "bignumber.js"; import { Trans } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/components/Drawer/MiniSideBar.tsx b/src/components/Drawer/MiniSideBar.tsx index 594e0e3e..6f2b5363 100644 --- a/src/components/Drawer/MiniSideBar.tsx +++ b/src/components/Drawer/MiniSideBar.tsx @@ -8,11 +8,11 @@ import AccountBalanceOutlinedIcon from "@mui/icons-material/AccountBalanceOutlin import AccountBoxOutlinedIcon from "@mui/icons-material/AccountBoxOutlined"; import LightbulbOutlinedIcon from "@mui/icons-material/LightbulbOutlined"; import PeopleOutlineOutlinedIcon from "@mui/icons-material/PeopleOutlineOutlined"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { AlwaysOnFormButton } from "components/Button/AlwaysOnFormButton"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { AlwaysOnFormButton } from "@/components/Button/AlwaysOnFormButton"; import { msg } from "@lingui/macro"; -import { SupportMenu } from "components/Drawer/SupportMenu"; -import { ItemBox, RouteOption } from "components/Drawer/components/ItemBox"; +import { SupportMenu } from "@/components/Drawer/SupportMenu"; +import { ItemBox, RouteOption } from "@/components/Drawer/components/ItemBox"; const drawerWidth = 85; export default function MiniSideBar({ children }: PropsWithChildren) { diff --git a/src/components/Drawer/SupportMenu.tsx b/src/components/Drawer/SupportMenu.tsx index c4c077ab..950fc3a7 100644 --- a/src/components/Drawer/SupportMenu.tsx +++ b/src/components/Drawer/SupportMenu.tsx @@ -1,10 +1,10 @@ -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { MouseEvent, useState } from "react"; -import { useIsMobile } from "hooks/useIsMobile"; +import { useIsMobile } from "@/hooks/useIsMobile"; import { msg, Trans } from "@lingui/macro"; import HeadsetMicOutlinedIcon from "@mui/icons-material/HeadsetMicOutlined"; import { Link, Menu, MenuItem } from "@mui/material"; -import { ItemBox } from "components/Drawer/components/ItemBox"; +import { ItemBox } from "@/components/Drawer/components/ItemBox"; interface SupportProps { usePlainLink?: boolean; diff --git a/src/components/Error/ErrorDetail.tsx b/src/components/Error/ErrorDetail.tsx index 89d1c087..362331a0 100644 --- a/src/components/Error/ErrorDetail.tsx +++ b/src/components/Error/ErrorDetail.tsx @@ -9,7 +9,7 @@ import { Box, Typography, } from "@mui/material"; -import { VERSION } from "util/version"; +import { VERSION } from "@/util/version"; import { MessageDescriptor } from "@lingui/core"; import { Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/components/Location/LocationPicker.tsx b/src/components/Location/LocationPicker.tsx index d4dfa840..ceb28de2 100644 --- a/src/components/Location/LocationPicker.tsx +++ b/src/components/Location/LocationPicker.tsx @@ -3,8 +3,8 @@ import CheckBoxIcon from "@mui/icons-material/CheckBox"; import { Autocomplete, Checkbox, TextField } from "@mui/material"; import { useField } from "formik"; import _ from "lodash"; -import { useActiveGeocodesQuery } from "graphql/common.generated"; -import { GeocodeInput } from "graphql/types"; +import { useActiveGeocodesQuery } from "@/graphql/common.generated"; +import { GeocodeInput } from "@/graphql/types"; import { useLingui } from "@lingui/react"; import { msg, Trans } from "@lingui/macro"; diff --git a/src/components/Navigation/DraftMenu.tsx b/src/components/Navigation/DraftMenu.tsx index aa86d419..305a0e7c 100644 --- a/src/components/Navigation/DraftMenu.tsx +++ b/src/components/Navigation/DraftMenu.tsx @@ -2,7 +2,7 @@ import { useContext, useState, MouseEvent } from "react"; import { Link as RouterLink } from "react-router-dom"; import { Badge, Button, Menu, MenuItem } from "@mui/material"; -import { DraftContext } from "state/context"; +import { DraftContext } from "@/state/context"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/components/Navigation/Navbar.tsx b/src/components/Navigation/Navbar.tsx index 331ba3ba..b3cbdedf 100644 --- a/src/components/Navigation/Navbar.tsx +++ b/src/components/Navigation/Navbar.tsx @@ -1,13 +1,13 @@ import { AppBar, Button, Divider, Stack, Toolbar } from "@mui/material"; -import { DraftMenu } from "components/Navigation/DraftMenu"; -import ads from "assets/images/logo.svg"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { useSignOut } from "auth/hooks/mutations/useSignOut"; -import { NewCampaignButton } from "components/Navigation/NewCampaignButton"; -import { UploadImage } from "components/Assets/UploadImage"; +import { DraftMenu } from "@/components/Navigation/DraftMenu"; +import ads from "@/assets/images/logo.svg"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { useSignOut } from "@/auth/hooks/mutations/useSignOut"; +import { NewCampaignButton } from "@/components/Navigation/NewCampaignButton"; +import { UploadImage } from "@/components/Assets/UploadImage"; import { useHistory } from "react-router-dom"; -import { NewCreativeButton } from "components/Navigation/NewCreativeButton"; +import { NewCreativeButton } from "@/components/Navigation/NewCreativeButton"; import { Trans } from "@lingui/macro"; export function Navbar() { diff --git a/src/components/Navigation/NewCampaignButton.tsx b/src/components/Navigation/NewCampaignButton.tsx index 974c422d..f2c4a5e0 100644 --- a/src/components/Navigation/NewCampaignButton.tsx +++ b/src/components/Navigation/NewCampaignButton.tsx @@ -1,4 +1,4 @@ -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Button } from "@mui/material"; import { Link as RouterLink, useRouteMatch } from "react-router-dom"; import { Trans } from "@lingui/macro"; diff --git a/src/components/Navigation/NewCreativeButton.tsx b/src/components/Navigation/NewCreativeButton.tsx index 4ca5f575..fd8a16c9 100644 --- a/src/components/Navigation/NewCreativeButton.tsx +++ b/src/components/Navigation/NewCreativeButton.tsx @@ -1,4 +1,4 @@ -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Button } from "@mui/material"; import { Link as RouterLink, useRouteMatch } from "react-router-dom"; import { Trans } from "@lingui/macro"; diff --git a/src/components/Navigation/NewImageButton.tsx b/src/components/Navigation/NewImageButton.tsx index 5f66bf91..b8ce4ae5 100644 --- a/src/components/Navigation/NewImageButton.tsx +++ b/src/components/Navigation/NewImageButton.tsx @@ -1,4 +1,4 @@ -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Button } from "@mui/material"; import { Trans } from "@lingui/macro"; diff --git a/src/components/Route/ProtectedRoute.tsx b/src/components/Route/ProtectedRoute.tsx index 71e6bd1d..73e6f6eb 100644 --- a/src/components/Route/ProtectedRoute.tsx +++ b/src/components/Route/ProtectedRoute.tsx @@ -1,6 +1,6 @@ import { ComponentType } from "react"; -import { IAdvertiser } from "auth/context/auth.interface"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { IAdvertiser } from "@/auth/context/auth.interface"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { Redirect, Route } from "react-router-dom"; interface ProtectedProps { diff --git a/src/components/Segment/SegmentPicker.tsx b/src/components/Segment/SegmentPicker.tsx index 271e4136..b804a4cd 100644 --- a/src/components/Segment/SegmentPicker.tsx +++ b/src/components/Segment/SegmentPicker.tsx @@ -3,10 +3,10 @@ import CheckBoxIcon from "@mui/icons-material/CheckBox"; import { Autocomplete, Box, Checkbox, TextField } from "@mui/material"; import { useField } from "formik"; import _ from "lodash"; -import { SegmentFragment, useSegmentsQuery } from "graphql/common.generated"; +import { SegmentFragment, useSegmentsQuery } from "@/graphql/common.generated"; import { useEffect } from "react"; -import { FormikSwitch } from "form/FormikHelpers"; -import { segmentNameWithNoDash } from "util/segment"; +import { FormikSwitch } from "@/form/FormikHelpers"; +import { segmentNameWithNoDash } from "@/util/segment"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/components/Steps/ActionButtons.tsx b/src/components/Steps/ActionButtons.tsx index 6fbb4efd..6e6179e0 100644 --- a/src/components/Steps/ActionButtons.tsx +++ b/src/components/Steps/ActionButtons.tsx @@ -1,8 +1,8 @@ import { Button, Stack } from "@mui/material"; import { useContext } from "react"; -import { DraftContext } from "state/context"; +import { DraftContext } from "@/state/context"; import { useFormikContext } from "formik"; -import { CampaignForm } from "user/views/adsManager/types"; +import { CampaignForm } from "@/user/views/adsManager/types"; import ArrowBackIcon from "@mui/icons-material/ArrowBack"; import RemoveIcon from "@mui/icons-material/Remove"; import { Link as RouterLink } from "react-router-dom"; diff --git a/src/components/Steps/StepDrawer.tsx b/src/components/Steps/StepDrawer.tsx index 1cb3e574..22b28c2f 100644 --- a/src/components/Steps/StepDrawer.tsx +++ b/src/components/Steps/StepDrawer.tsx @@ -10,9 +10,9 @@ import { Stepper, Toolbar, } from "@mui/material"; -import { NextAndBack } from "components/Steps/NextAndBack"; +import { NextAndBack } from "@/components/Steps/NextAndBack"; import { useHistory } from "react-router-dom"; -import { ActionButtons } from "components/Steps/ActionButtons"; +import { ActionButtons } from "@/components/Steps/ActionButtons"; import { MessageDescriptor } from "@lingui/core"; import { Trans } from "@lingui/react"; diff --git a/src/components/Switch/OnOff.tsx b/src/components/Switch/OnOff.tsx index 4117368c..b82bd224 100644 --- a/src/components/Switch/OnOff.tsx +++ b/src/components/Switch/OnOff.tsx @@ -1,5 +1,5 @@ import { Switch, Tooltip, Typography } from "@mui/material"; -import { CampaignSource } from "graphql/types"; +import { CampaignSource } from "@/graphql/types"; import { Trans } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/components/Url/use-url-validation.ts b/src/components/Url/use-url-validation.ts index 2dca4d1a..d25f4b22 100644 --- a/src/components/Url/use-url-validation.ts +++ b/src/components/Url/use-url-validation.ts @@ -1,7 +1,7 @@ import { useValidateTargetUrlLazyQuery, ValidateTargetUrlQuery, -} from "graphql/url.generated"; +} from "@/graphql/url.generated"; import _ from "lodash"; import { useEffect, useMemo, useState } from "react"; diff --git a/src/form/FormikHelpers.tsx b/src/form/FormikHelpers.tsx index 94210ed2..b4bce186 100644 --- a/src/form/FormikHelpers.tsx +++ b/src/form/FormikHelpers.tsx @@ -24,7 +24,7 @@ import { } from "@mui/material"; import { ErrorMessage, useField, useFormikContext } from "formik"; import _ from "lodash"; -import { CampaignForm } from "user/views/adsManager/types"; +import { CampaignForm } from "@/user/views/adsManager/types"; import { Trans } from "@lingui/macro"; import { TypographyOwnProps } from "@mui/material/Typography"; diff --git a/src/form/PersistFormValues.tsx b/src/form/PersistFormValues.tsx index e21ad13e..aa1259c7 100644 --- a/src/form/PersistFormValues.tsx +++ b/src/form/PersistFormValues.tsx @@ -1,7 +1,7 @@ import { useFormikContext } from "formik"; import { useContext, useEffect } from "react"; -import { CampaignForm } from "user/views/adsManager/types"; -import { DraftContext } from "state/context"; +import { CampaignForm } from "@/user/views/adsManager/types"; +import { DraftContext } from "@/state/context"; export const PersistFormValues = () => { const { values, setValues, dirty } = useFormikContext(); diff --git a/src/form/PersistRegistrationValues.tsx b/src/form/PersistRegistrationValues.tsx index 0f0f1827..2dd95746 100644 --- a/src/form/PersistRegistrationValues.tsx +++ b/src/form/PersistRegistrationValues.tsx @@ -1,6 +1,6 @@ import { useFormikContext } from "formik"; import { useEffect } from "react"; -import { RegistrationForm } from "auth/registration/types"; +import { RegistrationForm } from "@/auth/registration/types"; import _ from "lodash"; export const PersistRegistrationValues = () => { diff --git a/src/form/fragmentUtil.ts b/src/form/fragmentUtil.ts index 3d1b96d9..a2fc109f 100644 --- a/src/form/fragmentUtil.ts +++ b/src/form/fragmentUtil.ts @@ -1,6 +1,6 @@ -import { CreateAdSetInput, CreateCampaignInput } from "graphql/types"; -import { CampaignFragment } from "graphql/campaign.generated"; -import { AdSetFragment } from "graphql/ad-set.generated"; +import { CreateAdSetInput, CreateCampaignInput } from "@/graphql/types"; +import { CampaignFragment } from "@/graphql/campaign.generated"; +import { AdSetFragment } from "@/graphql/ad-set.generated"; import dayjs from "dayjs"; export function createCampaignFromFragment( diff --git a/src/index.tsx b/src/index.tsx index 1d388434..d092a8b9 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -2,7 +2,7 @@ import * as React from "react"; import { createRoot } from "react-dom/client"; import { BrowserRouter } from "react-router-dom"; -import { App } from "App"; +import { App } from "./App"; import "./index.css"; import "@fontsource/poppins/latin.css"; @@ -10,14 +10,14 @@ import "@fontsource/mulish/latin.css"; import "./init_dayjs"; -import { IAuthProvider } from "auth"; -import { Environment, getEnvironment } from "util/environment"; +import { IAuthProvider } from "@/auth"; +import { Environment, getEnvironment } from "@/util/environment"; import { createInstance, MatomoProvider } from "@jonkoops/matomo-tracker-react"; -import { VERSION } from "util/version"; +import { VERSION } from "@/util/version"; import { i18n } from "@lingui/core"; import { I18nProvider } from "@lingui/react"; import { useEffect } from "react"; -import { findLocale } from "i18n"; +import { findLocale } from "./i18n"; console.log( `https://github.com/brave/ads-ui rev ${VERSION.shortHash} built ${VERSION.buildTime}`, diff --git a/src/state/context.ts b/src/state/context.ts index 3bbb634c..3acb3b64 100644 --- a/src/state/context.ts +++ b/src/state/context.ts @@ -1,6 +1,6 @@ import dayjs from "dayjs"; import { createContext } from "react"; -import { CampaignForm } from "user/views/adsManager/types"; +import { CampaignForm } from "@/user/views/adsManager/types"; export const DraftContext = createContext({ drafts: [] as CampaignForm[], diff --git a/src/theme.tsx b/src/theme.tsx index e04ecd94..5663ab54 100644 --- a/src/theme.tsx +++ b/src/theme.tsx @@ -1,5 +1,5 @@ import { createTheme, responsiveFontSizes, SxProps } from "@mui/material"; -import { findLocale } from "i18n"; +import { findLocale } from "./i18n"; const appTheme = createTheme( { diff --git a/src/user/User.tsx b/src/user/User.tsx index 83bf9b1f..f43234f4 100644 --- a/src/user/User.tsx +++ b/src/user/User.tsx @@ -12,19 +12,19 @@ import { Box } from "@mui/material"; import { NewCampaign } from "./views/adsManager/views/advanced/components/form/NewCampaign"; import { EditCampaign } from "./views/adsManager/views/advanced/components/form/EditCampaign"; import { CompletionForm } from "./views/adsManager/views/advanced/components/completionForm/CompletionForm"; -import { Navbar } from "components/Navigation/Navbar"; -import { CampaignView } from "user/views/user/CampaignView"; -import { Profile } from "user/views/user/Profile"; -import { FilterContext } from "state/context"; -import { AdvertiserAssets } from "components/Assets/AdvertiserAssets"; -import { CreativeList } from "components/Creatives/CreativeList"; -import { CreativeForm } from "components/Creatives/CreativeForm"; -import { ProtectedRoute } from "components/Route/ProtectedRoute"; -import { AdvertiserDetailsForm } from "auth/components/AdvertiserDetailsForm"; -import { ErrorBoundary } from "ErrorBoundary"; +import { Navbar } from "@/components/Navigation/Navbar"; +import { CampaignView } from "@/user/views/user/CampaignView"; +import { Profile } from "@/user/views/user/Profile"; +import { FilterContext } from "@/state/context"; +import { AdvertiserAssets } from "@/components/Assets/AdvertiserAssets"; +import { CreativeList } from "@/components/Creatives/CreativeList"; +import { CreativeForm } from "@/components/Creatives/CreativeForm"; +import { ProtectedRoute } from "@/components/Route/ProtectedRoute"; +import { AdvertiserDetailsForm } from "@/auth/components/AdvertiserDetailsForm"; +import { ErrorBoundary } from "@/ErrorBoundary"; import { CampaignReportViewSelector } from "./views/user/CampaignReportViewSelector"; import dayjs from "dayjs"; -import { useIsAuthenticated } from "auth/hooks/queries/useIsAuthenticated"; +import { useIsAuthenticated } from "@/auth/hooks/queries/useIsAuthenticated"; const buildApolloClient = () => { const httpLink = createHttpLink({ diff --git a/src/user/adSet/AdSetList.tsx b/src/user/adSet/AdSetList.tsx index 80bad56f..9c89fc82 100644 --- a/src/user/adSet/AdSetList.tsx +++ b/src/user/adSet/AdSetList.tsx @@ -1,16 +1,16 @@ import { Chip } from "@mui/material"; -import { Status } from "components/Campaigns/Status"; +import { Status } from "@/components/Campaigns/Status"; import _ from "lodash"; -import { adSetOnOffState } from "components/Datagrid/renderers"; -import { CampaignAdsFragment } from "graphql/campaign.generated"; -import { CampaignSource } from "graphql/types"; -import { StatsMetric } from "user/analytics/analyticsOverview/types"; -import { AdSetWithDeletedAdsFragment } from "graphql/ad-set.generated"; -import { AdDetailTable } from "user/views/user/AdDetailTable"; -import { displayFromCampaignState } from "util/displayState"; -import { uiLabelsForBillingType } from "util/billingType"; +import { adSetOnOffState } from "@/components/Datagrid/renderers"; +import { CampaignAdsFragment } from "@/graphql/campaign.generated"; +import { CampaignSource } from "@/graphql/types"; +import { StatsMetric } from "@/user/analytics/analyticsOverview/types"; +import { AdSetWithDeletedAdsFragment } from "@/graphql/ad-set.generated"; +import { AdDetailTable } from "@/user/views/user/AdDetailTable"; +import { displayFromCampaignState } from "@/util/displayState"; +import { uiLabelsForBillingType } from "@/util/billingType"; import { GridColDef } from "@mui/x-data-grid"; -import { segmentNameWithNoDash } from "util/segment"; +import { segmentNameWithNoDash } from "@/util/segment"; import { useLingui } from "@lingui/react"; import { msg, Trans } from "@lingui/macro"; diff --git a/src/user/ads/AdList.tsx b/src/user/ads/AdList.tsx index ef812eb2..8b6a81dd 100644 --- a/src/user/ads/AdList.tsx +++ b/src/user/ads/AdList.tsx @@ -1,12 +1,12 @@ import _ from "lodash"; -import { isDateInThePast } from "util/isAfterEndDate"; -import { AdFragment } from "graphql/ad-set.generated"; -import { CampaignSource } from "graphql/types"; -import { CampaignAdsFragment } from "graphql/campaign.generated"; -import { StatsMetric } from "user/analytics/analyticsOverview/types"; -import { AdDetailTable } from "user/views/user/AdDetailTable"; +import { isDateInThePast } from "@/util/isAfterEndDate"; +import { AdFragment } from "@/graphql/ad-set.generated"; +import { CampaignSource } from "@/graphql/types"; +import { CampaignAdsFragment } from "@/graphql/campaign.generated"; +import { StatsMetric } from "@/user/analytics/analyticsOverview/types"; +import { AdDetailTable } from "@/user/views/user/AdDetailTable"; import { GridColDef } from "@mui/x-data-grid"; -import { CreativeFragment } from "graphql/creative.generated"; +import { CreativeFragment } from "@/graphql/creative.generated"; import { Box } from "@mui/material"; import { useLingui } from "@lingui/react"; import { msg, Trans } from "@lingui/macro"; diff --git a/src/user/ads/AdsExistingAd.tsx b/src/user/ads/AdsExistingAd.tsx index 4b96ce78..b82f95a3 100644 --- a/src/user/ads/AdsExistingAd.tsx +++ b/src/user/ads/AdsExistingAd.tsx @@ -8,21 +8,21 @@ import { Modal, } from "@mui/material"; import { useFormikContext } from "formik"; -import { CampaignFormat } from "graphql/types"; +import { CampaignFormat } from "@/graphql/types"; import _ from "lodash"; import { CreativeFragment, useAdvertiserCreativesQuery, -} from "graphql/creative.generated"; -import { isCreativeTypeApplicableToCampaignFormat } from "user/library"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { CampaignForm } from "user/views/adsManager/types"; +} from "@/graphql/creative.generated"; +import { isCreativeTypeApplicableToCampaignFormat } from "@/user/library"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { CampaignForm } from "@/user/views/adsManager/types"; import SearchIcon from "@mui/icons-material/Search"; import { useContext, useRef, useState } from "react"; -import { CreativeSelect } from "components/Creatives/CreativeSelect"; -import { FormContext } from "state/context"; -import { useAdvertiserCreatives } from "user/hooks/useAdvertiserCreatives"; -import { modalStyles } from "theme"; +import { CreativeSelect } from "@/components/Creatives/CreativeSelect"; +import { FormContext } from "@/state/context"; +import { useAdvertiserCreatives } from "@/user/hooks/useAdvertiserCreatives"; +import { modalStyles } from "@/theme"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/ads/InlineContentAd.tsx b/src/user/ads/InlineContentAd.tsx index a0a405b8..e0886a90 100644 --- a/src/user/ads/InlineContentAd.tsx +++ b/src/user/ads/InlineContentAd.tsx @@ -1,13 +1,13 @@ -import { FormikTextField } from "form/FormikHelpers"; -import { UrlResolver } from "components/Url/UrlResolver"; +import { FormikTextField } from "@/form/FormikHelpers"; +import { UrlResolver } from "@/components/Url/UrlResolver"; import { useField } from "formik"; import { useEffect } from "react"; import { Box, Stack, Typography } from "@mui/material"; -import { CreateCreativeButton } from "components/Creatives/CreateCreativeButton"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { CardContainer } from "components/Card/CardContainer"; -import { ImageAutocomplete } from "components/Assets/ImageAutocomplete"; -import { NewsPreview } from "components/Creatives/NewsPreview"; +import { CreateCreativeButton } from "@/components/Creatives/CreateCreativeButton"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { ImageAutocomplete } from "@/components/Assets/ImageAutocomplete"; +import { NewsPreview } from "@/components/Creatives/NewsPreview"; import { useLingui } from "@lingui/react"; import { msg, Trans } from "@lingui/macro"; diff --git a/src/user/ads/NewAd.tsx b/src/user/ads/NewAd.tsx index 5883a5bc..c0c46b07 100644 --- a/src/user/ads/NewAd.tsx +++ b/src/user/ads/NewAd.tsx @@ -1,6 +1,6 @@ import { Box, Button } from "@mui/material"; import { useContext, useEffect } from "react"; -import { BoxContainer } from "components/Box/BoxContainer"; +import { BoxContainer } from "@/components/Box/BoxContainer"; import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline"; import RemoveCircleOutlineIcon from "@mui/icons-material/RemoveCircleOutline"; import { useField, useFormikContext } from "formik"; @@ -8,9 +8,9 @@ import { CampaignForm, Creative, initialCreative, -} from "user/views/adsManager/types"; -import { FormContext } from "state/context"; -import { CampaignFormat } from "graphql/types"; +} from "@/user/views/adsManager/types"; +import { FormContext } from "@/state/context"; +import { CampaignFormat } from "@/graphql/types"; import { Trans } from "@lingui/macro"; export function NewAd() { diff --git a/src/user/ads/NotificationAd.tsx b/src/user/ads/NotificationAd.tsx index f5f99106..0bc1c54c 100644 --- a/src/user/ads/NotificationAd.tsx +++ b/src/user/ads/NotificationAd.tsx @@ -1,10 +1,10 @@ -import { CardContainer } from "components/Card/CardContainer"; -import { FormikTextField } from "form/FormikHelpers"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { FormikTextField } from "@/form/FormikHelpers"; import { Box, Stack, Typography } from "@mui/material"; -import { UrlResolver } from "components/Url/UrlResolver"; +import { UrlResolver } from "@/components/Url/UrlResolver"; import { useField } from "formik"; -import { NotificationPreview } from "components/Creatives/NotificationPreview"; -import { CreateCreativeButton } from "components/Creatives/CreateCreativeButton"; +import { NotificationPreview } from "@/components/Creatives/NotificationPreview"; +import { CreateCreativeButton } from "@/components/Creatives/CreateCreativeButton"; import { useEffect } from "react"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/ads/ShowAdsButton.tsx b/src/user/ads/ShowAdsButton.tsx index 340670f3..af8c7898 100644 --- a/src/user/ads/ShowAdsButton.tsx +++ b/src/user/ads/ShowAdsButton.tsx @@ -1,5 +1,5 @@ import { useContext } from "react"; -import { FormContext } from "state/context"; +import { FormContext } from "@/state/context"; import { Link } from "@mui/material"; import { useField } from "formik"; import { Trans } from "@lingui/macro"; diff --git a/src/user/analytics/analyticsOverview/components/BaseBarChart.tsx b/src/user/analytics/analyticsOverview/components/BaseBarChart.tsx index a859fa83..83138c91 100644 --- a/src/user/analytics/analyticsOverview/components/BaseBarChart.tsx +++ b/src/user/analytics/analyticsOverview/components/BaseBarChart.tsx @@ -1,7 +1,7 @@ import { Box, Tab, Tabs } from "@mui/material"; import { Options, SeriesOptionsType } from "highcharts"; import { Option } from "../types"; -import { HighchartsWrapper } from "user/analytics/analyticsOverview/components/HighchartsWrapper"; +import { HighchartsWrapper } from "@/user/analytics/analyticsOverview/components/HighchartsWrapper"; import { msg } from "@lingui/macro"; import { Trans } from "@lingui/react"; diff --git a/src/user/analytics/analyticsOverview/components/BasePieChart.tsx b/src/user/analytics/analyticsOverview/components/BasePieChart.tsx index 4c60b3d1..e51d6f16 100644 --- a/src/user/analytics/analyticsOverview/components/BasePieChart.tsx +++ b/src/user/analytics/analyticsOverview/components/BasePieChart.tsx @@ -1,7 +1,7 @@ import { Box, Tab, Tabs } from "@mui/material"; import { Options, SeriesOptionsType } from "highcharts"; import { Option } from "../types"; -import { HighchartsWrapper } from "user/analytics/analyticsOverview/components/HighchartsWrapper"; +import { HighchartsWrapper } from "@/user/analytics/analyticsOverview/components/HighchartsWrapper"; import { msg } from "@lingui/macro"; import { Trans } from "@lingui/react"; diff --git a/src/user/analytics/analyticsOverview/components/EngagementHeader.tsx b/src/user/analytics/analyticsOverview/components/EngagementHeader.tsx index d620dc7c..7e035d5b 100644 --- a/src/user/analytics/analyticsOverview/components/EngagementHeader.tsx +++ b/src/user/analytics/analyticsOverview/components/EngagementHeader.tsx @@ -1,6 +1,6 @@ import { Box, Button, Stack, Typography } from "@mui/material"; -import { Status } from "components/Campaigns/Status"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; +import { Status } from "@/components/Campaigns/Status"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; import { MessageDescriptor } from "@lingui/core"; import { msg } from "@lingui/macro"; import { Trans } from "@lingui/react"; diff --git a/src/user/analytics/analyticsOverview/components/LiveFeed.tsx b/src/user/analytics/analyticsOverview/components/LiveFeed.tsx index 9b9c1231..d3d05e1a 100644 --- a/src/user/analytics/analyticsOverview/components/LiveFeed.tsx +++ b/src/user/analytics/analyticsOverview/components/LiveFeed.tsx @@ -1,6 +1,6 @@ import { Box, Chip, Typography } from "@mui/material"; import { OverviewDetail, StatsMetric } from "../types"; -import { toLocaleString } from "util/bignumber"; +import { toLocaleString } from "@/util/bignumber"; import { msg, Trans } from "@lingui/macro"; import { MessageDescriptor } from "@lingui/core"; import { useLingui } from "@lingui/react"; diff --git a/src/user/analytics/analyticsOverview/components/MetricFilter.tsx b/src/user/analytics/analyticsOverview/components/MetricFilter.tsx index 8ca80814..9b7ca97a 100644 --- a/src/user/analytics/analyticsOverview/components/MetricFilter.tsx +++ b/src/user/analytics/analyticsOverview/components/MetricFilter.tsx @@ -1,8 +1,8 @@ -import MetricSelect from "user/analytics/analyticsOverview/components/MetricSelect"; +import MetricSelect from "@/user/analytics/analyticsOverview/components/MetricSelect"; import { Box, Stack, Switch, Tooltip, Typography } from "@mui/material"; -import { decideValueAttribute } from "user/analytics/analyticsOverview/lib/overview.library"; -import { Metrics, StatsMetric } from "user/analytics/analyticsOverview/types"; -import { toLocaleString } from "util/bignumber"; +import { decideValueAttribute } from "@/user/analytics/analyticsOverview/lib/overview.library"; +import { Metrics, StatsMetric } from "@/user/analytics/analyticsOverview/types"; +import { toLocaleString } from "@/util/bignumber"; import { Trans } from "@lingui/macro"; type FilterMetric = { diff --git a/src/user/analytics/analyticsOverview/components/ReportUtils.tsx b/src/user/analytics/analyticsOverview/components/ReportUtils.tsx index 72b16e48..c8659847 100644 --- a/src/user/analytics/analyticsOverview/components/ReportUtils.tsx +++ b/src/user/analytics/analyticsOverview/components/ReportUtils.tsx @@ -1,9 +1,9 @@ import { Box } from "@mui/material"; -import { DateRangePicker } from "components/Date/DateRangePicker"; -import { DashboardButton } from "components/Button/DashboardButton"; -import { CampaignFormat } from "graphql/types"; +import { DateRangePicker } from "@/components/Date/DateRangePicker"; +import { DashboardButton } from "@/components/Button/DashboardButton"; +import { CampaignFormat } from "@/graphql/types"; import _ from "lodash"; -import { ReportMenu } from "user/reporting/ReportMenu"; +import { ReportMenu } from "@/user/reporting/ReportMenu"; import { Dayjs } from "dayjs"; interface DownloaderProps { diff --git a/src/user/analytics/analyticsOverview/hooks/usePersistMetricFilter.ts b/src/user/analytics/analyticsOverview/hooks/usePersistMetricFilter.ts index 8139c6e7..057eaa51 100644 --- a/src/user/analytics/analyticsOverview/hooks/usePersistMetricFilter.ts +++ b/src/user/analytics/analyticsOverview/hooks/usePersistMetricFilter.ts @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from "react"; -import { Metrics, StatsMetric } from "user/analytics/analyticsOverview/types"; +import { Metrics, StatsMetric } from "@/user/analytics/analyticsOverview/types"; import _ from "lodash"; export function usePersistMetricFilter( diff --git a/src/user/analytics/analyticsOverview/lib/ads.library.ts b/src/user/analytics/analyticsOverview/lib/ads.library.ts index 40925443..425bba95 100644 --- a/src/user/analytics/analyticsOverview/lib/ads.library.ts +++ b/src/user/analytics/analyticsOverview/lib/ads.library.ts @@ -1,7 +1,7 @@ import _ from "lodash"; -import { EngagementFragment } from "graphql/analytics-overview.generated"; -import { StatsMetric } from "user/analytics/analyticsOverview/types"; -import { processStats } from "user/analytics/analyticsOverview/lib/overview.library"; +import { EngagementFragment } from "@/graphql/analytics-overview.generated"; +import { StatsMetric } from "@/user/analytics/analyticsOverview/types"; +import { processStats } from "@/user/analytics/analyticsOverview/lib/overview.library"; export function adEngagements( engagements: EngagementFragment[], diff --git a/src/user/analytics/analyticsOverview/lib/os.library.ts b/src/user/analytics/analyticsOverview/lib/os.library.ts index 49580384..fc5cc129 100644 --- a/src/user/analytics/analyticsOverview/lib/os.library.ts +++ b/src/user/analytics/analyticsOverview/lib/os.library.ts @@ -1,5 +1,5 @@ import { calculateMetric } from "./overview.library"; -import { EngagementFragment } from "graphql/analytics-overview.generated"; +import { EngagementFragment } from "@/graphql/analytics-overview.generated"; import { OS, OSMetric } from "../types"; export function processOs(engagements: EngagementFragment[]) { diff --git a/src/user/analytics/analyticsOverview/lib/overview.library.ts b/src/user/analytics/analyticsOverview/lib/overview.library.ts index d804b77e..8096fb97 100644 --- a/src/user/analytics/analyticsOverview/lib/overview.library.ts +++ b/src/user/analytics/analyticsOverview/lib/overview.library.ts @@ -5,8 +5,8 @@ import { Metrics, StatsMetric, Tooltip, -} from "user/analytics/analyticsOverview/types"; -import { EngagementFragment } from "graphql/analytics-overview.generated"; +} from "@/user/analytics/analyticsOverview/types"; +import { EngagementFragment } from "@/graphql/analytics-overview.generated"; import BigNumber from "bignumber.js"; import { t } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/user/analytics/analyticsOverview/reports/campaign/EngagementsOverview.tsx b/src/user/analytics/analyticsOverview/reports/campaign/EngagementsOverview.tsx index 2e16b28b..ba1d774e 100644 --- a/src/user/analytics/analyticsOverview/reports/campaign/EngagementsOverview.tsx +++ b/src/user/analytics/analyticsOverview/reports/campaign/EngagementsOverview.tsx @@ -3,7 +3,7 @@ import { useState } from "react"; import { CampaignWithEngagementsFragment, EngagementFragment, -} from "graphql/analytics-overview.generated"; +} from "@/graphql/analytics-overview.generated"; import { prepareChart, processData, @@ -12,10 +12,10 @@ import { import MetricFilter from "../../components/MetricFilter"; import EngagementHeader from "../../components/EngagementHeader"; import LiveFeed from "../../components/LiveFeed"; -import { ErrorDetail } from "components/Error/ErrorDetail"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; import { ApolloError } from "@apollo/client"; -import { usePersistMetricFilter } from "user/analytics/analyticsOverview/hooks/usePersistMetricFilter"; -import { HighchartsWrapper } from "user/analytics/analyticsOverview/components/HighchartsWrapper"; +import { usePersistMetricFilter } from "@/user/analytics/analyticsOverview/hooks/usePersistMetricFilter"; +import { HighchartsWrapper } from "@/user/analytics/analyticsOverview/components/HighchartsWrapper"; import { msg, Trans } from "@lingui/macro"; interface Props { diff --git a/src/user/analytics/analyticsOverview/reports/os/OsOverview.tsx b/src/user/analytics/analyticsOverview/reports/os/OsOverview.tsx index 104cce3f..15330a28 100644 --- a/src/user/analytics/analyticsOverview/reports/os/OsOverview.tsx +++ b/src/user/analytics/analyticsOverview/reports/os/OsOverview.tsx @@ -1,5 +1,5 @@ import { Box, Stack } from "@mui/material"; -import { EngagementFragment } from "graphql/analytics-overview.generated"; +import { EngagementFragment } from "@/graphql/analytics-overview.generated"; import { mapOsStats, processOs } from "../../lib/os.library"; import { OsPieChart } from "./components/OsPieChart"; import { OsBarChart } from "./components/OsBarChart"; diff --git a/src/user/analytics/analyticsOverview/reports/os/components/OsBarChart.tsx b/src/user/analytics/analyticsOverview/reports/os/components/OsBarChart.tsx index a368e708..83df1192 100644 --- a/src/user/analytics/analyticsOverview/reports/os/components/OsBarChart.tsx +++ b/src/user/analytics/analyticsOverview/reports/os/components/OsBarChart.tsx @@ -1,6 +1,9 @@ import { useState } from "react"; import { SeriesOptionsType } from "highcharts"; -import { CalculatedOSMetric, OS } from "user/analytics/analyticsOverview/types"; +import { + CalculatedOSMetric, + OS, +} from "@/user/analytics/analyticsOverview/types"; import { BaseBarChart } from "../../../components/BaseBarChart"; import { msg } from "@lingui/macro"; diff --git a/src/user/analytics/analyticsOverview/reports/os/components/OsPieChart.tsx b/src/user/analytics/analyticsOverview/reports/os/components/OsPieChart.tsx index 884eae59..917b73f3 100644 --- a/src/user/analytics/analyticsOverview/reports/os/components/OsPieChart.tsx +++ b/src/user/analytics/analyticsOverview/reports/os/components/OsPieChart.tsx @@ -1,7 +1,7 @@ import { useState } from "react"; -import { mapDevice } from "user/analytics/analyticsOverview/lib/os.library"; -import { OSMetric } from "user/analytics/analyticsOverview/types"; +import { mapDevice } from "@/user/analytics/analyticsOverview/lib/os.library"; +import { OSMetric } from "@/user/analytics/analyticsOverview/types"; import { BasePieChart } from "../../../components/BasePieChart"; import { SeriesOptionsType } from "highcharts"; import { msg } from "@lingui/macro"; diff --git a/src/user/analytics/renderers/index.tsx b/src/user/analytics/renderers/index.tsx index 51f943fa..bfc1059f 100644 --- a/src/user/analytics/renderers/index.tsx +++ b/src/user/analytics/renderers/index.tsx @@ -1,9 +1,9 @@ import { Box, Skeleton, Typography } from "@mui/material"; -import { renderMonetaryAmount } from "components/Datagrid/renderers"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; -import { CampaignFormat } from "graphql/types"; -import { StatsMetric } from "user/analytics/analyticsOverview/types"; -import { toLocaleString } from "util/bignumber"; +import { renderMonetaryAmount } from "@/components/Datagrid/renderers"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; +import { CampaignFormat } from "@/graphql/types"; +import { StatsMetric } from "@/user/analytics/analyticsOverview/types"; +import { toLocaleString } from "@/util/bignumber"; export type EngagementOverview = { campaignId: string; diff --git a/src/user/analytics/search/AdSetBreakdown.tsx b/src/user/analytics/search/AdSetBreakdown.tsx index 867d2ec1..804a77a0 100644 --- a/src/user/analytics/search/AdSetBreakdown.tsx +++ b/src/user/analytics/search/AdSetBreakdown.tsx @@ -1,19 +1,19 @@ import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { DataGrid, GridColDef } from "@mui/x-data-grid"; -import { Status } from "components/Campaigns/Status"; +import { Status } from "@/components/Campaigns/Status"; import { AdSetValuesFragment, useFetchAdSetMetricsForCampaignQuery, -} from "graphql/analytics-overview.generated"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; -import { uiLabelsForBillingType } from "util/billingType"; -import { displayFromCampaignState } from "util/displayState"; +} from "@/graphql/analytics-overview.generated"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; +import { uiLabelsForBillingType } from "@/util/billingType"; +import { displayFromCampaignState } from "@/util/displayState"; import { MetricDefinition, getMetricListForCampaign } from "./metrics"; import { RenderMetric } from "./RenderMetric"; import { i18n } from "@lingui/core"; import lodash from "lodash"; -import { PerformanceFilter } from "graphql/types"; +import { PerformanceFilter } from "@/graphql/types"; function getColumnDefinitionForMetric(metric: MetricDefinition): GridColDef { return { diff --git a/src/user/analytics/search/MetricSelector.tsx b/src/user/analytics/search/MetricSelector.tsx index f5a1f699..cff9991b 100644 --- a/src/user/analytics/search/MetricSelector.tsx +++ b/src/user/analytics/search/MetricSelector.tsx @@ -2,7 +2,7 @@ import { Box, Switch, Tooltip, Typography, switchClasses } from "@mui/material"; import { MetricDefinition } from "./metrics"; import { RenderMetric } from "./RenderMetric"; import { useMetricSelection } from "./hooks"; -import { CampaignMetricDetailValuesFragment } from "graphql/analytics-overview.generated"; +import { CampaignMetricDetailValuesFragment } from "@/graphql/analytics-overview.generated"; import { Trans } from "@lingui/react"; interface Props { diff --git a/src/user/analytics/search/MetricsList.tsx b/src/user/analytics/search/MetricsList.tsx index 478ced72..eb7d1404 100644 --- a/src/user/analytics/search/MetricsList.tsx +++ b/src/user/analytics/search/MetricsList.tsx @@ -1,7 +1,7 @@ import { getMetricListForCampaign } from "./metrics"; import { MetricSelector } from "./MetricSelector"; -import { CampaignMetricDetailValuesFragment } from "graphql/analytics-overview.generated"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; +import { CampaignMetricDetailValuesFragment } from "@/graphql/analytics-overview.generated"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; interface Props { campaign: CampaignSummaryFragment; diff --git a/src/user/analytics/search/OverTimeGraph.tsx b/src/user/analytics/search/OverTimeGraph.tsx index edec07d7..3d5e9e00 100644 --- a/src/user/analytics/search/OverTimeGraph.tsx +++ b/src/user/analytics/search/OverTimeGraph.tsx @@ -1,7 +1,7 @@ -import { DailyValuesFragment } from "graphql/analytics-overview.generated"; +import { DailyValuesFragment } from "@/graphql/analytics-overview.generated"; import { useMetricSelection } from "./hooks"; import { makeLineChartSeries } from "./series"; -import { HighchartsWrapper } from "user/analytics/analyticsOverview/components/HighchartsWrapper"; +import { HighchartsWrapper } from "@/user/analytics/analyticsOverview/components/HighchartsWrapper"; interface Props { dataSource: DailyValuesFragment[] | undefined; diff --git a/src/user/analytics/search/RenderMetric.tsx b/src/user/analytics/search/RenderMetric.tsx index 08de97ee..c2eec7ea 100644 --- a/src/user/analytics/search/RenderMetric.tsx +++ b/src/user/analytics/search/RenderMetric.tsx @@ -2,7 +2,7 @@ import BigNumber from "bignumber.js"; import { MetricType } from "./metrics"; import _ from "lodash"; import { Skeleton, Typography } from "@mui/material"; -import { format } from "user/library/format"; +import { format } from "@/user/library/format"; interface Props { type: MetricType; diff --git a/src/user/analytics/search/metrics.ts b/src/user/analytics/search/metrics.ts index fc343628..d41d00ae 100644 --- a/src/user/analytics/search/metrics.ts +++ b/src/user/analytics/search/metrics.ts @@ -1,7 +1,7 @@ import { msg } from "@lingui/macro"; import BigNumber from "bignumber.js"; -import { CampaignMetricDetailValuesFragment } from "graphql/analytics-overview.generated"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; +import { CampaignMetricDetailValuesFragment } from "@/graphql/analytics-overview.generated"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; import { MessageDescriptor } from "@lingui/core"; export type MetricType = "number" | "rate" | "usd"; diff --git a/src/user/analytics/search/series.test.ts b/src/user/analytics/search/series.test.ts index f70dd2cd..bbaad4e5 100644 --- a/src/user/analytics/search/series.test.ts +++ b/src/user/analytics/search/series.test.ts @@ -2,7 +2,7 @@ import { getMetricDefinition } from "./metrics"; import { makeLineChartSeries } from "./series"; import assert from "node:assert"; import { DeepPartial } from "@apollo/client/utilities"; -import { DailyValuesFragment } from "graphql/analytics-overview.generated"; +import { DailyValuesFragment } from "@/graphql/analytics-overview.generated"; import dayjs from "dayjs"; it("should populate zero values for missing days in the date range", () => { diff --git a/src/user/analytics/search/series.ts b/src/user/analytics/search/series.ts index 28eaf6b5..7c233e2a 100644 --- a/src/user/analytics/search/series.ts +++ b/src/user/analytics/search/series.ts @@ -1,7 +1,7 @@ import { MetricDefinition } from "./metrics"; import { SeriesSplineOptions, SeriesTooltipOptionsObject } from "highcharts"; import BigNumber from "bignumber.js"; -import { DailyValuesFragment } from "graphql/analytics-overview.generated"; +import { DailyValuesFragment } from "@/graphql/analytics-overview.generated"; import { i18n } from "@lingui/core"; import dayjs from "dayjs"; diff --git a/src/user/campaignList/CampaignList.tsx b/src/user/campaignList/CampaignList.tsx index 4273602f..560fcf18 100644 --- a/src/user/campaignList/CampaignList.tsx +++ b/src/user/campaignList/CampaignList.tsx @@ -4,26 +4,26 @@ import { campaignOnOffState, renderMonetaryAmount, StandardRenderers, -} from "components/Datagrid/renderers"; +} from "@/components/Datagrid/renderers"; import { Link as RouterLink } from "react-router-dom"; -import { Status } from "components/Campaigns/Status"; -import { isDateInThePast } from "util/isAfterEndDate"; -import { AdvertiserCampaignsFragment } from "graphql/advertiser.generated"; +import { Status } from "@/components/Campaigns/Status"; +import { isDateInThePast } from "@/util/isAfterEndDate"; +import { AdvertiserCampaignsFragment } from "@/graphql/advertiser.generated"; import { CampaignMetricSummaryValuesFragment, useCampaignMetricsQuery, -} from "graphql/analytics-overview.generated"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; +} from "@/graphql/analytics-overview.generated"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; import { DataGrid, GridColDef } from "@mui/x-data-grid"; -import { CustomToolbar } from "components/Datagrid/CustomToolbar"; -import { CloneCampaign } from "components/Campaigns/CloneCampaign"; -import { EditButton } from "user/campaignList/EditButton"; -import { uiLabelsForCampaignFormat } from "util/campaign"; -import { stringFilterOperators } from "components/Datagrid/stringFilterOperators"; +import { CustomToolbar } from "@/components/Datagrid/CustomToolbar"; +import { CloneCampaign } from "@/components/Campaigns/CloneCampaign"; +import { EditButton } from "@/user/campaignList/EditButton"; +import { uiLabelsForCampaignFormat } from "@/util/campaign"; +import { stringFilterOperators } from "@/components/Datagrid/stringFilterOperators"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; import { MetricValue } from "./MetricValue"; -import { CampaignFormat } from "graphql/types"; +import { CampaignFormat } from "@/graphql/types"; interface Props { advertiser?: AdvertiserCampaignsFragment | null; diff --git a/src/user/campaignList/EditButton.tsx b/src/user/campaignList/EditButton.tsx index b14bb383..ebf20f5f 100644 --- a/src/user/campaignList/EditButton.tsx +++ b/src/user/campaignList/EditButton.tsx @@ -1,5 +1,5 @@ -import { CampaignSummaryFragment } from "graphql/campaign.generated"; -import { CampaignFormat, CampaignSource } from "graphql/types"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; +import { CampaignFormat, CampaignSource } from "@/graphql/types"; import { Button, Tooltip } from "@mui/material"; import { Link as RouterLink } from "react-router-dom"; import EditIcon from "@mui/icons-material/Edit"; diff --git a/src/user/campaignList/MetricValue.tsx b/src/user/campaignList/MetricValue.tsx index 0813c42e..c7a1cf1e 100644 --- a/src/user/campaignList/MetricValue.tsx +++ b/src/user/campaignList/MetricValue.tsx @@ -1,6 +1,6 @@ import { Box, Skeleton } from "@mui/material"; import _ from "lodash"; -import { format } from "user/library/format"; +import { format } from "@/user/library/format"; interface Props { loading?: boolean; diff --git a/src/user/hooks/useAdvertiserCreatives.ts b/src/user/hooks/useAdvertiserCreatives.ts index 6e940bd6..450a8278 100644 --- a/src/user/hooks/useAdvertiserCreatives.ts +++ b/src/user/hooks/useAdvertiserCreatives.ts @@ -1,7 +1,7 @@ import { useFormikContext } from "formik"; -import { CampaignForm, Creative } from "user/views/adsManager/types"; +import { CampaignForm, Creative } from "@/user/views/adsManager/types"; import _ from "lodash"; -import { isCreativeTypeApplicableToCampaignFormat } from "user/library"; +import { isCreativeTypeApplicableToCampaignFormat } from "@/user/library"; export function useAdvertiserCreatives() { const { values } = useFormikContext(); diff --git a/src/user/hooks/useAdvertiserWithPrices.tsx b/src/user/hooks/useAdvertiserWithPrices.tsx index c88d9da2..6329f218 100644 --- a/src/user/hooks/useAdvertiserWithPrices.tsx +++ b/src/user/hooks/useAdvertiserWithPrices.tsx @@ -1,13 +1,13 @@ -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; import { AdvertiserPriceFragment, useAdvertiserPricesQuery, -} from "graphql/advertiser.generated"; +} from "@/graphql/advertiser.generated"; import { useState } from "react"; -import { IAdvertiser } from "auth/context/auth.interface"; +import { IAdvertiser } from "@/auth/context/auth.interface"; import _ from "lodash"; -import { BillingType } from "graphql/types"; -import { Billing } from "user/views/adsManager/types"; +import { BillingType } from "@/graphql/types"; +import { Billing } from "@/user/views/adsManager/types"; import { t } from "@lingui/macro"; export type AdvertiserPrice = Omit & { diff --git a/src/user/hooks/useGenerateApiKey.tsx b/src/user/hooks/useGenerateApiKey.tsx index bcb3d12b..7a52635b 100644 --- a/src/user/hooks/useGenerateApiKey.tsx +++ b/src/user/hooks/useGenerateApiKey.tsx @@ -1,6 +1,6 @@ -import { buildAdServerV2Endpoint } from "util/environment"; +import { buildAdServerV2Endpoint } from "@/util/environment"; import { useCallback, useState } from "react"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { t } from "@lingui/macro"; export function useGenerateApiKey() { diff --git a/src/user/library/index.test.ts b/src/user/library/index.test.ts index 39270507..13133b94 100644 --- a/src/user/library/index.test.ts +++ b/src/user/library/index.test.ts @@ -1,4 +1,4 @@ -import { CampaignFragment } from "graphql/campaign.generated"; +import { CampaignFragment } from "@/graphql/campaign.generated"; import { describe, expect, it } from "vitest"; import { editCampaignValues, @@ -13,12 +13,16 @@ import { CampaignType, ConfirmationType, PaymentType, -} from "graphql/types"; +} from "@/graphql/types"; import { produce } from "immer"; -import { AdSetForm, CampaignForm, Creative } from "user/views/adsManager/types"; +import { + AdSetForm, + CampaignForm, + Creative, +} from "@/user/views/adsManager/types"; import _ from "lodash"; -import { AdFragment, AdSetFragment } from "graphql/ad-set.generated"; -import { CreativeFragment } from "graphql/creative.generated"; +import { AdFragment, AdSetFragment } from "@/graphql/ad-set.generated"; +import { CreativeFragment } from "@/graphql/creative.generated"; import { DeepPartial } from "@apollo/client/utilities"; const BASE_CPM_CAMPAIGN_FRAGMENT: Readonly = { diff --git a/src/user/library/index.ts b/src/user/library/index.ts index 74236122..45616244 100644 --- a/src/user/library/index.ts +++ b/src/user/library/index.ts @@ -2,9 +2,9 @@ import { CampaignFormat, CreateCampaignInput, UpdateCampaignInput, -} from "graphql/types"; -import { CampaignFragment } from "graphql/campaign.generated"; -import { AdFragment, AdSetFragment } from "graphql/ad-set.generated"; +} from "@/graphql/types"; +import { CampaignFragment } from "@/graphql/campaign.generated"; +import { AdFragment, AdSetFragment } from "@/graphql/ad-set.generated"; import { AdSetForm, Billing, @@ -13,10 +13,10 @@ import { Creative, initialCreative, Segment, -} from "user/views/adsManager/types"; +} from "@/user/views/adsManager/types"; import _ from "lodash"; import BigNumber from "bignumber.js"; -import { CreativeFragment } from "graphql/creative.generated"; +import { CreativeFragment } from "@/graphql/creative.generated"; import { t } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/user/reporting/ReportMenu.tsx b/src/user/reporting/ReportMenu.tsx index 341ab52e..ffd94ffa 100644 --- a/src/user/reporting/ReportMenu.tsx +++ b/src/user/reporting/ReportMenu.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { useDownloadCSV } from "user/reporting/csv.library"; +import { useDownloadCSV } from "@/user/reporting/csv.library"; import { Alert, Button, diff --git a/src/user/reporting/csv.library.tsx b/src/user/reporting/csv.library.tsx index 8441f74a..3f24eb56 100644 --- a/src/user/reporting/csv.library.tsx +++ b/src/user/reporting/csv.library.tsx @@ -1,8 +1,8 @@ import { useCallback, useState } from "react"; -import { buildAdServerEndpoint } from "util/environment"; +import { buildAdServerEndpoint } from "@/util/environment"; import Papa from "papaparse"; import tweetnacl from "tweetnacl"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { t } from "@lingui/macro"; interface DownloadProps { diff --git a/src/user/settings/NewKeyPairModal.tsx b/src/user/settings/NewKeyPairModal.tsx index d93cd6f5..bd34ef60 100644 --- a/src/user/settings/NewKeyPairModal.tsx +++ b/src/user/settings/NewKeyPairModal.tsx @@ -6,12 +6,12 @@ import { TextField, Typography, } from "@mui/material"; -import { useUpdateAdvertiserMutation } from "graphql/advertiser.generated"; +import { useUpdateAdvertiserMutation } from "@/graphql/advertiser.generated"; import tweetnacl from "tweetnacl"; import { useRef, useState } from "react"; -import { IAdvertiser } from "auth/context/auth.interface"; -import { CardContainer } from "components/Card/CardContainer"; -import { modalStyles } from "theme"; +import { IAdvertiser } from "@/auth/context/auth.interface"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { modalStyles } from "@/theme"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/settings/Settings.tsx b/src/user/settings/Settings.tsx index 4f2f1a37..57f79d72 100644 --- a/src/user/settings/Settings.tsx +++ b/src/user/settings/Settings.tsx @@ -11,13 +11,13 @@ import { Stack, Typography, } from "@mui/material"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { setActiveAdvertiser } from "auth/util"; -import { CardContainer } from "components/Card/CardContainer"; -import { DraftContext } from "state/context"; -import { NewKeyPairModal } from "user/settings/NewKeyPairModal"; -import MiniSideBar from "components/Drawer/MiniSideBar"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { setActiveAdvertiser } from "@/auth/util"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { DraftContext } from "@/state/context"; +import { NewKeyPairModal } from "@/user/settings/NewKeyPairModal"; +import MiniSideBar from "@/components/Drawer/MiniSideBar"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; const Settings = () => { diff --git a/src/user/settings/UserApiKey.tsx b/src/user/settings/UserApiKey.tsx index 324e5c42..9a8f19c9 100644 --- a/src/user/settings/UserApiKey.tsx +++ b/src/user/settings/UserApiKey.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import { CardContainer } from "components/Card/CardContainer"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Box, Button, @@ -13,8 +13,8 @@ import { Typography, } from "@mui/material"; import { LoadingButton } from "@mui/lab"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { useGenerateApiKey } from "user/hooks/useGenerateApiKey"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { useGenerateApiKey } from "@/user/hooks/useGenerateApiKey"; import ContentCopyOutlinedIcon from "@mui/icons-material/ContentCopyOutlined"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/settings/UserForm.tsx b/src/user/settings/UserForm.tsx index 99a5406d..f9a5ec11 100644 --- a/src/user/settings/UserForm.tsx +++ b/src/user/settings/UserForm.tsx @@ -1,15 +1,15 @@ import { Stack } from "@mui/material"; import { useState } from "react"; -import { useUser } from "auth/hooks/queries/useUser"; -import { CardContainer } from "components/Card/CardContainer"; +import { useUser } from "@/auth/hooks/queries/useUser"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Form, Formik, FormikValues } from "formik"; -import { FormikTextField } from "form/FormikHelpers"; -import { useUpdateUserMutation } from "graphql/user.generated"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { UserSchema } from "validation/UserSchema"; +import { FormikTextField } from "@/form/FormikHelpers"; +import { useUpdateUserMutation } from "@/graphql/user.generated"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { UserSchema } from "@/validation/UserSchema"; import _ from "lodash"; -import { FormikSubmitButton } from "form/FormikButton"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { FormikSubmitButton } from "@/form/FormikButton"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/types/index.ts b/src/user/views/adsManager/types/index.ts index b96e682f..9d33fba3 100644 --- a/src/user/views/adsManager/types/index.ts +++ b/src/user/views/adsManager/types/index.ts @@ -1,7 +1,7 @@ -import { CampaignFormat, CreativeInput, PaymentType } from "graphql/types"; -import { defaultEndDate, defaultStartDate } from "form/DateFieldHelpers"; -import { MIN_PER_CAMPAIGN } from "validation/CampaignSchema"; -import { AdvertiserWithPrices } from "user/hooks/useAdvertiserWithPrices"; +import { CampaignFormat, CreativeInput, PaymentType } from "@/graphql/types"; +import { defaultEndDate, defaultStartDate } from "@/form/DateFieldHelpers"; +import { MIN_PER_CAMPAIGN } from "@/validation/CampaignSchema"; +import { AdvertiserWithPrices } from "@/user/hooks/useAdvertiserWithPrices"; export type Billing = "cpm" | "cpc" | "cpsv"; diff --git a/src/user/views/adsManager/views/advanced/components/adSet/AdSetFields.tsx b/src/user/views/adsManager/views/advanced/components/adSet/AdSetFields.tsx index caba1341..f3764bd9 100644 --- a/src/user/views/adsManager/views/advanced/components/adSet/AdSetFields.tsx +++ b/src/user/views/adsManager/views/advanced/components/adSet/AdSetFields.tsx @@ -1,19 +1,19 @@ import { PickerFields } from "./fields/PickerFields"; import { ConversionField } from "./fields/ConversionField"; -import { CardContainer } from "components/Card/CardContainer"; +import { CardContainer } from "@/components/Card/CardContainer"; import { useHistory } from "react-router-dom"; -import { FormikTextField, useIsEdit } from "form/FormikHelpers"; -import { AdSetAds } from "user/views/adsManager/views/advanced/components/adSet/fields/AdSetAds"; -import { adSetOnOffState } from "components/Datagrid/renderers"; +import { FormikTextField, useIsEdit } from "@/form/FormikHelpers"; +import { AdSetAds } from "@/user/views/adsManager/views/advanced/components/adSet/fields/AdSetAds"; +import { adSetOnOffState } from "@/components/Datagrid/renderers"; import { Stack, Typography } from "@mui/material"; import { useFormikContext } from "formik"; -import { CampaignForm } from "user/views/adsManager/types"; -import { CampaignSource } from "graphql/types"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { Status } from "components/Campaigns/Status"; -import { displayFromCampaignState } from "util/displayState"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { CampaignForm } from "@/user/views/adsManager/types"; +import { CampaignSource } from "@/graphql/types"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { Status } from "@/components/Campaigns/Status"; +import { displayFromCampaignState } from "@/util/displayState"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/views/advanced/components/adSet/NewAdSet.tsx b/src/user/views/adsManager/views/advanced/components/adSet/NewAdSet.tsx index 81083ad9..8b7517d3 100644 --- a/src/user/views/adsManager/views/advanced/components/adSet/NewAdSet.tsx +++ b/src/user/views/adsManager/views/advanced/components/adSet/NewAdSet.tsx @@ -9,11 +9,11 @@ import { Typography, } from "@mui/material"; import { Link as RouterLink, useHistory } from "react-router-dom"; -import { CampaignForm, initialAdSet } from "user/views/adsManager/types"; +import { CampaignForm, initialAdSet } from "@/user/views/adsManager/types"; import { useRef } from "react"; import RemoveCircleOutlineIcon from "@mui/icons-material/RemoveCircleOutline"; -import { useAdvertiserCreatives } from "user/hooks/useAdvertiserCreatives"; -import { useTrackMatomoEvent } from "hooks/useTrackWithMatomo"; +import { useAdvertiserCreatives } from "@/user/hooks/useAdvertiserCreatives"; +import { useTrackMatomoEvent } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/views/advanced/components/adSet/fields/AdSetAds.tsx b/src/user/views/adsManager/views/advanced/components/adSet/fields/AdSetAds.tsx index 1ab37e73..a6964c91 100644 --- a/src/user/views/adsManager/views/advanced/components/adSet/fields/AdSetAds.tsx +++ b/src/user/views/adsManager/views/advanced/components/adSet/fields/AdSetAds.tsx @@ -1,17 +1,17 @@ -import { CardContainer } from "components/Card/CardContainer"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Box, Modal, Typography } from "@mui/material"; -import { CampaignForm } from "user/views/adsManager/types"; +import { CampaignForm } from "@/user/views/adsManager/types"; import { useField, useFormikContext } from "formik"; -import { CreativeSelect } from "components/Creatives/CreativeSelect"; -import { isCreativeTypeApplicableToCampaignFormat } from "user/library"; -import { NewAd } from "user/ads/NewAd"; -import { AdsExistingAd } from "user/ads/AdsExistingAd"; -import { ShowAdsButton } from "user/ads/ShowAdsButton"; -import { CampaignFormat } from "graphql/types"; -import { NotificationAd } from "user/ads/NotificationAd"; -import { InlineContentAd } from "user/ads/InlineContentAd"; -import { modalStyles } from "theme"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { CreativeSelect } from "@/components/Creatives/CreativeSelect"; +import { isCreativeTypeApplicableToCampaignFormat } from "@/user/library"; +import { NewAd } from "@/user/ads/NewAd"; +import { AdsExistingAd } from "@/user/ads/AdsExistingAd"; +import { ShowAdsButton } from "@/user/ads/ShowAdsButton"; +import { CampaignFormat } from "@/graphql/types"; +import { NotificationAd } from "@/user/ads/NotificationAd"; +import { InlineContentAd } from "@/user/ads/InlineContentAd"; +import { modalStyles } from "@/theme"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; import { Trans } from "@lingui/macro"; interface Props { diff --git a/src/user/views/adsManager/views/advanced/components/adSet/fields/ConversionField.tsx b/src/user/views/adsManager/views/advanced/components/adSet/fields/ConversionField.tsx index 1be5c4a1..06824fd6 100644 --- a/src/user/views/adsManager/views/advanced/components/adSet/fields/ConversionField.tsx +++ b/src/user/views/adsManager/views/advanced/components/adSet/fields/ConversionField.tsx @@ -1,10 +1,10 @@ import { Button, Link, Stack, Typography } from "@mui/material"; -import { ConversionFields } from "components/Conversion/ConversionFields"; +import { ConversionFields } from "@/components/Conversion/ConversionFields"; import { FieldArray, FieldArrayRenderProps, useField } from "formik"; import { Conversion, initialConversion } from "../../../../../types"; -import { CardContainer } from "components/Card/CardContainer"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Add } from "@mui/icons-material"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; import { Trans } from "@lingui/macro"; interface Props { diff --git a/src/user/views/adsManager/views/advanced/components/adSet/fields/PickerFields.tsx b/src/user/views/adsManager/views/advanced/components/adSet/fields/PickerFields.tsx index 7daea681..c45cd315 100644 --- a/src/user/views/adsManager/views/advanced/components/adSet/fields/PickerFields.tsx +++ b/src/user/views/adsManager/views/advanced/components/adSet/fields/PickerFields.tsx @@ -1,12 +1,12 @@ import { Typography } from "@mui/material"; -import { SegmentPicker } from "components/Segment/SegmentPicker"; -import { PlatformPicker } from "components/Platform/PlatformPicker"; -import { CardContainer } from "components/Card/CardContainer"; +import { SegmentPicker } from "@/components/Segment/SegmentPicker"; +import { PlatformPicker } from "@/components/Platform/PlatformPicker"; +import { CardContainer } from "@/components/Card/CardContainer"; import { useField } from "formik"; -import { CampaignFormat } from "graphql/types"; +import { CampaignFormat } from "@/graphql/types"; import { useEffect } from "react"; -import { SegmentFragment } from "graphql/common.generated"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { SegmentFragment } from "@/graphql/common.generated"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; import { Trans } from "@lingui/macro"; interface Props { diff --git a/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx b/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx index 97dde550..668f5b40 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/CampaignSettings.tsx @@ -1,16 +1,16 @@ -import { FormikTextField, useIsEdit } from "form/FormikHelpers"; -import { CardContainer } from "components/Card/CardContainer"; -import { CampaignDateRange } from "components/Campaigns/CampaignDateRange"; +import { FormikTextField, useIsEdit } from "@/form/FormikHelpers"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { CampaignDateRange } from "@/components/Campaigns/CampaignDateRange"; import { Typography } from "@mui/material"; -import { FormatField } from "user/views/adsManager/views/advanced/components/campaign/fields/FormatField"; -import { AdvertiserPrice } from "user/hooks/useAdvertiserWithPrices"; -import { BudgetField } from "user/views/adsManager/views/advanced/components/campaign/fields/BudgetField"; -import { BillingModelSelect } from "user/views/adsManager/views/advanced/components/campaign/components/BillingModelSelect"; -import { CustomPriceSelect } from "user/views/adsManager/views/advanced/components/campaign/components/CustomPriceSelect"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; -import { LocationPicker } from "components/Location/LocationPicker"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { FormatField } from "@/user/views/adsManager/views/advanced/components/campaign/fields/FormatField"; +import { AdvertiserPrice } from "@/user/hooks/useAdvertiserWithPrices"; +import { BudgetField } from "@/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField"; +import { BillingModelSelect } from "@/user/views/adsManager/views/advanced/components/campaign/components/BillingModelSelect"; +import { CustomPriceSelect } from "@/user/views/adsManager/views/advanced/components/campaign/components/CustomPriceSelect"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; +import { LocationPicker } from "@/components/Location/LocationPicker"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { msg, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/views/advanced/components/campaign/components/BillingModelSelect.tsx b/src/user/views/adsManager/views/advanced/components/campaign/components/BillingModelSelect.tsx index 1c72e091..0d9f06d5 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/components/BillingModelSelect.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/components/BillingModelSelect.tsx @@ -1,13 +1,13 @@ import { List, ListItemButton, Stack, Typography } from "@mui/material"; -import { renderMonetaryAmount } from "components/Datagrid/renderers"; -import { useIsEdit } from "form/FormikHelpers"; +import { renderMonetaryAmount } from "@/components/Datagrid/renderers"; +import { useIsEdit } from "@/form/FormikHelpers"; import { useField } from "formik"; -import { CampaignFormat } from "graphql/types"; -import { AdvertiserPrice } from "user/hooks/useAdvertiserWithPrices"; -import { Billing } from "user/views/adsManager/types"; -import { uiLabelsForCampaignFormat } from "util/campaign"; -import { uiLabelsForBillingType } from "util/billingType"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { CampaignFormat } from "@/graphql/types"; +import { AdvertiserPrice } from "@/user/hooks/useAdvertiserWithPrices"; +import { Billing } from "@/user/views/adsManager/types"; +import { uiLabelsForCampaignFormat } from "@/util/campaign"; +import { uiLabelsForBillingType } from "@/util/billingType"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; import { Trans } from "@lingui/macro"; export function BillingModelSelect(props: { prices: AdvertiserPrice[] }) { diff --git a/src/user/views/adsManager/views/advanced/components/campaign/components/CustomPriceSelect.tsx b/src/user/views/adsManager/views/advanced/components/campaign/components/CustomPriceSelect.tsx index c9c4a5dc..788909e8 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/components/CustomPriceSelect.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/components/CustomPriceSelect.tsx @@ -2,11 +2,11 @@ import { FormikRadioControl, FormikTextField, useIsEdit, -} from "form/FormikHelpers"; +} from "@/form/FormikHelpers"; import { useField } from "formik"; -import { CampaignFormat } from "graphql/types"; +import { CampaignFormat } from "@/graphql/types"; import { InputAdornment, Stack } from "@mui/material"; -import { uiLabelsForBillingType } from "util/billingType"; +import { uiLabelsForBillingType } from "@/util/billingType"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx b/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx index fefcb58a..9570e2f0 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/fields/BudgetField.tsx @@ -1,8 +1,8 @@ import { InputAdornment } from "@mui/material"; -import { FormikTextField, useIsEdit } from "form/FormikHelpers"; +import { FormikTextField, useIsEdit } from "@/form/FormikHelpers"; import { useFormikContext } from "formik"; import { CampaignForm } from "../../../../../types"; -import { useAdvertiserWithPrices } from "user/hooks/useAdvertiserWithPrices"; +import { useAdvertiserWithPrices } from "@/user/hooks/useAdvertiserWithPrices"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx b/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx index 42448df4..7ebb179d 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/fields/FormatField.tsx @@ -7,15 +7,15 @@ import { Stack, Typography, } from "@mui/material"; -import { CardContainer } from "components/Card/CardContainer"; +import { CardContainer } from "@/components/Card/CardContainer"; import { useField } from "formik"; -import { CampaignFormat } from "graphql/types"; -import { useIsEdit } from "form/FormikHelpers"; -import { Billing } from "user/views/adsManager/types"; -import { AdvertiserPrice } from "user/hooks/useAdvertiserWithPrices"; +import { CampaignFormat } from "@/graphql/types"; +import { useIsEdit } from "@/form/FormikHelpers"; +import { Billing } from "@/user/views/adsManager/types"; +import { AdvertiserPrice } from "@/user/hooks/useAdvertiserWithPrices"; import ErrorIcon from "@mui/icons-material/Error"; -import { CustomTooltip } from "components/Tooltip/CustomTooltip"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { CustomTooltip } from "@/components/Tooltip/CustomTooltip"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; import { msg } from "@lingui/macro"; import { Trans, useLingui } from "@lingui/react"; import { MessageDescriptor } from "@lingui/core"; diff --git a/src/user/views/adsManager/views/advanced/components/campaign/fields/LocationField.tsx b/src/user/views/adsManager/views/advanced/components/campaign/fields/LocationField.tsx index aef7d8d2..1a83f4aa 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/fields/LocationField.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/fields/LocationField.tsx @@ -1,6 +1,6 @@ import { Typography } from "@mui/material"; -import { LocationPicker } from "components/Location/LocationPicker"; -import { CardContainer } from "components/Card/CardContainer"; +import { LocationPicker } from "@/components/Location/LocationPicker"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Trans } from "@lingui/macro"; export function LocationField() { diff --git a/src/user/views/adsManager/views/advanced/components/campaign/fields/PaymentMethodField.tsx b/src/user/views/adsManager/views/advanced/components/campaign/fields/PaymentMethodField.tsx index e00a557c..e509d0dd 100644 --- a/src/user/views/adsManager/views/advanced/components/campaign/fields/PaymentMethodField.tsx +++ b/src/user/views/adsManager/views/advanced/components/campaign/fields/PaymentMethodField.tsx @@ -1,9 +1,9 @@ import { Stack, Typography } from "@mui/material"; -import { FormikRadioControl, useIsEdit } from "form/FormikHelpers"; -import { PaymentType } from "graphql/types"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { CardContainer } from "components/Card/CardContainer"; -import { LearnMoreButton } from "components/Button/LearnMoreButton"; +import { FormikRadioControl, useIsEdit } from "@/form/FormikHelpers"; +import { PaymentType } from "@/graphql/types"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { LearnMoreButton } from "@/components/Button/LearnMoreButton"; import { Trans } from "@lingui/macro"; export function PaymentMethodField() { diff --git a/src/user/views/adsManager/views/advanced/components/completionForm/CompletionForm.tsx b/src/user/views/adsManager/views/advanced/components/completionForm/CompletionForm.tsx index 5604b727..2fa56db4 100644 --- a/src/user/views/adsManager/views/advanced/components/completionForm/CompletionForm.tsx +++ b/src/user/views/adsManager/views/advanced/components/completionForm/CompletionForm.tsx @@ -3,8 +3,8 @@ import { useState } from "react"; import { useParams, Link as RouterLink } from "react-router-dom"; import { Card, Container, Stack, Typography } from "@mui/material"; import { LoadingButton } from "@mui/lab"; -import { useValidatePaymentSession } from "checkout/hooks/useValidatePaymentSession"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { useValidatePaymentSession } from "@/checkout/hooks/useValidatePaymentSession"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; interface Params { diff --git a/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx b/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx index c24a9a55..1c6af9f8 100644 --- a/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx +++ b/src/user/views/adsManager/views/advanced/components/form/EditCampaign.tsx @@ -1,21 +1,21 @@ import { Container, LinearProgress } from "@mui/material"; import { Formik } from "formik"; import { CampaignForm } from "../../../../types"; -import { CampaignSchema } from "validation/CampaignSchema"; -import { editCampaignValues, transformEditForm } from "user/library"; +import { CampaignSchema } from "@/validation/CampaignSchema"; +import { editCampaignValues, transformEditForm } from "@/user/library"; import { useLoadCampaignQuery, useUpdateCampaignMutation, -} from "graphql/campaign.generated"; +} from "@/graphql/campaign.generated"; import { useHistory, useParams } from "react-router-dom"; import { BaseForm } from "./components/BaseForm"; -import { useCreatePaymentSession } from "checkout/hooks/useCreatePaymentSession"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { refetchAdvertiserCampaignsQuery } from "graphql/advertiser.generated"; +import { useCreatePaymentSession } from "@/checkout/hooks/useCreatePaymentSession"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { refetchAdvertiserCampaignsQuery } from "@/graphql/advertiser.generated"; import { useContext } from "react"; -import { FilterContext } from "state/context"; -import { useAdvertiserWithPrices } from "user/hooks/useAdvertiserWithPrices"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { FilterContext } from "@/state/context"; +import { useAdvertiserWithPrices } from "@/user/hooks/useAdvertiserWithPrices"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/views/advanced/components/form/NewCampaign.tsx b/src/user/views/adsManager/views/advanced/components/form/NewCampaign.tsx index ae912958..eda1cf1f 100644 --- a/src/user/views/adsManager/views/advanced/components/form/NewCampaign.tsx +++ b/src/user/views/adsManager/views/advanced/components/form/NewCampaign.tsx @@ -2,21 +2,21 @@ import { Container, LinearProgress } from "@mui/material"; import { Formik } from "formik"; import { useContext, useState } from "react"; import { CampaignForm, initialCampaign } from "../../../../types"; -import { CampaignSchema } from "validation/CampaignSchema"; -import { transformNewForm } from "user/library"; -import { useCreateCampaignMutation } from "graphql/campaign.generated"; +import { CampaignSchema } from "@/validation/CampaignSchema"; +import { transformNewForm } from "@/user/library"; +import { useCreateCampaignMutation } from "@/graphql/campaign.generated"; import { useHistory, useParams } from "react-router-dom"; import { BaseForm } from "./components/BaseForm"; -import { PersistFormValues } from "form/PersistFormValues"; -import { DraftContext, FilterContext } from "state/context"; -import { useCreatePaymentSession } from "checkout/hooks/useCreatePaymentSession"; -import { PaymentType } from "graphql/types"; -import { useUser } from "auth/hooks/queries/useUser"; -import { refetchAdvertiserCampaignsQuery } from "graphql/advertiser.generated"; -import { useAdvertiserWithPrices } from "user/hooks/useAdvertiserWithPrices"; -import { ErrorDetail } from "components/Error/ErrorDetail"; +import { PersistFormValues } from "@/form/PersistFormValues"; +import { DraftContext, FilterContext } from "@/state/context"; +import { useCreatePaymentSession } from "@/checkout/hooks/useCreatePaymentSession"; +import { PaymentType } from "@/graphql/types"; +import { useUser } from "@/auth/hooks/queries/useUser"; +import { refetchAdvertiserCampaignsQuery } from "@/graphql/advertiser.generated"; +import { useAdvertiserWithPrices } from "@/user/hooks/useAdvertiserWithPrices"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; import _ from "lodash"; -import { useTrackWithMatomo } from "hooks/useTrackWithMatomo"; +import { useTrackWithMatomo } from "@/hooks/useTrackWithMatomo"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/views/advanced/components/form/components/BaseForm.tsx b/src/user/views/adsManager/views/advanced/components/form/components/BaseForm.tsx index c9c5cfc2..e7ecda42 100644 --- a/src/user/views/adsManager/views/advanced/components/form/components/BaseForm.tsx +++ b/src/user/views/adsManager/views/advanced/components/form/components/BaseForm.tsx @@ -1,14 +1,14 @@ import { Form } from "formik"; import { Review } from "../../review/Review"; -import { CampaignSettings } from "user/views/adsManager/views/advanced/components/campaign/CampaignSettings"; -import { StepDrawer } from "components/Steps/StepDrawer"; -import { PaymentButton } from "user/views/adsManager/views/advanced/components/form/components/PaymentButton"; -import { AdSetFields } from "user/views/adsManager/views/advanced/components/adSet/AdSetFields"; -import { NewAdSet } from "user/views/adsManager/views/advanced/components/adSet/NewAdSet"; +import { CampaignSettings } from "@/user/views/adsManager/views/advanced/components/campaign/CampaignSettings"; +import { StepDrawer } from "@/components/Steps/StepDrawer"; +import { PaymentButton } from "@/user/views/adsManager/views/advanced/components/form/components/PaymentButton"; +import { AdSetFields } from "@/user/views/adsManager/views/advanced/components/adSet/AdSetFields"; +import { NewAdSet } from "@/user/views/adsManager/views/advanced/components/adSet/NewAdSet"; import { Route, Switch, useRouteMatch } from "react-router-dom"; -import { FormContext } from "state/context"; +import { FormContext } from "@/state/context"; import { useState } from "react"; -import { AdvertiserPrice } from "user/hooks/useAdvertiserWithPrices"; +import { AdvertiserPrice } from "@/user/hooks/useAdvertiserWithPrices"; import { msg } from "@lingui/macro"; interface Props { diff --git a/src/user/views/adsManager/views/advanced/components/form/components/PaymentButton.tsx b/src/user/views/adsManager/views/advanced/components/form/components/PaymentButton.tsx index b908fb58..348bb131 100644 --- a/src/user/views/adsManager/views/advanced/components/form/components/PaymentButton.tsx +++ b/src/user/views/adsManager/views/advanced/components/form/components/PaymentButton.tsx @@ -1,6 +1,6 @@ -import { useIsEdit } from "form/FormikHelpers"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { FormikSubmitButton } from "form/FormikButton"; +import { useIsEdit } from "@/form/FormikHelpers"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { FormikSubmitButton } from "@/form/FormikButton"; import { msg } from "@lingui/macro"; export function PaymentButton(props: { hasPaymentIntent: boolean }) { diff --git a/src/user/views/adsManager/views/advanced/components/review/Review.tsx b/src/user/views/adsManager/views/advanced/components/review/Review.tsx index e4a934ce..3a2329bc 100644 --- a/src/user/views/adsManager/views/advanced/components/review/Review.tsx +++ b/src/user/views/adsManager/views/advanced/components/review/Review.tsx @@ -4,8 +4,8 @@ import { Box, Typography } from "@mui/material"; import { useEffect } from "react"; import { CampaignReview } from "./components/CampaignReview"; import { AdSetReview } from "./components/AdSetReview"; -import { PaymentMethodField } from "user/views/adsManager/views/advanced/components/campaign/fields/PaymentMethodField"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { PaymentMethodField } from "@/user/views/adsManager/views/advanced/components/campaign/fields/PaymentMethodField"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { Trans } from "@lingui/macro"; export function Review() { diff --git a/src/user/views/adsManager/views/advanced/components/review/components/AdSetReview.tsx b/src/user/views/adsManager/views/advanced/components/review/components/AdSetReview.tsx index 8b18d081..0c0914b9 100644 --- a/src/user/views/adsManager/views/advanced/components/review/components/AdSetReview.tsx +++ b/src/user/views/adsManager/views/advanced/components/review/components/AdSetReview.tsx @@ -1,11 +1,11 @@ import { AdSetForm, Creative, OS, Segment } from "../../../../../types"; import { FormikErrors } from "formik"; -import { ConversionDisplay } from "components/Conversion/ConversionDisplay"; +import { ConversionDisplay } from "@/components/Conversion/ConversionDisplay"; import { ReviewField } from "./ReviewField"; -import { ReviewContainer } from "user/views/adsManager/views/advanced/components/review/components/ReviewContainer"; -import { CampaignFormat } from "graphql/types"; -import { CreativeSpecificPreview } from "components/Creatives/CreativeSpecificPreview"; -import { segmentNameWithNoDash } from "util/segment"; +import { ReviewContainer } from "@/user/views/adsManager/views/advanced/components/review/components/ReviewContainer"; +import { CampaignFormat } from "@/graphql/types"; +import { CreativeSpecificPreview } from "@/components/Creatives/CreativeSpecificPreview"; +import { segmentNameWithNoDash } from "@/util/segment"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/adsManager/views/advanced/components/review/components/CampaignReview.tsx b/src/user/views/adsManager/views/advanced/components/review/components/CampaignReview.tsx index 52e53ffe..3ca35cda 100644 --- a/src/user/views/adsManager/views/advanced/components/review/components/CampaignReview.tsx +++ b/src/user/views/adsManager/views/advanced/components/review/components/CampaignReview.tsx @@ -1,9 +1,9 @@ import { CampaignForm } from "../../../../../types"; import { FormikErrors } from "formik"; import { ReviewField } from "./ReviewField"; -import { ReviewContainer } from "user/views/adsManager/views/advanced/components/review/components/ReviewContainer"; -import { uiLabelsForBillingType } from "util/billingType"; -import { uiLabelsForCampaignFormat } from "util/campaign"; +import { ReviewContainer } from "@/user/views/adsManager/views/advanced/components/review/components/ReviewContainer"; +import { uiLabelsForBillingType } from "@/util/billingType"; +import { uiLabelsForCampaignFormat } from "@/util/campaign"; import { msg, Trans } from "@lingui/macro"; interface Props { diff --git a/src/user/views/adsManager/views/advanced/components/review/components/ReviewContainer.tsx b/src/user/views/adsManager/views/advanced/components/review/components/ReviewContainer.tsx index 0cc9ea91..2dfc7e57 100644 --- a/src/user/views/adsManager/views/advanced/components/review/components/ReviewContainer.tsx +++ b/src/user/views/adsManager/views/advanced/components/review/components/ReviewContainer.tsx @@ -1,6 +1,6 @@ import { PropsWithChildren, ReactNode } from "react"; import { useRouteMatch, Link as RouterLink } from "react-router-dom"; -import { CardContainer } from "components/Card/CardContainer"; +import { CardContainer } from "@/components/Card/CardContainer"; import { Button } from "@mui/material"; import { Trans } from "@lingui/macro"; diff --git a/src/user/views/user/AdDetailTable.tsx b/src/user/views/user/AdDetailTable.tsx index 9318cd08..a73fbaa4 100644 --- a/src/user/views/user/AdDetailTable.tsx +++ b/src/user/views/user/AdDetailTable.tsx @@ -1,7 +1,7 @@ -import { CampaignAdsFragment } from "graphql/campaign.generated"; -import { CampaignFormat } from "graphql/types"; -import { StatsMetric } from "user/analytics/analyticsOverview/types"; -import { renderStatsCell } from "user/analytics/renderers"; +import { CampaignAdsFragment } from "@/graphql/campaign.generated"; +import { CampaignFormat } from "@/graphql/types"; +import { StatsMetric } from "@/user/analytics/analyticsOverview/types"; +import { renderStatsCell } from "@/user/analytics/renderers"; import { DataGrid, GridColDef, GridValidRowModel } from "@mui/x-data-grid"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; diff --git a/src/user/views/user/CampaignDetails.tsx b/src/user/views/user/CampaignDetails.tsx index 58b85734..a88543b3 100644 --- a/src/user/views/user/CampaignDetails.tsx +++ b/src/user/views/user/CampaignDetails.tsx @@ -1,14 +1,14 @@ import { useState } from "react"; import DatasetIcon from "@mui/icons-material/Dataset"; import LibraryBooksIcon from "@mui/icons-material/LibraryBooks"; -import { useLoadCampaignAdsQuery } from "graphql/campaign.generated"; +import { useLoadCampaignAdsQuery } from "@/graphql/campaign.generated"; import { useParams } from "react-router-dom"; -import { ErrorDetail } from "components/Error/ErrorDetail"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; import { Box, Skeleton, Tab, Tabs } from "@mui/material"; -import { AdSetList } from "user/adSet/AdSetList"; -import { AdList } from "user/ads/AdList"; -import { EngagementFragment } from "graphql/analytics-overview.generated"; -import { adEngagements } from "user/analytics/analyticsOverview/lib/ads.library"; +import { AdSetList } from "@/user/adSet/AdSetList"; +import { AdList } from "@/user/ads/AdList"; +import { EngagementFragment } from "@/graphql/analytics-overview.generated"; +import { adEngagements } from "@/user/analytics/analyticsOverview/lib/ads.library"; import { msg } from "@lingui/macro"; import { useLingui } from "@lingui/react"; diff --git a/src/user/views/user/CampaignReportViewSelector.tsx b/src/user/views/user/CampaignReportViewSelector.tsx index 5327d106..b1a538fc 100644 --- a/src/user/views/user/CampaignReportViewSelector.tsx +++ b/src/user/views/user/CampaignReportViewSelector.tsx @@ -1,9 +1,9 @@ import { Box, LinearProgress } from "@mui/material"; -import { AlwaysOnFormButton } from "components/Button/AlwaysOnFormButton"; -import { useLoadCampaignSummaryQuery } from "graphql/campaign.generated"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { AlwaysOnFormButton } from "@/components/Button/AlwaysOnFormButton"; +import { useLoadCampaignSummaryQuery } from "@/graphql/campaign.generated"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { useParams } from "react-router-dom"; -import { CampaignFormat } from "graphql/types"; +import { CampaignFormat } from "@/graphql/types"; import { ConsultAccountManager } from "./reports/ConsultAccountManager"; import { OriginalCampaignReportView } from "./reports/OriginalCampaignReportView"; import { SearchCampaignReportView } from "./reports/SearchCampaignReportView"; diff --git a/src/user/views/user/CampaignView.tsx b/src/user/views/user/CampaignView.tsx index 14421cb0..bb216200 100644 --- a/src/user/views/user/CampaignView.tsx +++ b/src/user/views/user/CampaignView.tsx @@ -1,14 +1,14 @@ import { Box, Skeleton } from "@mui/material"; import { useContext } from "react"; -import { useAdvertiserCampaignsQuery } from "graphql/advertiser.generated"; -import { CampaignAgeFilter } from "components/Campaigns/CampaignAgeFilter"; -import { CampaignList } from "user/campaignList/CampaignList"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { CardContainer } from "components/Card/CardContainer"; -import MiniSideBar from "components/Drawer/MiniSideBar"; -import { useAdvertiser } from "auth/hooks/queries/useAdvertiser"; -import { FilterContext } from "state/context"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { useAdvertiserCampaignsQuery } from "@/graphql/advertiser.generated"; +import { CampaignAgeFilter } from "@/components/Campaigns/CampaignAgeFilter"; +import { CampaignList } from "@/user/campaignList/CampaignList"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { CardContainer } from "@/components/Card/CardContainer"; +import MiniSideBar from "@/components/Drawer/MiniSideBar"; +import { useAdvertiser } from "@/auth/hooks/queries/useAdvertiser"; +import { FilterContext } from "@/state/context"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; import { Trans, msg } from "@lingui/macro"; export function CampaignView() { diff --git a/src/user/views/user/Profile.tsx b/src/user/views/user/Profile.tsx index d8726b69..e2fccd73 100644 --- a/src/user/views/user/Profile.tsx +++ b/src/user/views/user/Profile.tsx @@ -1,8 +1,8 @@ import { Container } from "@mui/material"; -import { UserForm } from "user/settings/UserForm"; -import { UserApiKey } from "user/settings/UserApiKey"; -import MiniSideBar from "components/Drawer/MiniSideBar"; -import { useTrackMatomoPageView } from "hooks/useTrackWithMatomo"; +import { UserForm } from "@/user/settings/UserForm"; +import { UserApiKey } from "@/user/settings/UserApiKey"; +import MiniSideBar from "@/components/Drawer/MiniSideBar"; +import { useTrackMatomoPageView } from "@/hooks/useTrackWithMatomo"; export function Profile() { useTrackMatomoPageView({ documentTitle: "Advertiser Profile" }); diff --git a/src/user/views/user/reports/ConsultAccountManager.tsx b/src/user/views/user/reports/ConsultAccountManager.tsx index aba6a81b..260335a1 100644 --- a/src/user/views/user/reports/ConsultAccountManager.tsx +++ b/src/user/views/user/reports/ConsultAccountManager.tsx @@ -1,6 +1,6 @@ import { Alert } from "@mui/material"; import { Trans } from "@lingui/macro"; -import { DashboardButton } from "components/Button/DashboardButton"; +import { DashboardButton } from "@/components/Button/DashboardButton"; export function ConsultAccountManager() { return ( diff --git a/src/user/views/user/reports/OriginalCampaignReportView.tsx b/src/user/views/user/reports/OriginalCampaignReportView.tsx index ef19e5b9..3a9919c6 100644 --- a/src/user/views/user/reports/OriginalCampaignReportView.tsx +++ b/src/user/views/user/reports/OriginalCampaignReportView.tsx @@ -1,14 +1,14 @@ import { useState } from "react"; -import { useAnalyticOverviewQuery } from "graphql/analytics-overview.generated"; +import { useAnalyticOverviewQuery } from "@/graphql/analytics-overview.generated"; import { Box } from "@mui/material"; -import ReportUtils from "user/analytics/analyticsOverview/components/ReportUtils"; -import { EngagementsOverview } from "user/analytics/analyticsOverview/reports/campaign/EngagementsOverview"; -import { CampaignDetails } from "user/views/user/CampaignDetails"; -import { CollapseBox } from "components/Collapse/CollapseBox"; -import { OsOverview } from "user/analytics/analyticsOverview/reports/os/OsOverview"; +import ReportUtils from "@/user/analytics/analyticsOverview/components/ReportUtils"; +import { EngagementsOverview } from "@/user/analytics/analyticsOverview/reports/campaign/EngagementsOverview"; +import { CampaignDetails } from "@/user/views/user/CampaignDetails"; +import { CollapseBox } from "@/components/Collapse/CollapseBox"; +import { OsOverview } from "@/user/analytics/analyticsOverview/reports/os/OsOverview"; import { useLingui } from "@lingui/react"; import { msg } from "@lingui/macro"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; import dayjs, { Dayjs } from "dayjs"; interface Props { diff --git a/src/user/views/user/reports/SearchCampaignReportView.tsx b/src/user/views/user/reports/SearchCampaignReportView.tsx index b8bc2a8b..023fa87c 100644 --- a/src/user/views/user/reports/SearchCampaignReportView.tsx +++ b/src/user/views/user/reports/SearchCampaignReportView.tsx @@ -1,19 +1,19 @@ import { Trans, msg } from "@lingui/macro"; import { Box, Stack, Typography } from "@mui/material"; -import { DashboardButton } from "components/Button/DashboardButton"; -import { Status } from "components/Campaigns/Status"; -import { CardContainer } from "components/Card/CardContainer"; -import { DateRangePicker } from "components/Date/DateRangePicker"; -import { ErrorDetail } from "components/Error/ErrorDetail"; -import { useFetchDailyMetricsForCampaignQuery } from "graphql/analytics-overview.generated"; -import { CampaignSummaryFragment } from "graphql/campaign.generated"; -import { PerformanceFilter } from "graphql/types"; +import { DashboardButton } from "@/components/Button/DashboardButton"; +import { Status } from "@/components/Campaigns/Status"; +import { CardContainer } from "@/components/Card/CardContainer"; +import { DateRangePicker } from "@/components/Date/DateRangePicker"; +import { ErrorDetail } from "@/components/Error/ErrorDetail"; +import { useFetchDailyMetricsForCampaignQuery } from "@/graphql/analytics-overview.generated"; +import { CampaignSummaryFragment } from "@/graphql/campaign.generated"; +import { PerformanceFilter } from "@/graphql/types"; import { useState } from "react"; -import { AdSetBreakdown } from "user/analytics/search/AdSetBreakdown"; -import { MetricsList } from "user/analytics/search/MetricsList"; -import { OverTimeGraph } from "user/analytics/search/OverTimeGraph"; -import { useMetricSelection } from "user/analytics/search/hooks"; -import { ReportMenu } from "user/reporting/ReportMenu"; +import { AdSetBreakdown } from "@/user/analytics/search/AdSetBreakdown"; +import { MetricsList } from "@/user/analytics/search/MetricsList"; +import { OverTimeGraph } from "@/user/analytics/search/OverTimeGraph"; +import { useMetricSelection } from "@/user/analytics/search/hooks"; +import { ReportMenu } from "@/user/reporting/ReportMenu"; import dayjs from "dayjs"; interface Props { diff --git a/src/util/campaign.ts b/src/util/campaign.ts index f74ec601..78225749 100644 --- a/src/util/campaign.ts +++ b/src/util/campaign.ts @@ -1,4 +1,4 @@ -import { CampaignFormat } from "graphql/types"; +import { CampaignFormat } from "@/graphql/types"; import { t } from "@lingui/macro"; export function uiLabelsForCampaignFormat(format: CampaignFormat): string { diff --git a/src/util/displayState.ts b/src/util/displayState.ts index 66ad135a..61f39204 100644 --- a/src/util/displayState.ts +++ b/src/util/displayState.ts @@ -1,4 +1,4 @@ -import { isDateInThePast, isDateInTheFuture } from "util/isAfterEndDate"; +import { isDateInThePast, isDateInTheFuture } from "@/util/isAfterEndDate"; export const displayFromCampaignState = (c: { campaignState: string; diff --git a/src/validation/CampaignSchema.test.ts b/src/validation/CampaignSchema.test.ts index d73cc97d..0adc2712 100644 --- a/src/validation/CampaignSchema.test.ts +++ b/src/validation/CampaignSchema.test.ts @@ -1,8 +1,8 @@ import { produce } from "immer"; -import { CampaignFormat, CampaignPacingStrategies } from "graphql/types"; +import { CampaignFormat, CampaignPacingStrategies } from "@/graphql/types"; import { CampaignSchema } from "./CampaignSchema"; import { describe } from "vitest"; -import { AdvertiserPrice } from "user/hooks/useAdvertiserWithPrices"; +import { AdvertiserPrice } from "@/user/hooks/useAdvertiserWithPrices"; import dayjs from "dayjs"; const prices: AdvertiserPrice[] = [ diff --git a/src/validation/CampaignSchema.tsx b/src/validation/CampaignSchema.tsx index 29e1d283..1367823f 100644 --- a/src/validation/CampaignSchema.tsx +++ b/src/validation/CampaignSchema.tsx @@ -9,19 +9,19 @@ import { string, StringSchema, } from "yup"; -import { twoDaysOut } from "form/DateFieldHelpers"; +import { twoDaysOut } from "@/form/DateFieldHelpers"; import { HttpsRegex, NoSpacesRegex, SimpleUrlRegexp, TrailingAsteriskRegex, -} from "validation/regex"; -import { CreativeSchema } from "validation/CreativeSchema"; -import { CampaignFormat } from "graphql/types"; +} from "@/validation/regex"; +import { CreativeSchema } from "@/validation/CreativeSchema"; +import { CampaignFormat } from "@/graphql/types"; import BigNumber from "bignumber.js"; -import { AdvertiserPrice } from "user/hooks/useAdvertiserWithPrices"; -import { Billing } from "user/views/adsManager/types"; -import { uiLabelsForCampaignFormat } from "util/campaign"; +import { AdvertiserPrice } from "@/user/hooks/useAdvertiserWithPrices"; +import { Billing } from "@/user/views/adsManager/types"; +import { uiLabelsForCampaignFormat } from "@/util/campaign"; import { t } from "@lingui/macro"; import dayjs from "dayjs"; diff --git a/src/validation/CreativeSchema.tsx b/src/validation/CreativeSchema.tsx index 3d117bbb..28159e12 100644 --- a/src/validation/CreativeSchema.tsx +++ b/src/validation/CreativeSchema.tsx @@ -4,7 +4,7 @@ import { NoSpacesRegex, PrivateCdnRegex, SimpleUrlRegexp, -} from "validation/regex"; +} from "@/validation/regex"; import _ from "lodash"; import * as Yup from "yup"; import { t } from "@lingui/macro"; diff --git a/src/validation/RegistrationSchema.test.ts b/src/validation/RegistrationSchema.test.ts index 1f6e6c23..67d0a595 100644 --- a/src/validation/RegistrationSchema.test.ts +++ b/src/validation/RegistrationSchema.test.ts @@ -1,6 +1,6 @@ import { produce } from "immer"; -import { RegistrationForm } from "auth/registration/types"; -import { RegistrationSchema } from "validation/RegistrationSchema"; +import { RegistrationForm } from "@/auth/registration/types"; +import { RegistrationSchema } from "@/validation/RegistrationSchema"; const validRegistration: RegistrationForm = { advertiser: { diff --git a/src/validation/RegistrationSchema.tsx b/src/validation/RegistrationSchema.tsx index cf5ae57b..f044d30e 100644 --- a/src/validation/RegistrationSchema.tsx +++ b/src/validation/RegistrationSchema.tsx @@ -1,6 +1,6 @@ import { object, string } from "yup"; import { t } from "@lingui/macro"; -import { UserSchema } from "validation/UserSchema"; +import { UserSchema } from "@/validation/UserSchema"; const SimpleUrlRegexp = /https:\/\/.+\.[a-zA-Z]{2,}\/?.*/g; const NoSpacesRegex = /^\S*$/; diff --git a/tsconfig.json b/tsconfig.json index c3cd729f..2be0b2f1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ "lib": ["ESNext", "dom"], "isolatedModules": true, "types": ["vitest/globals"], - "baseUrl": "src" - }, - "include": ["src"] + "paths": { + "@/*": ["./src/*"] + } + } }