Comission is now hidden from everyone apart from admins
This commit is contained in:
@@ -57,7 +57,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
|
||||
const columnHelper = createColumnHelper<Payment>();
|
||||
|
||||
const PaymentCreator = ({onClose, reload}: {onClose: () => void; reload: () => void}) => {
|
||||
const PaymentCreator = ({onClose, reload, showComission = false}: {onClose: () => void; reload: () => void, showComission: boolean}) => {
|
||||
const [corporate, setCorporate] = useState<CorporateUser>();
|
||||
const [price, setPrice] = useState<number>(0);
|
||||
const [currency, setCurrency] = useState<string>("EUR");
|
||||
@@ -173,24 +173,25 @@ const PaymentCreator = ({onClose, reload}: {onClose: () => void; reload: () => v
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex gap-4 w-full">
|
||||
<div className="flex flex-col w-full gap-3">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Commission *</label>
|
||||
<Input name="commission" onChange={(e) => setCommission(e ? parseInt(e) : 0)} type="number" defaultValue={0} />
|
||||
{showComission && (
|
||||
<div className="flex gap-4 w-full">
|
||||
<div className="flex flex-col w-full gap-3">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Commission *</label>
|
||||
<Input name="commission" onChange={(e) => setCommission(e ? parseInt(e) : 0)} type="number" defaultValue={0} />
|
||||
</div>
|
||||
<div className="flex flex-col w-full gap-3">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Commission Value*</label>
|
||||
<Input
|
||||
name="commissionValue"
|
||||
value={`${(commission / 100) * price} ${CURRENCIES.find((c) => c.currency === currency)?.label}`}
|
||||
onChange={() => null}
|
||||
type="text"
|
||||
defaultValue={0}
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col w-full gap-3">
|
||||
<label className="font-normal text-base text-mti-gray-dim">Commission Value*</label>
|
||||
<Input
|
||||
name="commissionValue"
|
||||
value={`${(commission / 100) * price} ${CURRENCIES.find((c) => c.currency === currency)?.label}`}
|
||||
onChange={() => null}
|
||||
type="text"
|
||||
defaultValue={0}
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex gap-4">
|
||||
<div className="flex flex-col w-full gap-3">
|
||||
@@ -420,7 +421,11 @@ export default function PaymentRecord() {
|
||||
</Modal>
|
||||
|
||||
<Modal isOpen={isCreatingPayment} onClose={() => setIsCreatingPayment(false)}>
|
||||
<PaymentCreator onClose={() => setIsCreatingPayment(false)} reload={reload} />
|
||||
<PaymentCreator
|
||||
onClose={() => setIsCreatingPayment(false)}
|
||||
reload={reload}
|
||||
showComission={user.type === "developer" || user.type === "admin"}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
<div className="w-full flex flex-end justify-between p-2">
|
||||
|
||||
Reference in New Issue
Block a user