Skip to content

Commit

Permalink
Feature/new event name (#100)
Browse files Browse the repository at this point in the history
* [refactor] Update exit modal functionality and improve data handling

* [fix] implement feedback

* [chore] enhance event name input utility

* [chore] enhance event name input utility

* Add event name feature
  • Loading branch information
karnelll authored Nov 28, 2024
1 parent de85639 commit bb33a1a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion fe/src/app/eventcreate-page/components/EventNameInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
cleanString,
isValidLength,
generateDefaultEventName,
} from "../utils/formHelpers";
} from "../utils/formHelpers";

interface EventNameInputProps {
className?: string;
Expand Down
3 changes: 1 addition & 2 deletions fe/src/app/eventcreate-page/location-search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ function LocationSearch() {
};
}, [location, debouncedFetch]);

// Focus the input field on component mount
useEffect(() => {
if (inputRef.current) {
inputRef.current.focus(); // Automatically focus on the input field
inputRef.current.focus();
}
}, []);

Expand Down
18 changes: 8 additions & 10 deletions fe/src/app/eventcreate-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ function EventCreatePage() {
setIsSubmitting(false);
}
};
useEffect(() => {
setLocation(null); // selectedLocation 초기화
setEventName(""); // eventName 초기화
}, [setLocation]);

useEffect(() => {
if (uuid) router.push(`/event-maps/${uuid}`);
Expand All @@ -64,12 +60,14 @@ function EventCreatePage() {
className="mt-[12px] w-full"
value={selectedLocation?.name || ""}
/>
<EventNameInput
className="mt-[40px] w-full"
value={eventName}
selectedLocation={selectedLocation?.name || ""}
onChange={setEventName}
/>
<div className="relative mt-[40px] w-full">
<EventNameInput
className="w-full"
value={eventName}
selectedLocation={selectedLocation?.name || ""}
onChange={setEventName}
/>
</div>
</div>
<div className="w-full fixed bottom-[45px] left-0 flex justify-center">
<Button
Expand Down

0 comments on commit bb33a1a

Please sign in to comment.