This commit is contained in:
1 parent
9e25c6da04
commit
a218405f34
2 files changed
+23
-15
No files matched your search
@@ -1,9 +1,10 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Button, Card, Collapse, Empty, Flex, QRCode, Space, Typography, theme } from "antd";
|
import { Button, Card, Collapse, Empty, Flex, QRCode, Space, Tooltip, Typography, theme } from "antd";
|
||||||
import { ExportOutlined, InfoCircleOutlined } from "@ant-design/icons";
|
import { ExportOutlined, InfoCircleOutlined } from "@ant-design/icons";
|
||||||
import { markdownToHtml } from "../../lib/markdown";
|
import { markdownToHtml } from "../../lib/markdown";
|
||||||
import {
|
import {
|
||||||
PAYMENT_ESTIMATE_DISCLAIMER,
|
PAYMENT_ESTIMATE_DISCLAIMER,
|
||||||
|
PAYMENT_ESTIMATE_DISCLAIMER_SHORT,
|
||||||
PAYMENT_PROVIDER_LABELS,
|
PAYMENT_PROVIDER_LABELS,
|
||||||
buildPaymentQrValue,
|
buildPaymentQrValue,
|
||||||
buildPaypalUrl,
|
buildPaypalUrl,
|
||||||
@@ -41,9 +42,11 @@ function DetailLine({ label, value, copyValue }: { label: string; value: string;
|
|||||||
|
|
||||||
export function PaymentDisclaimer() {
|
export function PaymentDisclaimer() {
|
||||||
return (
|
return (
|
||||||
<Text type="secondary" style={{ ...hintStyle, display: "block" }} ellipsis={{ tooltip: PAYMENT_ESTIMATE_DISCLAIMER }}>
|
<Tooltip title={PAYMENT_ESTIMATE_DISCLAIMER}>
|
||||||
<InfoCircleOutlined /> {PAYMENT_ESTIMATE_DISCLAIMER}
|
<Text type="secondary" style={{ ...hintStyle, cursor: "help" }}>
|
||||||
</Text>
|
<InfoCircleOutlined /> {PAYMENT_ESTIMATE_DISCLAIMER_SHORT}
|
||||||
|
</Text>
|
||||||
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,23 +75,26 @@ export function PaymentMethodDetails({ method, context }: { method: PaymentMetho
|
|||||||
<DetailLine label="PayPal" value={cleanPaypalUsername(method.username)} copyValue={paypalUrl} />
|
<DetailLine label="PayPal" value={cleanPaypalUsername(method.username)} copyValue={paypalUrl} />
|
||||||
)}
|
)}
|
||||||
<DetailLine label="Amount" value={amount} copyValue={formatAmount(context.amount)} />
|
<DetailLine label="Amount" value={amount} copyValue={formatAmount(context.amount)} />
|
||||||
<DetailLine label={method.type === "paypal" ? "Note" : "Reference"} value={reference} />
|
<DetailLine
|
||||||
|
label={"Reference"}
|
||||||
|
value={reference}
|
||||||
|
/>
|
||||||
{method.type === "sepa" && qrValue && (
|
{method.type === "sepa" && qrValue && (
|
||||||
<Text type="secondary" style={hintStyle}>
|
<Text type="secondary" style={hintStyle}>
|
||||||
Scan the code with your banking app to pre-fill the transfer.
|
Scan the code with your banking app to pre-fill the transfer.
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{paypalUrl && (
|
{paypalUrl && (
|
||||||
<Space direction="vertical" size={4}>
|
<Button
|
||||||
{reference && (
|
size="small"
|
||||||
<Text type="secondary" style={hintStyle}>
|
icon={<ExportOutlined />}
|
||||||
PayPal links can't carry a note, please add the note above manually.
|
href={paypalUrl}
|
||||||
</Text>
|
target="_blank"
|
||||||
)}
|
rel="noopener noreferrer"
|
||||||
<Button size="small" icon={<ExportOutlined />} href={paypalUrl} target="_blank" rel="noopener noreferrer">
|
style={{ alignSelf: "flex-start" }}
|
||||||
Open PayPal
|
>
|
||||||
</Button>
|
Open PayPal
|
||||||
</Space>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Space>
|
</Space>
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ export const PAYMENT_REFERENCE_PLACEHOLDERS = [
|
|||||||
{ key: "{total}", description: "Participant's estimated total, e.g. 12.50" },
|
{ key: "{total}", description: "Participant's estimated total, e.g. 12.50" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const PAYMENT_ESTIMATE_DISCLAIMER_SHORT = "Amounts are estimates and subject to change.";
|
||||||
|
|
||||||
export const PAYMENT_ESTIMATE_DISCLAIMER =
|
export const PAYMENT_ESTIMATE_DISCLAIMER =
|
||||||
"All amounts are non-binding estimates based on the listed menu prices. Errors and omissions excepted; " +
|
"All amounts are non-binding estimates based on the listed menu prices. Errors and omissions excepted; " +
|
||||||
"the final amount may differ and remains subject to change, e.g. due to pricing errors, substitutions or fees.";
|
"the final amount may differ and remains subject to change, e.g. due to pricing errors, substitutions or fees.";
|
||||||
|
|||||||
Reference in new issue
Block a user