feat: add formatting rupiah in payback
This commit is contained in:
parent
69efeca588
commit
d77054cbc8
|
@ -1,5 +1,5 @@
|
||||||
import React, {useContext, useState} from "react";
|
import React, {useContext, useState} from "react";
|
||||||
import {Form, Input, message, Modal, Upload,} from "antd";
|
import {Form, InputNumber, message, Modal, Upload,} from "antd";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
import {LoadingOutlined, PlusOutlined} from "@ant-design/icons";
|
import {LoadingOutlined, PlusOutlined} from "@ant-design/icons";
|
||||||
import {ModalLoaderContext} from "../../utils/modal";
|
import {ModalLoaderContext} from "../../utils/modal";
|
||||||
|
@ -141,13 +141,11 @@ export const PaybackModal = ({initialData}) => {
|
||||||
|
|
||||||
{image === "" ? uploadButton : null}
|
{image === "" ? uploadButton : null}
|
||||||
</Upload>
|
</Upload>
|
||||||
<h5
|
<h5 style={{
|
||||||
style={{
|
|
||||||
marginTop: 12,
|
marginTop: 12,
|
||||||
color: "rgba(0, 0, 0, 0.45)",
|
color: "rgba(0, 0, 0, 0.45)",
|
||||||
}}
|
}}>
|
||||||
>
|
Max size of file 2 MB
|
||||||
Max size of file 2 mb
|
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
@ -156,7 +154,11 @@ export const PaybackModal = ({initialData}) => {
|
||||||
label="amount"
|
label="amount"
|
||||||
rules={[{required: true, message: "Please input Amount!"}]}
|
rules={[{required: true, message: "Please input Amount!"}]}
|
||||||
>
|
>
|
||||||
<Input/>
|
<InputNumber
|
||||||
|
style={{width: "100%"}}
|
||||||
|
formatter={value => `Rp. ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
||||||
|
parser={value => value.replace(/\Rp.\s?|(,*)/g, '')}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user