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