Skip to content

Commit

Permalink
Add display button condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbrunvoll committed Sep 26, 2024
1 parent 0f727cf commit 5951d28
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/page-modules/contact/ticket-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import PostponePaymentForm from './forms/postponePayment';
const TicketControlPageContent = () => {
const { t } = useTranslation();
const [state, send] = useMachine(ticketControlFormMachine);
const displayButton =
(state.context.formType === 'feeComplaint' &&
state.context.agreesSecondAgreement) ||
(state.context.formType && state.context.formType !== 'feeComplaint');

// Local state to force re-render to display errors.
const [forceRerender, setForceRerender] = useState(false);
Expand Down Expand Up @@ -61,7 +65,7 @@ const TicketControlPageContent = () => {
{state.context.formType === 'postponePayment' && (
<PostponePaymentForm state={state} send={send} />
)}
{state.context.formType && (
{displayButton && (
<Button
title={t(PageText.Contact.submit)}
mode={'interactive_0--bordered'}
Expand Down

0 comments on commit 5951d28

Please sign in to comment.