fix(disconnect from map issue): require to be connected to reach /map

This commit is contained in:
Laurian-Dufrechou
2023-05-18 17:31:54 +02:00
parent b1b5c8720c
commit 61df566dcf
4 changed files with 65 additions and 49 deletions
@@ -5,7 +5,8 @@ import {
FormHelperText,
FormLabel,
UseEditableProps,
} from '@chakra-ui/react';
Link,
} from "@chakra-ui/react";
type CustomEditableProps = {
id: string;
@@ -14,16 +15,25 @@ type CustomEditableProps = {
} & UseEditableProps;
export default function CustomEditable(props: CustomEditableProps) {
const {label, id, helperText = '', ...UseEditableProps} = props;
const { label, id, helperText = "", ...UseEditableProps } = props;
return (
<FormControl>
<FormLabel as="legend" htmlFor={id}>{label}</FormLabel>
<Editable{...UseEditableProps} fontWeight="bold" isDisabled={true}
placeholder={'Non renseigné'} color={'gray.500'}>
<EditablePreview/>
</Editable>
<FormControl>
<FormLabel as="legend" htmlFor={id}>
{label}
</FormLabel>
<Editable
{...UseEditableProps}
fontWeight="bold"
isDisabled={true}
placeholder={"Non renseigné"}
color={"gray.500"}
>
<EditablePreview />
</Editable>
<Link href={"/map"}>
<FormHelperText>{helperText}</FormHelperText>
</FormControl>
</Link>
</FormControl>
);
}