style: adjust number to currency format
This commit is contained in:
parent
aa2c658f69
commit
119fa6d0bd
|
@ -1,9 +1,8 @@
|
||||||
import React, {useContext, useEffect, useState} from "react";
|
import React, {useContext, useState} from "react";
|
||||||
import {Button, Form, Input, message, Modal, Select, Space, Table,} from "antd";
|
import {Button, Form, Input, message, Modal, Space, Table,} from "antd";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {useHistory} from "react-router-dom";
|
import {useHistory} from "react-router-dom";
|
||||||
import {useStore} from "../utils/useStore";
|
import {useStore} from "../utils/useStore";
|
||||||
import {LINKS} from "../routes/app";
|
|
||||||
import {ModalLoaderContext} from "../utils/modal";
|
import {ModalLoaderContext} from "../utils/modal";
|
||||||
|
|
||||||
export const CommissionComponent = observer((props) => {
|
export const CommissionComponent = observer((props) => {
|
||||||
|
@ -32,6 +31,7 @@ export const CommissionComponent = observer((props) => {
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "commission",
|
dataIndex: "commission",
|
||||||
key: "commission",
|
key: "commission",
|
||||||
|
render: (text) => <span>{text}%</span>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Action",
|
title: "Action",
|
||||||
|
|
|
@ -48,11 +48,21 @@ export const ProductComponent = observer((props) => {
|
||||||
title: "Harga Beli",
|
title: "Harga Beli",
|
||||||
dataIndex: "current_price_price",
|
dataIndex: "current_price_price",
|
||||||
key: "current_price_price",
|
key: "current_price_price",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Harga Jual",
|
title: "Harga Jual",
|
||||||
dataIndex: "mark_up_price",
|
dataIndex: "mark_up_price",
|
||||||
key: "mark_up_price",
|
key: "mark_up_price",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: "Gangguan",
|
// title: "Gangguan",
|
||||||
|
|
|
@ -1,26 +1,13 @@
|
||||||
import React, { useContext, useState,useEffect } from "react";
|
import React, {useContext, useEffect, useState} from "react";
|
||||||
import {
|
import {Button, Divider, Form, Input, List, message, Modal, Select, Space, Table,} from "antd";
|
||||||
Button,
|
import {observer} from "mobx-react-lite";
|
||||||
Form,
|
import {useStore} from "../utils/useStore";
|
||||||
Input,
|
import {ModalLoaderContext} from "../utils/modal";
|
||||||
message,
|
|
||||||
Modal,
|
|
||||||
Select,
|
|
||||||
Space,
|
|
||||||
Table,
|
|
||||||
List,
|
|
||||||
Tag,
|
|
||||||
Divider,
|
|
||||||
} from "antd";
|
|
||||||
import { observer } from "mobx-react-lite";
|
|
||||||
import { useHistory } from "react-router-dom";
|
|
||||||
import { useStore } from "../utils/useStore";
|
|
||||||
import { ModalLoaderContext } from "../utils/modal";
|
|
||||||
|
|
||||||
export const SubcategoryComponent = observer((props) => {
|
export const SubcategoryComponent = observer((props) => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { Option } = Select;
|
const {Option} = Select;
|
||||||
const [idData, setIdData] = useState("");
|
const [idData, setIdData] = useState("");
|
||||||
const modalLoader = useContext(ModalLoaderContext);
|
const modalLoader = useContext(ModalLoaderContext);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
|
@ -48,9 +48,14 @@ export const Payback = observer(() => {
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "amount",
|
dataIndex: "amount",
|
||||||
key: "amount",
|
key: "amount",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Action",
|
title: "Action",
|
||||||
|
|
|
@ -56,6 +56,11 @@ export const PaybackFromUser = observer(() => {
|
||||||
title: "Amount",
|
title: "Amount",
|
||||||
dataIndex: "amount",
|
dataIndex: "amount",
|
||||||
key: "amount",
|
key: "amount",
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import React, {useContext, useEffect, useState} from "react";
|
import React, {useContext, useEffect} from "react";
|
||||||
import {Button, Card, Col, Input, Row,message} from "antd";
|
import {Button, Card, Col, Input, message, Row} from "antd";
|
||||||
import {PlusSquareOutlined} from "@ant-design/icons";
|
import {PlusSquareOutlined} from "@ant-design/icons";
|
||||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
||||||
import {useStore} from "../../utils/useStore";
|
import {useStore} from "../../utils/useStore";
|
||||||
import {observer} from "mobx-react-lite";
|
import {observer} from "mobx-react-lite";
|
||||||
import {LINKS} from "../../routes/app";
|
import {LINKS} from "../../routes/app";
|
||||||
import {SubcategoryComponent} from "../../component/Subcategory";
|
import {SubcategoryComponent} from "../../component/SubcategoryComponent";
|
||||||
import {ModalLoaderContext} from "../../utils/modal";
|
import {ModalLoaderContext} from "../../utils/modal";
|
||||||
|
|
||||||
const {Search} = Input;
|
const {Search} = Input;
|
||||||
|
|
|
@ -42,6 +42,11 @@ export const Profile = observer(() => {
|
||||||
dataIndex: 'mark_up_price',
|
dataIndex: 'mark_up_price',
|
||||||
key: 'mark_up_price',
|
key: 'mark_up_price',
|
||||||
width: '20%',
|
width: '20%',
|
||||||
|
render: (text) =>
|
||||||
|
new Intl.NumberFormat("id-ID", {
|
||||||
|
style: "currency",
|
||||||
|
currency: "IDR",
|
||||||
|
}).format(text),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Name',
|
title: 'Name',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user