- added nped category options for alert popups
- minor fix on modal for 'DISABLED' MCC
This commit is contained in:
22
src/components/SettingForms/NPED/NPEDCatToggle.tsx
Normal file
22
src/components/SettingForms/NPED/NPEDCatToggle.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Field } from "formik";
|
||||
|
||||
type NPEDToggleProps = {
|
||||
name: string;
|
||||
label: string;
|
||||
};
|
||||
|
||||
const NPEDCatToggle = ({ name, label }: NPEDToggleProps) => {
|
||||
return (
|
||||
<label className="flex items-center gap-3 cursor-pointer select-none w-full justify-between">
|
||||
<span className="text-lg">{label}</span>
|
||||
<Field id={name} type="checkbox" name={name} className="sr-only peer" />
|
||||
<div
|
||||
className="relative w-10 h-5 rounded-full bg-gray-300 transition peer-checked:bg-blue-500 after:content-['']
|
||||
after:absolute after:top-0.5 after:left-0.5 after:w-4 after:h-4 after:rounded-full after:bg-white after:shadow after:transition
|
||||
after:duration-300 peer-checked:after:translate-x-5"
|
||||
/>
|
||||
</label>
|
||||
);
|
||||
};
|
||||
|
||||
export default NPEDCatToggle;
|
||||
@@ -13,21 +13,19 @@ const NPEDFields = () => {
|
||||
const [showPwd, setShowPwd] = useState(false);
|
||||
const { signIn, signOut } = useNPEDAuth();
|
||||
|
||||
const initialValues = state.npedUser
|
||||
? {
|
||||
username: state.npedUser?.propUsername?.value,
|
||||
password: state.npedUser?.propPassword?.value,
|
||||
clientId: state.npedUser?.propClientID?.value,
|
||||
frontId: "NPED",
|
||||
rearId: "NPED",
|
||||
}
|
||||
: {
|
||||
username: "",
|
||||
password: "",
|
||||
clientId: "",
|
||||
frontId: "NPED",
|
||||
rearId: "NPED",
|
||||
};
|
||||
const username = state.npedUser?.propUsername?.value;
|
||||
const password = state.npedUser?.propPassword?.value;
|
||||
const clientId = state.npedUser?.propClientID?.value;
|
||||
const frontId = "NPED";
|
||||
const rearId = "NPED";
|
||||
|
||||
const initialValues = {
|
||||
username: username ?? "",
|
||||
password: password ?? "",
|
||||
clientId: clientId ?? "",
|
||||
frontId: frontId,
|
||||
rearId: rearId,
|
||||
};
|
||||
|
||||
const handleSubmit = async (values: NPEDFieldType) => {
|
||||
const valuesToSend = {
|
||||
@@ -100,6 +98,7 @@ const NPEDFields = () => {
|
||||
className="p-1.5 border border-gray-400 rounded-lg"
|
||||
/>
|
||||
</FormGroup>
|
||||
|
||||
{!state.npedUser?.propClientID?.value ? (
|
||||
<button
|
||||
type="submit"
|
||||
|
||||
Reference in New Issue
Block a user