fix(frontend): fix various typo, capfirst, use a grid for home page
All checks were successful
Deploy Amap / deploy (push) Successful in 42s

This commit is contained in:
Julien Aldon
2026-04-17 11:38:33 +02:00
parent 7e3cf6de9d
commit 4b57b29b34
6 changed files with 27 additions and 25 deletions

View File

@@ -123,7 +123,7 @@
"minimum shipment value": "minimum shipment value (€)",
"name": "name",
"nothing found": "nothing to display",
"number of cheques between 1 and 3 cheques also enter your cheques identifiers, value is calculated automatically": "number of cheques between 1 and 3. Also enter cheque identifiers.",
"number of cheques between 1 and 3 cheques also enter your cheques identifiers, value is calculated automatically": "number of cheques between 1 and {{max}}. Also enter cheque identifiers.",
"number of shipment": "number of shipments",
"occasional": "occasional",
"occasional product": "occasional product",

View File

@@ -123,7 +123,7 @@
"minimum shipment value": "valeur minimum d'une livraison (€)",
"name": "nom",
"nothing found": "rien à afficher",
"number of cheques between 1 and 3 cheques also enter your cheques identifiers, value is calculated automatically": "nombre de chèques entre 1 et 3, entrez également les identifiants des chèques utilisés.",
"number of cheques between 1 and 3 cheques also enter your cheques identifiers, value is calculated automatically": "nombre de chèques entre 1 et {{max}}, entrez également les identifiants des chèques utilisés.",
"number of shipment": "nombre de livraisons",
"occasional": "occasionnel",
"occasional product": "produit occasionnel",

View File

@@ -12,12 +12,12 @@ export type FormCardProps = {
export function FormCard({ form }: FormCardProps) {
const contractBaseTemplate = useGetContractFileTemplate();
return (
<Paper shadow="xl" p="xl" miw={{ base: "100vw", md: "25vw", lg: "20vw" }}>
<Paper shadow="xl" p="xl">
<Group justify="start" mb="md">
<Tooltip label={t("download base template to print")}>
<Tooltip label={t("download base template to print", {capfirst: true})}>
<ActionIcon
variant={"outline"}
aria-label={t("download base template to print")}
aria-label={t("download base template to print", {capfirst: true})}
onClick={async () => {
await contractBaseTemplate.mutateAsync(form.id);
}}
@@ -25,10 +25,10 @@ export function FormCard({ form }: FormCardProps) {
<IconDownload />
</ActionIcon>
</Tooltip>
<Tooltip label={t("fill contract online")}>
<Tooltip label={t("fill contract online", {capfirst: true})}>
<ActionIcon
variant={"outline"}
aria-label={t("fill contract online")}
aria-label={t("fill contract online", {capfirst: true})}
component={Link}
to={`/form/${form.id}`}
target="_blank"

View File

@@ -46,20 +46,24 @@ export function ContractCheque({ inputForm, price, productor }: ContractChequePr
return productor?.payment_methods.find((el) => el.name === "cheque");
}, [productor]);
const maxCheques = useMemo(() => {
return paymentMethod?.max && paymentMethod?.max !== "" ? Number(paymentMethod?.max) : 3
}, [paymentMethod])
return (
<Stack>
<Title order={4}>{`${t("order name")} : ${paymentMethod?.details}`}</Title>
<Title order={4}>{`${t("order name", {capfirst: true})} : ${paymentMethod?.details}`}</Title>
<NumberInput
clampBehavior="strict"
label={t("cheque quantity", { capfirst: true })}
placeholder={t("enter cheque quantity", { capfirst: true })}
description={t(
"number of cheques between 1 and 3 cheques also enter your cheques identifiers, value is calculated automatically",
{ capfirst: true },
{ capfirst: true, max: maxCheques },
)}
min={1}
max={
paymentMethod?.max && paymentMethod?.max !== "" ? Number(paymentMethod?.max) : 3
}
max={maxCheques}
{...inputForm.getInputProps(`cheque_quantity`)}
/>
<Group grow>

View File

@@ -107,7 +107,7 @@ export default function Contracts() {
</Tooltip>
<Tooltip label={t("download recap", { capfirst: true })}>
<ActionIcon
disabled={false}
disabled={true}
onClick={(e) => {
e.stopPropagation();
navigate(

View File

@@ -1,4 +1,4 @@
import { Flex, Stack, Text } from "@mantine/core";
import { SimpleGrid, Text } from "@mantine/core";
import { useGetForms } from "@/services/api";
import { FormCard } from "@/components/Forms/Card";
import type { Form } from "@/services/resources/forms";
@@ -33,16 +33,14 @@ export function Home() {
}, [searchParams]);
return (
<Stack mt="lg">
<Flex gap="md" wrap="wrap" justify="center">
{allForms && allForms?.length > 0 ? (
allForms.map((form: Form) => <FormCard form={form} key={form.id} />)
) : (
<Text mt="lg" size="lg">
{t("there is no contract for now", { capfirst: true })}
</Text>
)}
</Flex>
</Stack>
<SimpleGrid m="lg" cols={{base: 1, md: 3, sm: 2}} spacing="md">
{allForms && allForms?.length > 0 ? (
allForms.map((form: Form) => <FormCard form={form} key={form.id} />)
) : (
<Text mt="lg" size="lg">
{t("there is no contract for now", { capfirst: true })}
</Text>
)}
</SimpleGrid>
);
}