comitting
This commit is contained in:
@@ -52,7 +52,7 @@ const testData = {
|
||||
totalMembers: 50,
|
||||
totalCases: 100,
|
||||
totalPersen: 75,
|
||||
myLimit: '375.000.000',
|
||||
myLimit: 375000000,
|
||||
totalLimit: 500000000,
|
||||
};
|
||||
|
||||
@@ -75,14 +75,14 @@ const DialogTopUpLimit = ({ title, openDialog, setOpenDialog, data }: MuiDialogP
|
||||
const [isDisabledButton, setIsDisabledButton] = useState(true);
|
||||
|
||||
const TopUpSchema = Yup.object().shape({
|
||||
topup: Yup.string()
|
||||
/*
|
||||
// @ts-ignore */
|
||||
.test('limit', 'Maximum Top Up Rp. 5.000.000', (val) => (val > 5000000 ? false : true)),
|
||||
topup: Yup.number(),
|
||||
// /*
|
||||
// // @ts-ignore */
|
||||
// .test('limit', 'Maximum Top Up Rp. 5.000.000', (val) => (val > 5000000 ? false : true)),
|
||||
});
|
||||
|
||||
const defaultValues = {
|
||||
topup: '0',
|
||||
topup: 0,
|
||||
};
|
||||
|
||||
const methods = useForm<FormValuesProps>({
|
||||
@@ -109,7 +109,8 @@ const DialogTopUpLimit = ({ title, openDialog, setOpenDialog, data }: MuiDialogP
|
||||
|
||||
const onCheckHandler = (data: FormValuesProps) => {
|
||||
setIsDisabledCheckbox(!isDisabledCheckbox);
|
||||
setValue('topup', '5000000');
|
||||
setIsDisabledButton(false);
|
||||
setValue('topup', testData.totalLimit - testData.myLimit);
|
||||
};
|
||||
|
||||
const onTopupHandler = (value: string) => {
|
||||
@@ -175,7 +176,7 @@ const DialogTopUpLimit = ({ title, openDialog, setOpenDialog, data }: MuiDialogP
|
||||
<FormControlLabel
|
||||
sx={{ typography: 'caption' }}
|
||||
control={<Checkbox />}
|
||||
label={'Max ' + fCurrency(5000000)}
|
||||
label={'Max ' + fCurrency(testData.totalLimit - testData.myLimit)}
|
||||
onChange={handleSubmit(onCheckHandler)}
|
||||
/>
|
||||
|
||||
@@ -188,7 +189,7 @@ const DialogTopUpLimit = ({ title, openDialog, setOpenDialog, data }: MuiDialogP
|
||||
sx={{ marginTop: 2 }}
|
||||
disabled={isDisabledButton}
|
||||
>
|
||||
Login
|
||||
Ajukan Permintaan
|
||||
</LoadingButton>
|
||||
</FormProvider>
|
||||
</Stack>
|
||||
|
||||
Reference in New Issue
Block a user