Comission is now hidden from everyone apart from admins

This commit is contained in:
Joao Ramos
2023-12-14 17:34:52 +00:00
parent 73d7ddc4af
commit 6f61fe1564

View File

@@ -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,7 +173,7 @@ const PaymentCreator = ({onClose, reload}: {onClose: () => void; reload: () => v
/>
</div>
</div>
{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>
@@ -191,6 +191,7 @@ const PaymentCreator = ({onClose, reload}: {onClose: () => void; reload: () => v
/>
</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">