Skip to content

Commit 753ea09

Browse files
committed
imports: rename helpers to utils
1 parent b2ab47c commit 753ea09

21 files changed

+40
-44
lines changed

src/api/baseQuery.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Cookies from "js-cookie"
99
import qs from "qs"
1010

1111
import { API_BASE_URL, PORTAL_BASE_URL, SERVICE_NAME } from "../env"
12-
import { camelCaseToSnakeCase, snakeCaseToCamelCase } from "../helpers/general"
12+
import { camelCaseToSnakeCase, snakeCaseToCamelCase } from "../utils/general"
1313

1414
export type FetchBaseQuery = BaseQueryFn<
1515
FetchArgs,

src/api/models.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { CountryIsoCodes, UkCounties } from "../helpers/general"
2-
import type { Model } from "../helpers/rtkQuery"
1+
import type { CountryIsoCodes, UkCounties } from "../utils/general"
2+
import type { Model } from "../utils/rtkQuery"
33

44
export type User = Model<
55
number,

src/components/App.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Provider, type ProviderProps } from "react-redux"
55
import { type Action } from "redux"
66

77
import { InactiveDialog, ScreenTimeDialog } from "../features"
8+
import { useCountdown, useEventListener } from "../hooks"
9+
import "../scripts"
810
import {
911
// configureFreshworksWidget,
1012
toggleOneTrustInfoDisplay,
11-
} from "../helpers/window"
12-
import { useCountdown, useEventListener } from "../hooks"
13-
import "../scripts"
13+
} from "../utils/window"
1414

1515
export interface AppProps<A extends Action = Action, S = unknown> {
1616
theme: ThemeProviderProps["theme"]

src/components/ClickableTooltip.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from "react"
21
import { Tooltip, type TooltipProps } from "@mui/material"
2+
import React from "react"
33

4-
import { wrap } from "../helpers"
4+
import { wrap } from "../utils"
55

66
export interface ClickableTooltipProps extends TooltipProps {}
77

src/components/CopyIconButton.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { screen } from "@testing-library/react"
22

3-
import { renderWithUser } from "../helpers/test"
3+
import { renderWithUser } from "../utils/test"
44
import CopyIconButton from "./CopyIconButton"
55

66
test("Clicking button should copy content", async () => {

src/components/Image.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type React from "react"
21
import { Box, type BoxProps } from "@mui/material"
2+
import type React from "react"
33

4-
import { openInNewTab } from "../helpers"
4+
import { openInNewTab } from "../utils"
55

66
export interface ImageProps extends Omit<BoxProps, "component"> {
77
alt: string

src/components/form/AutocompleteField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import React from "react"
1313
import { flushSync } from "react-dom"
1414
import { string as YupString, ValidationError as YupValidationError } from "yup"
1515

16-
import { wrap } from "../../helpers"
16+
import { wrap } from "../../utils"
1717
import ClickableTooltip from "../ClickableTooltip"
1818

1919
export interface AutocompleteFieldProps<

src/components/form/CheckboxField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
import React from "react"
1616
import { BooleanSchema, ValidationError, bool as YupBool } from "yup"
1717

18-
import { wrap } from "../../helpers"
1918
import { form as formTypography } from "../../theme/typography"
19+
import { wrap } from "../../utils"
2020
import ClickableTooltip from "../ClickableTooltip"
2121

2222
export interface CheckboxFieldProps

src/components/form/DateField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
import { Field, type FieldConfig, type FieldProps } from "formik"
1111
import React from "react"
1212

13-
import { MIN_DATE } from "../../helpers/general"
1413
import { form as formTypography } from "../../theme/typography"
14+
import { MIN_DATE } from "../../utils/general"
1515

1616
const monthOptions = [
1717
"January",

src/components/form/TextField.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
type StringSchema,
2222
} from "yup"
2323

24-
import { wrap } from "../../helpers"
24+
import { wrap } from "../../utils"
2525
import ClickableTooltip from "../ClickableTooltip"
2626

2727
type StringArraySchema = ArraySchema<

src/components/page/TabBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import React from "react"
1313
import { generatePath, useNavigate, useParams } from "react-router-dom"
1414
import { object as YupObject, string as YupString } from "yup"
1515

16-
import { tryValidateSync } from "../../helpers/yup"
1716
import { primary } from "../../theme/colors"
17+
import { tryValidateSync } from "../../utils/yup"
1818
import Section from "./Section"
1919

2020
export interface TabBarProps {

src/theme/ThemedBox.tsx

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
import type React from "react"
1+
import {
2+
Circle as CircleIcon,
3+
Hexagon as HexagonIcon,
4+
} from "@mui/icons-material"
25
import {
36
Box,
4-
type BoxProps,
57
ThemeProvider,
6-
type SxProps,
78
buttonClasses,
8-
type PaletteColor,
9-
responsiveFontSizes,
109
createTheme,
11-
type ThemeOptions,
10+
responsiveFontSizes,
11+
type BoxProps,
1212
type CSSObject,
13+
type PaletteColor,
14+
type SxProps,
15+
type ThemeOptions,
1316
} from "@mui/material"
1417
import { type CommonProps } from "@mui/material/OverridableComponent"
15-
import {
16-
Circle as CircleIcon,
17-
Hexagon as HexagonIcon,
18-
} from "@mui/icons-material"
18+
import type React from "react"
1919

2020
import { themeOptions } from "."
21-
import palette from "./palette"
22-
import { getStyleOverrides, includesClassNames } from "../helpers"
23-
import type Components from "./components/_components"
21+
import { getStyleOverrides, includesClassNames } from "../utils"
2422
import { primary, secondary, tertiary } from "./colors"
23+
import type Components from "./components/_components"
24+
import palette from "./palette"
2525

2626
export interface ThemedBoxProps extends BoxProps {
2727
options?: ThemeOptions

src/theme/components/MuiButton.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { buttonClasses } from "@mui/material"
22

3-
import { includesClassNames } from "../../helpers"
3+
import { includesClassNames } from "../../utils"
44
import typography from "../typography"
55
import type Components from "./_components"
66

src/theme/components/MuiLink.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { includesClassNames } from "../../helpers"
1+
import { includesClassNames } from "../../utils"
22
import typography from "../typography"
33
import type Components from "./_components"
44

src/theme/components/MuiListItemText.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { listItemTextClasses } from "@mui/material"
22

3-
import { includesClassNames } from "../../helpers"
3+
import { includesClassNames } from "../../utils"
44
import type Components from "./_components"
55

66
const MuiListItemText: Components["MuiListItemText"] = {

src/theme/components/MuiMenuItem.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { includesClassNames } from "../../helpers"
1+
import { includesClassNames } from "../../utils"
22
import type Components from "./_components"
33

44
const MuiMenuItem: Components["MuiMenuItem"] = {

src/theme/components/MuiTable.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { tableCellClasses } from "@mui/material"
22

3-
import { includesClassNames } from "../../helpers"
3+
import { includesClassNames } from "../../utils"
44
import typography from "../typography"
55
import type Components from "./_components"
66

src/theme/components/MuiTableBody.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { includesClassNames } from "../../helpers"
1+
import { includesClassNames } from "../../utils"
22
import type Components from "./_components"
33

44
const MuiTableBody: Components["MuiTableBody"] = {

src/theme/components/MuiTableHead.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { typographyClasses } from "@mui/material"
22

3-
import { includesClassNames } from "../../helpers"
3+
import { includesClassNames } from "../../utils"
44
import type Components from "./_components"
55

66
const MuiTableHead: Components["MuiTableHead"] = {

src/theme/components/MuiTextField.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {
2-
inputClasses,
2+
formHelperTextClasses,
33
inputBaseClasses,
4+
inputClasses,
45
outlinedInputClasses,
5-
formHelperTextClasses,
66
} from "@mui/material"
77

88
import type Components from "./_components"
99

10-
import { includesClassNames } from "../../helpers"
10+
import { includesClassNames } from "../../utils"
1111

1212
const MuiTextField: Components["MuiTextField"] = {
1313
defaultProps: {

src/theme/components/_components.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import {
88
import { type CommonProps } from "@mui/material/OverridableComponent"
99
import { type OverridesStyleRules } from "@mui/material/styles/overrides"
1010

11-
import {
12-
getClassNames,
13-
includesClassNames,
14-
matchClassNames,
15-
} from "../../helpers"
11+
import { getClassNames, includesClassNames, matchClassNames } from "../../utils"
1612
import typography from "../typography"
1713

1814
export default interface Components

0 commit comments

Comments
 (0)