Skip to content

Commit 1a94b3a

Browse files
committed
Simplify FC defs
1 parent 76f66ca commit 1a94b3a

File tree

32 files changed

+69
-68
lines changed

32 files changed

+69
-68
lines changed

site/src/AppRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const TerminalPage = lazy(() => import("./pages/TerminalPage/TerminalPage"))
2626
const WorkspacesPage = lazy(() => import("./pages/WorkspacesPage/WorkspacesPage"))
2727
const CreateWorkspacePage = lazy(() => import("./pages/CreateWorkspacePage/CreateWorkspacePage"))
2828

29-
export const AppRouter: FC<React.PropsWithChildren<unknown>> = () => (
29+
export const AppRouter: FC = () => (
3030
<Suspense fallback={<></>}>
3131
<Routes>
3232
<Route

site/src/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { dark } from "./theme"
1111
import "./theme/globalFonts"
1212
import { XServiceProvider } from "./xServices/StateContext"
1313

14-
export const App: FC<React.PropsWithChildren<unknown>> = () => {
14+
export const App: FC = () => {
1515
return (
1616
<Router>
1717
<SWRConfig

site/src/components/DropdownArrows/DropdownArrows.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ const useStyles = makeStyles((theme: Theme) => ({
1515
},
1616
}))
1717

18-
export const OpenDropdown: FC<React.PropsWithChildren<unknown>> = () => {
18+
export const OpenDropdown: FC = () => {
1919
const styles = useStyles()
2020
return <KeyboardArrowDown className={styles.arrowIcon} />
2121
}
2222

23-
export const CloseDropdown: FC<React.PropsWithChildren<unknown>> = () => {
23+
export const CloseDropdown: FC = () => {
2424
const styles = useStyles()
2525
return <KeyboardArrowUp className={`${styles.arrowIcon} ${styles.arrowIconUp}`} />
2626
}

site/src/components/GlobalSnackbar/GlobalSnackbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const variantFromMsgType = (type: MsgType) => {
2525
}
2626
}
2727

28-
export const GlobalSnackbar: React.FC<React.PropsWithChildren<unknown>> = () => {
28+
export const GlobalSnackbar: React.FC = () => {
2929
const styles = useStyles()
3030
const [open, setOpen] = useState<boolean>(false)
3131
const [notification, setNotification] = useState<NotificationMsg>()

site/src/components/Loader/FullScreenLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const useStyles = makeStyles((theme) => ({
1616
},
1717
}))
1818

19-
export const FullScreenLoader: FC<React.PropsWithChildren<unknown>> = () => {
19+
export const FullScreenLoader: FC = () => {
2020
const styles = useStyles()
2121

2222
return (

site/src/components/Navbar/Navbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useContext } from "react"
33
import { XServiceContext } from "../../xServices/StateContext"
44
import { NavbarView } from "../NavbarView/NavbarView"
55

6-
export const Navbar: React.FC<React.PropsWithChildren<unknown>> = () => {
6+
export const Navbar: React.FC = () => {
77
const xServices = useContext(XServiceContext)
88
const [authState, authSend] = useActor(xServices.authXService)
99
const { me } = authState.context

site/src/components/SettingsLayout/SettingsLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const menuItems = [
2020
{ label: Language.sshKeysLabel, path: "/settings/ssh-keys" },
2121
]
2222

23-
export const SettingsLayout: FC<React.PropsWithChildren<unknown>> = () => {
23+
export const SettingsLayout: FC = () => {
2424
return (
2525
<AuthAndFrame>
2626
<Box display="flex" flexDirection="column">

site/src/components/SettingsSecurityForm/SettingsSecurityForm.tsx

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,42 +68,40 @@ export const SecurityForm: React.FC<React.PropsWithChildren<SecurityFormProps>>
6868
<>
6969
<form onSubmit={form.handleSubmit}>
7070
<Stack>
71-
<>
72-
{updateSecurityError && <ErrorSummary error={updateSecurityError} />}
73-
<TextField
74-
{...getFieldHelpers("old_password")}
75-
onChange={onChangeTrimmed(form)}
76-
autoComplete="old_password"
77-
fullWidth
78-
label={Language.oldPasswordLabel}
79-
variant="outlined"
80-
type="password"
81-
/>
82-
<TextField
83-
{...getFieldHelpers("password")}
84-
onChange={onChangeTrimmed(form)}
85-
autoComplete="password"
86-
fullWidth
87-
label={Language.newPasswordLabel}
88-
variant="outlined"
89-
type="password"
90-
/>
91-
<TextField
92-
{...getFieldHelpers("confirm_password")}
93-
onChange={onChangeTrimmed(form)}
94-
autoComplete="confirm_password"
95-
fullWidth
96-
label={Language.confirmPasswordLabel}
97-
variant="outlined"
98-
type="password"
99-
/>
71+
{updateSecurityError ? <ErrorSummary error={updateSecurityError} /> : <></>}
72+
<TextField
73+
{...getFieldHelpers("old_password")}
74+
onChange={onChangeTrimmed(form)}
75+
autoComplete="old_password"
76+
fullWidth
77+
label={Language.oldPasswordLabel}
78+
variant="outlined"
79+
type="password"
80+
/>
81+
<TextField
82+
{...getFieldHelpers("password")}
83+
onChange={onChangeTrimmed(form)}
84+
autoComplete="password"
85+
fullWidth
86+
label={Language.newPasswordLabel}
87+
variant="outlined"
88+
type="password"
89+
/>
90+
<TextField
91+
{...getFieldHelpers("confirm_password")}
92+
onChange={onChangeTrimmed(form)}
93+
autoComplete="confirm_password"
94+
fullWidth
95+
label={Language.confirmPasswordLabel}
96+
variant="outlined"
97+
type="password"
98+
/>
10099

101-
<div>
102-
<LoadingButton loading={isLoading} type="submit" variant="contained">
103-
{isLoading ? "" : Language.updatePassword}
104-
</LoadingButton>
105-
</div>
106-
</>
100+
<div>
101+
<LoadingButton loading={isLoading} type="submit" variant="contained">
102+
{isLoading ? "" : Language.updatePassword}
103+
</LoadingButton>
104+
</div>
107105
</Stack>
108106
</form>
109107
</>

site/src/components/SplitButton/SplitButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const SplitButton = <T,>({
4949
options,
5050
startIcon,
5151
textTransform,
52-
}: SplitButtonProps<T>): ReturnType<React.FC<React.PropsWithChildren<unknown>>> => {
52+
}: SplitButtonProps<T>): ReturnType<React.FC> => {
5353
const [isPopperOpen, setIsPopperOpen] = useState<boolean>(false)
5454

5555
const anchorRef = useRef<HTMLDivElement>(null)

site/src/components/TableLoader/TableLoader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import TableRow from "@material-ui/core/TableRow"
44
import { FC } from "react"
55
import { Loader } from "../Loader/Loader"
66

7-
export const TableLoader: FC<React.PropsWithChildren<unknown>> = () => {
7+
export const TableLoader: FC = () => {
88
const styles = useStyles()
99

1010
return (

site/src/components/Tooltips/AgentHelpTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const Language = {
66
"The Coder agent runs inside your resource and gives you direct access to the shell via the UI or CLI.",
77
}
88

9-
export const AgentHelpTooltip: React.FC<React.PropsWithChildren<unknown>> = () => {
9+
export const AgentHelpTooltip: React.FC = () => {
1010
return (
1111
<HelpTooltip size="small">
1212
<HelpTooltipTitle>{Language.agentTooltipTitle}</HelpTooltipTitle>

site/src/components/Tooltips/ResourcesHelpTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Language = {
1313
resourceTooltipLink: "Persistent and ephemeral resources",
1414
}
1515

16-
export const ResourcesHelpTooltip: React.FC<React.PropsWithChildren<unknown>> = () => {
16+
export const ResourcesHelpTooltip: React.FC = () => {
1717
return (
1818
<HelpTooltip size="small">
1919
<HelpTooltipTitle>{Language.resourceTooltipTitle}</HelpTooltipTitle>

site/src/components/Tooltips/WorkspaceHelpTooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Language = {
1616
workspaceTooltipLink3: "Editors and IDEs",
1717
}
1818

19-
export const WorkspaceHelpTooltip: FC<React.PropsWithChildren<unknown>> = () => {
19+
export const WorkspaceHelpTooltip: FC = () => {
2020
return (
2121
<HelpTooltip>
2222
<HelpTooltipTitle>{Language.workspaceTooltipTitle}</HelpTooltipTitle>

site/src/components/Welcome/Welcome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Typography from "@material-ui/core/Typography"
33
import { FC } from "react"
44
import { CoderIcon } from "../Icons/CoderIcon"
55

6-
export const Welcome: FC<React.PropsWithChildren<unknown>> = () => {
6+
export const Welcome: FC = () => {
77
const styles = useStyles()
88

99
return (

site/src/components/WorkspaceStatusBadge/WorkspaceStatusBadge.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const StatusLanguage = {
2323
queued: "Queued",
2424
}
2525

26-
const LoadingIcon: React.FC<React.PropsWithChildren<unknown>> = () => {
26+
const LoadingIcon: React.FC = () => {
2727
return <CircularProgress size={10} style={{ color: "#FFF" }} />
2828
}
2929

@@ -124,7 +124,10 @@ export type WorkspaceStatusBadgeProps = {
124124
className?: string
125125
}
126126

127-
export const WorkspaceStatusBadge: React.FC<React.PropsWithChildren<WorkspaceStatusBadgeProps>> = ({ build, className }) => {
127+
export const WorkspaceStatusBadge: React.FC<React.PropsWithChildren<WorkspaceStatusBadgeProps>> = ({
128+
build,
129+
className,
130+
}) => {
128131
const styles = useStyles()
129132
const theme = useTheme()
130133
const { text, icon, ...colorStyles } = getStatus(theme, build)

site/src/pages/404Page/404Page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { makeStyles } from "@material-ui/core/styles"
22
import Typography from "@material-ui/core/Typography"
33
import { FC } from "react"
44

5-
export const NotFoundPage: FC<React.PropsWithChildren<unknown>> = () => {
5+
export const NotFoundPage: FC = () => {
66
const styles = useStyles()
77

88
return (

site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { pageTitle } from "../../util/page"
77
import { createWorkspaceMachine } from "../../xServices/createWorkspace/createWorkspaceXService"
88
import { CreateWorkspacePageView } from "./CreateWorkspacePageView"
99

10-
const CreateWorkspacePage: FC<React.PropsWithChildren<unknown>> = () => {
10+
const CreateWorkspacePage: FC = () => {
1111
const organizationId = useOrganizationId()
1212
const { template } = useParams()
1313
const templateName = template ? template : ""

site/src/pages/HealthzPage/HealthzPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ import { FC } from "react"
55
* for reporting whether or not the Dashboard is online. It should be
66
* accessible by humans and services.
77
*/
8-
export const HealthzPage: FC<React.PropsWithChildren<unknown>> = () => <div>ok</div>
8+
export const HealthzPage: FC = () => <div>ok</div>

site/src/pages/LoginPage/LoginPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface LocationState {
3232
isRedirect: boolean
3333
}
3434

35-
export const LoginPage: React.FC<React.PropsWithChildren<unknown>> = () => {
35+
export const LoginPage: React.FC = () => {
3636
const styles = useStyles()
3737
const location = useLocation()
3838
const xServices = useContext(XServiceContext)

site/src/pages/TemplatesPage/TemplatesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { XServiceContext } from "../../xServices/StateContext"
66
import { templatesMachine } from "../../xServices/templates/templatesXService"
77
import { TemplatesPageView } from "./TemplatesPageView"
88

9-
const TemplatesPage: React.FC<React.PropsWithChildren<unknown>> = () => {
9+
const TemplatesPage: React.FC = () => {
1010
const xServices = useContext(XServiceContext)
1111
const [authState] = useActor(xServices.authXService)
1212
const [templatesState] = useMachine(templatesMachine)

site/src/pages/TemplatesPage/TemplatesPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const Language = {
5757
createdByLabel: "Created by",
5858
}
5959

60-
const TemplateHelpTooltip: React.FC<React.PropsWithChildren<unknown>> = () => {
60+
const TemplateHelpTooltip: React.FC = () => {
6161
return (
6262
<HelpTooltip>
6363
<HelpTooltipTitle>{Language.templateTooltipTitle}</HelpTooltipTitle>

site/src/pages/UserSettingsPage/AccountPage/AccountPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const Language = {
88
title: "Account",
99
}
1010

11-
export const AccountPage: React.FC<React.PropsWithChildren<unknown>> = () => {
11+
export const AccountPage: React.FC = () => {
1212
const xServices = useContext(XServiceContext)
1313
const [authState, authSend] = useActor(xServices.authXService)
1414
const { me, updateProfileError } = authState.context

site/src/pages/UserSettingsPage/SecurityPage/SecurityPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const Language = {
88
title: "Security",
99
}
1010

11-
export const SecurityPage: React.FC<React.PropsWithChildren<unknown>> = () => {
11+
export const SecurityPage: React.FC = () => {
1212
const xServices = useContext(XServiceContext)
1313
const [authState, authSend] = useActor(xServices.authXService)
1414
const { me, updateSecurityError } = authState.context

site/src/pages/UsersPage/CreateUserPage/CreateUserPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const Language = {
1313
unknownError: "Oops, an unknown error occurred.",
1414
}
1515

16-
export const CreateUserPage: React.FC<React.PropsWithChildren<unknown>> = () => {
16+
export const CreateUserPage: React.FC = () => {
1717
const xServices = useContext(XServiceContext)
1818
const myOrgId = useSelector(xServices.authXService, selectOrgId)
1919
const [usersState, usersSend] = useActor(xServices.usersXService)

site/src/pages/UsersPage/UsersPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const Language = {
1919
activateDialogMessagePrefix: "Do you want to activate the user",
2020
}
2121

22-
export const UsersPage: React.FC<React.PropsWithChildren<unknown>> = () => {
22+
export const UsersPage: React.FC = () => {
2323
const xServices = useContext(XServiceContext)
2424
const [usersState, usersSend] = useActor(xServices.usersXService)
2525
const {

site/src/pages/WorkspaceAppErrorPage/WorkspaceAppErrorPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { FC, useMemo } from "react"
22
import { useParams } from "react-router-dom"
33
import { WorkspaceAppErrorPageView } from "./WorkspaceAppErrorPageView"
44

5-
const WorkspaceAppErrorView: FC<React.PropsWithChildren<unknown>> = () => {
5+
const WorkspaceAppErrorView: FC = () => {
66
const { app } = useParams()
77
const message = useMemo(() => {
88
const tag = document.getElementById("api-response")

site/src/pages/WorkspaceBuildPage/WorkspaceBuildPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { pageTitle } from "../../util/page"
66
import { workspaceBuildMachine } from "../../xServices/workspaceBuild/workspaceBuildXService"
77
import { WorkspaceBuildPageView } from "./WorkspaceBuildPageView"
88

9-
export const WorkspaceBuildPage: FC<React.PropsWithChildren<unknown>> = () => {
9+
export const WorkspaceBuildPage: FC = () => {
1010
const { username, workspace: workspaceName, buildNumber } = useParams()
1111
const [buildState] = useMachine(workspaceBuildMachine, {
1212
context: { username, workspaceName, buildNumber, timeCursor: new Date() },

site/src/pages/WorkspaceBuildPage/WorkspaceBuildPageView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface WorkspaceBuildPageViewProps {
1818
build: WorkspaceBuild | undefined
1919
}
2020

21-
export const WorkspaceBuildPageView: FC<React.PropsWithChildren<WorkspaceBuildPageViewProps>> = ({ logs, build }) => {
21+
export const WorkspaceBuildPageView: FC<WorkspaceBuildPageViewProps> = ({ logs, build }) => {
2222
return (
2323
<Margins>
2424
<PageHeader>

site/src/pages/WorkspacePage/WorkspacePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { workspaceScheduleBannerMachine } from "../../xServices/workspaceSchedul
1818

1919
dayjs.extend(minMax)
2020

21-
export const WorkspacePage: React.FC<React.PropsWithChildren<unknown>> = () => {
21+
export const WorkspacePage: React.FC = () => {
2222
const { username: usernameQueryParam, workspace: workspaceQueryParam } = useParams()
2323
const username = firstOrItem(usernameQueryParam, null)
2424
const workspaceName = firstOrItem(workspaceQueryParam, null)

site/src/pages/WorkspaceSchedulePage/WorkspaceSchedulePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export const workspaceToInitialValues = (
144144
}
145145
}
146146

147-
export const WorkspaceSchedulePage: React.FC<React.PropsWithChildren<unknown>> = () => {
147+
export const WorkspaceSchedulePage: React.FC = () => {
148148
const { username: usernameQueryParam, workspace: workspaceQueryParam } = useParams()
149149
const navigate = useNavigate()
150150
const username = firstOrItem(usernameQueryParam, null)

site/src/pages/WorkspacesPage/WorkspacesPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { pageTitle } from "util/page"
77
import { workspacesMachine } from "xServices/workspaces/workspacesXService"
88
import { WorkspacesPageView } from "./WorkspacesPageView"
99

10-
const WorkspacesPage: FC<React.PropsWithChildren<unknown>> = () => {
10+
const WorkspacesPage: FC = () => {
1111
const [workspacesState, send] = useMachine(workspacesMachine)
1212
const [searchParams, setSearchParams] = useSearchParams()
1313
const { workspaceRefs } = workspacesState.context

site/src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FC } from "react"
22
import { Navigate } from "react-router-dom"
33

4-
export const IndexPage: FC<React.PropsWithChildren<unknown>> = () => {
4+
export const IndexPage: FC = () => {
55
return <Navigate to="/workspaces" replace />
66
}

0 commit comments

Comments
 (0)