diff --git a/src/components/custom-ui/labeled-input.tsx b/src/components/custom-ui/labeled-input.tsx
index 4900e66..38a6c56 100644
--- a/src/components/custom-ui/labeled-input.tsx
+++ b/src/components/custom-ui/labeled-input.tsx
@@ -17,6 +17,7 @@ export default function LabeledInput({
variantSize = 'default',
autocomplete,
error,
+ 'data-cy': dataCy,
...rest
}: {
label: string;
@@ -30,6 +31,7 @@ export default function LabeledInput({
variantSize?: 'default' | 'big' | 'textarea';
autocomplete?: string;
error?: string;
+ 'data-cy'?: string;
} & React.InputHTMLAttributes
) {
const [passwordVisible, setPasswordVisible] = React.useState(false);
const [inputValue, setInputValue] = React.useState(
@@ -64,6 +66,7 @@ export default function LabeledInput({
id={name}
name={name}
rows={3}
+ data-cy={dataCy}
/>
) : (
@@ -82,6 +85,7 @@ export default function LabeledInput({
id={name}
name={name}
autoComplete={autocomplete}
+ data-cy={dataCy}
{...rest}
onChange={handleInputChange}
/>
diff --git a/src/components/forms/event-form.tsx b/src/components/forms/event-form.tsx
index d89efdc..822cf4d 100644
--- a/src/components/forms/event-form.tsx
+++ b/src/components/forms/event-form.tsx
@@ -190,11 +190,6 @@ const EventForm: React.FC = (props) => {
router.back();
}
- // Calculate values for organiser, created, and updated
- const organiserValue = isLoading
- ? 'Loading...'
- : data?.data.user?.name || 'Unknown User';
-
// Use DB values for created_at/updated_at in edit mode
const createdAtValue =
props.type === 'edit' && eventData?.data?.event?.created_at
@@ -209,188 +204,203 @@ const EventForm: React.FC = (props) => {
const createdAtDisplay = new Date(createdAtValue).toLocaleDateString();
const updatedAtDisplay = new Date(updatedAtValue).toLocaleDateString();
+ const [isClient, setIsClient] = React.useState(false);
+ React.useEffect(() => {
+ setIsClient(true);
+ }, []);
+
if (props.type === 'edit' && isLoading) return Loading...
;
if (props.type === 'edit' && fetchError)
return Error loading event.
;
return (
- <>
-