1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

display legal agreement

This commit is contained in:
Sylvain 2020-12-09 12:51:06 +01:00
parent 66c205d0ed
commit a20be8ecb2
3 changed files with 22 additions and 6 deletions

View File

@ -0,0 +1,18 @@
/**
* This component renders a translation with some HTML content.
*/
import React from 'react';
import { useTranslation } from 'react-i18next';
interface HtmlTranslateProps {
trKey: string,
options?: any
}
export const HtmlTranslate: React.FC<HtmlTranslateProps> = ({ trKey, options }) => {
const { t } = useTranslation(trKey?.split('.')[1]);
return (
<span dangerouslySetInnerHTML={{__html: t(trKey, options)}} />
);
}

View File

@ -26,6 +26,7 @@ import visaLogo from '../../../images/visa.png';
import { CartItems, PaymentConfirmation } from '../models/payment';
import WalletAPI from '../api/wallet';
import PriceAPI from '../api/price';
import { HtmlTranslate } from './html-translate';
declare var Application: IApplication;
declare var Fablab: IFablab;
@ -193,8 +194,7 @@ const StripeModal: React.FC<StripeModalProps> = ({ isOpen, toggleModal, afterSuc
</label>
</div>}
{isPaymentSchedule() && <div className="payment-schedule-info">
<i className="fa fa-warning" />
<p>{ t('app.shared.stripe.payment_schedule', { DEADLINES: schedule.items.length }) }</p>
<HtmlTranslate trKey="app.shared.stripe.payment_schedule_html" options={{ DEADLINES: schedule.items.length }} />
</div>}
</StripeForm>
{!submitState && <button type="submit"

View File

@ -48,11 +48,9 @@
background-color: #fcf8e3;
color: #8a6d3b;
.fa.fa-warning {
margin-right: 0.5em;
}
p {
display: inline;
font-size: small;
margin-bottom: 0.5em;
}
}
.validate-btn {