Improved some issues with the payment

This commit is contained in:
Tiago Ribeiro
2024-05-27 13:05:38 +01:00
parent 1f8e9106de
commit 4166781f7e
6 changed files with 47 additions and 63 deletions

View File

@@ -49,7 +49,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
redirect: {
destination: "/login",
permanent: false,
}
},
};
}
@@ -63,7 +63,7 @@ interface Props {
envVariables: {[key: string]: string};
}
export default function Home(props: Props) {
const { envVariables} = props;
const {envVariables} = props;
const [showDiagnostics, setShowDiagnostics] = useState(false);
const [showDemographicInput, setShowDemographicInput] = useState(false);
const [selectedScreen, setSelectedScreen] = useState<Type>("admin");
@@ -112,15 +112,7 @@ export default function Home(props: Props) {
</div>
</Layout>
)}
{(user.status === "paymentDue" || checkIfUserExpired()) && (
<PaymentDue
key={envVariables["NEXT_PUBLIC_PAYPAL_CLIENT_ID"]}
hasExpired
user={user}
reload={router.reload}
clientID={envVariables["NEXT_PUBLIC_PAYPAL_CLIENT_ID"] || ""}
/>
)}
{(user.status === "paymentDue" || checkIfUserExpired()) && <PaymentDue hasExpired user={user} reload={router.reload} />}
</>
);
}