mirror of
https://github.com/makeplane/plane.git
synced 2026-06-13 19:19:54 +00:00
83fdebf64d
- Add jscodeshift-based codemod to convert arrow function components to function declarations - Support React.FC, observer-wrapped, and forwardRef components - Include comprehensive test suite covering edge cases - Add npm script to run transformer across codebase - Target only .tsx files in source directories, excluding node_modules and declaration files * [WEB-5459] chore: updates after running codemod --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
36 lines
1012 B
TypeScript
36 lines
1012 B
TypeScript
"use client";
|
|
|
|
import React from "react";
|
|
import { observer } from "mobx-react";
|
|
// hooks
|
|
import type { TInstanceAuthenticationMethodKeys } from "@plane/types";
|
|
import { ToggleSwitch } from "@plane/ui";
|
|
import { useInstance } from "@/hooks/store";
|
|
// ui
|
|
// types
|
|
|
|
type Props = {
|
|
disabled: boolean;
|
|
updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void;
|
|
};
|
|
|
|
export const EmailCodesConfiguration = observer(function EmailCodesConfiguration(props: Props) {
|
|
const { disabled, updateConfig } = props;
|
|
// store
|
|
const { formattedConfig } = useInstance();
|
|
// derived values
|
|
const enableMagicLogin = formattedConfig?.ENABLE_MAGIC_LINK_LOGIN ?? "";
|
|
|
|
return (
|
|
<ToggleSwitch
|
|
value={Boolean(parseInt(enableMagicLogin))}
|
|
onChange={() => {
|
|
const newEnableMagicLogin = Boolean(parseInt(enableMagicLogin)) === true ? "0" : "1";
|
|
updateConfig("ENABLE_MAGIC_LINK_LOGIN", newEnableMagicLogin);
|
|
}}
|
|
size="sm"
|
|
disabled={disabled}
|
|
/>
|
|
);
|
|
});
|