mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 09:26:47 +00:00
misc: removed usecallback
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
import { useCallback } from "react";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { faGithub, faGitlab, faGoogle } from "@fortawesome/free-brands-svg-icons";
|
import { faGithub, faGitlab, faGoogle } from "@fortawesome/free-brands-svg-icons";
|
||||||
@@ -18,11 +17,8 @@ export default function InitialSignupStep({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { config } = useServerConfig();
|
const { config } = useServerConfig();
|
||||||
|
|
||||||
const shouldDisplaySignupMethod = useCallback(
|
const shouldDisplaySignupMethod = (method: LoginMethod) =>
|
||||||
(method: LoginMethod) =>
|
!config.enabledLoginMethods || config.enabledLoginMethods.includes(method);
|
||||||
!config.enabledLoginMethods || config.enabledLoginMethods.includes(method),
|
|
||||||
[config]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx-auto flex w-full flex-col items-center justify-center">
|
<div className="mx-auto flex w-full flex-col items-center justify-center">
|
||||||
|
|||||||
@@ -62,11 +62,8 @@ export const InitialStep = ({ setStep, email, setEmail, password, setPassword }:
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const shouldDisplayLoginMethod = useCallback(
|
const shouldDisplayLoginMethod = (method: LoginMethod) =>
|
||||||
(method: LoginMethod) =>
|
!config.enabledLoginMethods || config.enabledLoginMethods.includes(method);
|
||||||
!config.enabledLoginMethods || config.enabledLoginMethods.includes(method),
|
|
||||||
[config]
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleLogin = async (e: FormEvent<HTMLFormElement>) => {
|
const handleLogin = async (e: FormEvent<HTMLFormElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { useCallback } from "react";
|
|
||||||
|
|
||||||
import { OrgPermissionActions, OrgPermissionSubjects, useServerConfig } from "@app/context";
|
import { OrgPermissionActions, OrgPermissionSubjects, useServerConfig } from "@app/context";
|
||||||
import { withPermission } from "@app/hoc";
|
import { withPermission } from "@app/hoc";
|
||||||
import { LoginMethod } from "@app/hooks/api/admin/types";
|
import { LoginMethod } from "@app/hooks/api/admin/types";
|
||||||
@@ -16,10 +14,8 @@ export const OrgAuthTab = withPermission(
|
|||||||
config: { enabledLoginMethods }
|
config: { enabledLoginMethods }
|
||||||
} = useServerConfig();
|
} = useServerConfig();
|
||||||
|
|
||||||
const shouldDisplaySection = useCallback(
|
const shouldDisplaySection = (method: LoginMethod) =>
|
||||||
(method: LoginMethod) => !enabledLoginMethods || enabledLoginMethods.includes(method),
|
!enabledLoginMethods || enabledLoginMethods.includes(method);
|
||||||
[enabledLoginMethods]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
|
<div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user