Skip to content

Commit

Permalink
chore: optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
IanKrieger committed Jul 18, 2023
1 parent e17d80f commit 5320bde
Show file tree
Hide file tree
Showing 39 changed files with 37 additions and 66 deletions.
1 change: 0 additions & 1 deletion src/auth/components/AdvertiserAgreed.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useState } from "react";
import Typography from "@mui/material/Typography";
import {
Box,
Card,
Checkbox,
Container,
Expand Down
3 changes: 1 addition & 2 deletions src/auth/hooks/mutations/useGetLink.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useCallback, useState } from "react";
import { useAuthContext } from "auth/context/auth.hook";
import { getCredentials, getLink } from "auth/lib";
import { getLink } from "auth/lib";

interface Options {
onError?: (msg: string) => void;
Expand Down
3 changes: 1 addition & 2 deletions src/auth/views/AuthVerify.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { AuthContainer } from "auth/views/components/AuthContainer";
import { useAuthorize } from "auth/hooks/queries/useAuthorize";
import React from "react";
import { useHistory } from "react-router-dom";
import { Link as RouterLink, useHistory } from "react-router-dom";
import { CircularProgress, Link, Stack, Typography } from "@mui/material";
import { Link as RouterLink } from "react-router-dom";
import VerifiedIcon from "@mui/icons-material/Verified";
import CancelOutlinedIcon from "@mui/icons-material/CancelOutlined";

Expand Down
2 changes: 1 addition & 1 deletion src/auth/views/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Alert, Link, TextField, Typography } from "@mui/material";
import { LoadingButton } from "@mui/lab";
import React, { useState } from "react";
import { useHistory, Link as RouterLink } from "react-router-dom";
import { Link as RouterLink, useHistory } from "react-router-dom";
import { useSignIn } from "auth/hooks/mutations/useSignIn";
import { AuthContainer } from "auth/views/components/AuthContainer";

Expand Down
1 change: 0 additions & 1 deletion src/checkout/hooks/useValidatePaymentSession.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useEffect, useState } from "react";
import { buildAdServerEndpoint } from "util/environment";
import { fetchPaymentSession } from "checkout/lib";

interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Box/BoxContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PropsWithChildren } from "react";
import { Box, Container, Typography } from "@mui/material";
import { Box, Typography } from "@mui/material";

export function BoxContainer(
props: { header?: React.ReactNode } & PropsWithChildren,
Expand Down
2 changes: 0 additions & 2 deletions src/components/Collapse/CollapseBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import {
Accordion,
AccordionDetails,
AccordionSummary,
Alert,
AlertTitle,
Box,
Typography,
} from "@mui/material";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Country/CountryPicker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert, Autocomplete, TextField } from "@mui/material";
import { Autocomplete, TextField } from "@mui/material";
import { useField } from "formik";
import React from "react";
import { useCountries } from "components/Country/useCountries";
Expand Down
2 changes: 0 additions & 2 deletions src/components/EnhancedTable/renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import {
} from "graphql/campaign.generated";
import { AdvertiserCampaignsDocument } from "graphql/advertiser.generated";
import {
AdSetFragment,
useUpdateAdMutation,
useUpdateAdSetMutation,
} from "graphql/ad-set.generated";
import { OnOff } from "../Switch/OnOff";
import { CampaignSource } from "graphql/types";
import { AdDetails } from "user/ads/AdList";
import { displayFromCampaignState } from "util/displayState";
import { AdSetDetails } from "user/adSet/AdSetList";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Error/ErrorDetail.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ApolloError, ServerError, ServerParseError } from "@apollo/client";
import { ApolloError } from "@apollo/client";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import {
Accordion,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Steps/NextAndBack.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Stack, stepClasses } from "@mui/material";
import { Button, Stack } from "@mui/material";
import React from "react";

interface Props {
Expand Down
7 changes: 2 additions & 5 deletions src/components/Steps/StepDrawer.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import React, { PropsWithChildren, useRef, useState } from "react";
import React, { PropsWithChildren, useRef } from "react";
import {
Box,
Button,
CssBaseline,
Drawer,
ListItemButton,
Stack,
Step,
StepButton,
StepContent,
Stepper,
Toolbar,
Typography,
} from "@mui/material";
import { NextAndBack } from "components/Steps/NextAndBack";
import { Link as RouterLink, useHistory } from "react-router-dom";
import { useHistory } from "react-router-dom";
import { ActionButtons } from "components/Steps/ActionButtons";

const drawerWidth = 250;
Expand Down
10 changes: 1 addition & 9 deletions src/components/Steps/StepsButton.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import {
Box,
Button,
Stack,
Step,
StepLabel,
Stepper,
Typography,
} from "@mui/material";
import { Box, Step, StepLabel, Stepper } from "@mui/material";
import React, { useState } from "react";
import { NextAndBack } from "components/Steps/NextAndBack";

Expand Down
2 changes: 1 addition & 1 deletion src/components/Url/use-url-validation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
ValidateTargetUrlQuery,
useValidateTargetUrlLazyQuery,
ValidateTargetUrlQuery,
} from "graphql/url.generated";
import _ from "lodash";
import { useEffect, useMemo, useState } from "react";
Expand Down
1 change: 0 additions & 1 deletion src/form/FormikHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import React, {
useEffect,
} from "react";
import {
Button,
FormControl,
FormControlLabel,
FormHelperText,
Expand Down
3 changes: 2 additions & 1 deletion src/graphql/ad-set.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/graphql/advertiser.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/graphql/analytics-overview.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/graphql/campaign.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/graphql/common.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/graphql/creative.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/graphql/url.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/graphql/user.generated.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/user/adSet/AdSetList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ColumnDescriptor, StandardRenderers } from "components/EnhancedTable";
import { Chip } from "@mui/material";
import { Status } from "components/Campaigns/Status";
import _ from "lodash";
import { isAfterEndDate } from "util/isAfterEndDate";
import { adSetOnOffState } from "components/EnhancedTable/renderers";
import { CampaignAdsFragment } from "graphql/campaign.generated";
import { CampaignSource } from "graphql/types";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { Box, Button, Stack, Tab, Tabs, Typography } from "@mui/material";
import { EngagementChartType } from "../types";
import { Box, Button, Stack, Typography } from "@mui/material";
import { Status } from "components/Campaigns/Status";
import { CampaignSummaryFragment } from "graphql/campaign.generated";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Box, Chip, Stack, Typography } from "@mui/material";
import { Box, Chip, Typography } from "@mui/material";
import { OverviewDetail, StatsMetric } from "../types";

interface OverviewProps extends OverviewDetail {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MetricSelect from "user/analytics/analyticsOverview/components/MetricSelect";
import React, { useState } from "react";
import React from "react";
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";
Expand Down
5 changes: 1 addition & 4 deletions src/user/analytics/analyticsOverview/lib/overview.library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import {
StatsMetric,
Tooltip,
} from "user/analytics/analyticsOverview/types";
import {
CampaignWithEngagementsFragment,
EngagementFragment,
} from "graphql/analytics-overview.generated";
import { EngagementFragment } from "graphql/analytics-overview.generated";

type MetricDataSet = {
metric1DataSet: number[][];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import EngagementHeader from "../../components/EngagementHeader";
import LiveFeed from "../../components/LiveFeed";
import { CampaignFormat } from "graphql/types";
import { ErrorDetail } from "components/Error/ErrorDetail";
import { DashboardButton } from "components/Button/DashboardButton";
import { ApolloError } from "@apollo/client";
import _ from "lodash";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
import { Box, Stack } from "@mui/material";
import React from "react";
import {
CampaignWithEngagementsFragment,
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";
import { CampaignFragment } from "graphql/campaign.generated";
import { CampaignFormat } from "graphql/types";
import { CardContainer } from "components/Card/CardContainer";

interface Props {
engagements: EngagementFragment[];
Expand Down
2 changes: 1 addition & 1 deletion src/user/hooks/useAdvertiserCreatives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useAdvertiserCreativesQuery } from "graphql/creative.generated";
import { useAdvertiser } from "auth/hooks/queries/useAdvertiser";
import { useFormikContext } from "formik";
import { CampaignForm, Creative } from "user/views/adsManager/types";
import _, { flatMap } from "lodash";
import _ from "lodash";

export function useAdvertiserCreatives(): Creative[] {
const { advertiser } = useAdvertiser();
Expand Down
2 changes: 1 addition & 1 deletion src/user/library/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CampaignFragment } from "graphql/campaign.generated";
import { it, describe, expect } from "vitest";
import { describe, expect, it } from "vitest";
import { editCampaignValues, transformCreative } from ".";
import {
CampaignFormat,
Expand Down
1 change: 0 additions & 1 deletion src/user/settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
Box,
Button,
Container,
Divider,
FormControl,
InputLabel,
MenuItem,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CardContainer } from "components/Card/CardContainer";
import { Autocomplete, Checkbox, TextField } from "@mui/material";
import React, { useEffect } from "react";
import React from "react";
import { useRecentlyCreatedAdvertiserCreatives } from "user/hooks/useAdvertiserCreatives";
import CheckBoxOutlineBlankIcon from "@mui/icons-material/CheckBoxOutlineBlank";
import CheckBoxIcon from "@mui/icons-material/CheckBox";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Divider, Link, Stack, Typography } from "@mui/material";
import { Link, Stack, Typography } from "@mui/material";
import { ConversionFields } from "components/Conversion/ConversionFields";
import React from "react";
import { FieldArray, useField } from "formik";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Divider, Typography } from "@mui/material";
import { Typography } from "@mui/material";
import { SegmentPicker } from "components/Segment/SegmentPicker";
import { PlatformPicker } from "components/Platform/PlatformPicker";
import React from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Divider, Typography } from "@mui/material";
import { Typography } from "@mui/material";
import { LocationPicker } from "components/Location/LocationPicker";
import React from "react";
import { CardContainer } from "components/Card/CardContainer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Form } from "formik";
import { Review } from "../../review/Review";
import React from "react";
import { CampaignSettings } from "user/views/adsManager/views/advanced/components/campaign/CampaignSettings";
import { BudgetField } from "user/views/adsManager/views/advanced/components/campaign/fields/BudgetField";
import { StepDrawer } from "components/Steps/StepDrawer";
import { PaymentButton } from "user/views/adsManager/views/advanced/components/form/components/PaymentButton";
import { NewAd } from "user/ads/NewAd";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { FormikSubmitButton } from "form/FormikHelpers";
import React from "react";
import { useFormikContext } from "formik";
import { CampaignForm } from "user/views/adsManager/types";
import { PaymentType } from "graphql/types";

export function PaymentButton(props: { isEdit: boolean }) {
const { values } = useFormikContext<CampaignForm>();
Expand Down

0 comments on commit 5320bde

Please sign in to comment.