Skip to content

Commit

Permalink
fix: change checkout limit to 10.000
Browse files Browse the repository at this point in the history
  • Loading branch information
raulsteurer committed Aug 29, 2024
1 parent 41c3335 commit 653e6b7
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 29 deletions.
6 changes: 3 additions & 3 deletions src/components/portfolio/SmallCheckout/SmallCheckout.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('The SmallCheckout component', () => {

expect(
screen.getByText(
messagesEn['portfolio.smallCheckout.contributionValueKgs.label']
messagesEn['portfolio.smallCheckout.contributionValueTons.label']
)
).toBeInTheDocument();
});
Expand Down Expand Up @@ -97,12 +97,12 @@ describe('The SmallCheckout component', () => {

await userEvent.clear(
screen.getByLabelText(
messagesEn['portfolio.smallCheckout.contributionValueKgs.label']
messagesEn['portfolio.smallCheckout.contributionValueTons.label']
)
);
await userEvent.type(
screen.getByLabelText(
messagesEn['portfolio.smallCheckout.contributionValueKgs.label']
messagesEn['portfolio.smallCheckout.contributionValueTons.label']
),
'3'
);
Expand Down
18 changes: 9 additions & 9 deletions src/components/portfolio/SmallCheckout/SmallCheckout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const SmallCheckout = ({
<Formik
initialValues={{
contributionValueCurrency: initialContributionValue.toString(),
contributionValueKgs: (
contributionValueTons: (
initialContributionValue /
pricePerKg /
1000
Expand Down Expand Up @@ -174,7 +174,7 @@ const SmallCheckout = ({

setValues({
contributionValueCurrency: value.toString(),
contributionValueKgs: (
contributionValueTons: (
value /
pricePerKg /
1000
Expand Down Expand Up @@ -203,10 +203,10 @@ const SmallCheckout = ({
</Box>

<Box width="full">
<Field name="contributionValueKgs">
<Field name="contributionValueTons">
{({ field }: FieldProps) => (
<BoemlyFormControl
id="contributionValueKgs"
id="contributionValueTons"
size="md"
inputProps={{
type: 'number',
Expand All @@ -219,21 +219,21 @@ const SmallCheckout = ({
pricePerKg *
1000
).toString(),
contributionValueKgs: value.toString(),
contributionValueTons: value.toString(),
});
},
}}
label={formatMessage({
id: 'portfolio.smallCheckout.contributionValueKgs.label',
id: 'portfolio.smallCheckout.contributionValueTons.label',
})}
rightAddonsOrElements={[
<InputRightAddon key="tCO₂">tCO₂</InputRightAddon>,
]}
isInvalid={
!!errors.contributionValueKgs &&
touched.contributionValueKgs
!!errors.contributionValueTons &&
touched.contributionValueTons
}
errorMessage={errors.contributionValueKgs}
errorMessage={errors.contributionValueTons}
/>
)}
</Field>
Expand Down
10 changes: 2 additions & 8 deletions src/components/portfolio/SmallCheckout/messages.de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ const messagesDe = {
'portfolio.smallCheckout.contributionValueCurrency.validation.empty':
'Bitte geben Sie einen Wert ein',
'portfolio.smallCheckout.contributionValueCurrency.validation.tooHigh':
'Für größere Einkäufe kontaktieren Sie bitte unser Verkaufsteam über den unten stehenden Button',
'Für größere Einkäufe kontaktieren Sie bitte unser Verkaufsteam',

'portfolio.smallCheckout.contributionValueKgs.label': 'Beitrag in Tonnen',
'portfolio.smallCheckout.contributionValueTons.label': 'Beitrag in Tonnen',

'portfolio.smallCheckout.submitButton': 'Credits kaufen',

'portfolio.smallCheckout.cta.title':
'Möchten Sie mehr als 10.000 tCO₂ kaufen?',
'portfolio.smallCheckout.cta.subTitle':
'Für Unternehmenskunden bieten wir individuelle Lösungen an. Kontaktieren Sie uns.',
'portfolio.smallCheckout.cta.button': 'Unser Vertriebsteam kontaktieren',
};
export default messagesDe;
9 changes: 2 additions & 7 deletions src/components/portfolio/SmallCheckout/messages.en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@ const messagesEn = {
'portfolio.smallCheckout.contributionValueCurrency.validation.empty':
'Please enter a value',
'portfolio.smallCheckout.contributionValueCurrency.validation.tooHigh':
'For bigger purchases please contact our sales team via [email protected]',
'For bigger purchases please contact our sales team',

'portfolio.smallCheckout.contributionValueKgs.label':
'portfolio.smallCheckout.contributionValueTons.label':
'Contribution Amount in Tons',

'portfolio.smallCheckout.submitButton': 'Buy credits',

'portfolio.smallCheckout.cta.title': 'Looking to buy more than 10.000 tCO₂?',
'portfolio.smallCheckout.cta.subTitle':
'For enterprise-customers we offer custom solutions. Feel free to contact us.',
'portfolio.smallCheckout.cta.button': 'Contact our Sales Team',
};
export default messagesEn;
2 changes: 1 addition & 1 deletion src/constants/domain.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const MINIMUM_CONTRIBUTION_VALUE_IN_MONEY = 10;

export const MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY = 60_000;
export const MAXIMUM_CONTRIBUTION_VALUE_IN_MONEY = 10_000;
2 changes: 1 addition & 1 deletion src/models/forms/SmallCheckoutForm.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interface SmallCheckoutForm {
contributionValueCurrency: string;
contributionValueKgs: string;
contributionValueTons: string;
}

export default SmallCheckoutForm;

0 comments on commit 653e6b7

Please sign in to comment.