diff --git a/fe/src/app/components/common/Button.tsx b/fe/src/app/components/common/Button.tsx index 306602a..d31a4a7 100644 --- a/fe/src/app/components/common/Button.tsx +++ b/fe/src/app/components/common/Button.tsx @@ -1,6 +1,6 @@ "use client"; -import React from "react"; +import React, { useState } from "react"; export interface ButtonProps { label: string; @@ -8,6 +8,8 @@ export interface ButtonProps { type?: "start" | "next" | "submit" | "default"; className?: string; disabled?: boolean; + isSubmitting?: boolean; + isFormComplete?: boolean; } function Button({ @@ -16,17 +18,49 @@ function Button({ type = "default", className = "", disabled = false, + isSubmitting = false, + isFormComplete = true, }: ButtonProps) { + const [isActive, setIsActive] = useState(false); + const [isClicked, setIsClicked] = useState(false); + + const handleClick = () => { + setIsActive(true); + setIsClicked(true); + onClick(); + }; + const getButtonStyle = () => { - if (disabled) { - return "bg-[#E4E4E4] text-[#8E8E8E] cursor-not-allowed"; + if (isSubmitting) { + return "bg-[#000000] text-white cursor-not-allowed"; } + + if (!isFormComplete) { + return "bg-[#E4E4E4] cursor-not-allowed text-[#8E8E8E]"; + } + + if (isClicked && type !== "start") { + return "bg-[#000000] text-white"; + } + + if (isActive) { + switch (type) { + case "start": + return "bg-[#A6251B] text-white"; + case "next": + case "submit": + case "default": + default: + return "bg-[#1D1D1D] text-white"; + } + } + switch (type) { case "start": return "bg-[#F73A2C] text-white"; case "next": case "submit": - return "bg-[#1D1D1D] text-white"; + case "default": default: return "bg-[#1D1D1D] text-white"; } @@ -36,9 +70,9 @@ function Button({
{showExitModal && ( - + )} ); diff --git "a/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/BottomSheet.tsx" "b/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/BottomSheet.tsx" index eefb284..994f4b4 100644 --- "a/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/BottomSheet.tsx" +++ "b/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/BottomSheet.tsx" @@ -18,7 +18,7 @@ export default function BottomSheet() { return (
diff --git "a/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/LinkField.tsx" "b/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/LinkField.tsx" index 1ac557d..983ea05 100644 --- "a/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/LinkField.tsx" +++ "b/fe/src/app/event-maps/[id]/load-mappin/forms/links/\bcomponents/LinkField.tsx" @@ -5,11 +5,13 @@ import { nanoid } from "nanoid"; import Image from "next/image"; import { useRouter, useParams } from "next/navigation"; -interface LinkFieldEditProps { +interface LinkFieldProps { label: string; placeholder: string; value: string[]; onChange: (value: string[]) => void; + showTooltip?: boolean; + onInfoClick?: () => void; } interface InputField { @@ -18,14 +20,15 @@ interface InputField { error: string; isValid: boolean; isTyping: boolean; + canEdit: boolean; } -export default function LinkFieldEdit({ +export default function LinkField({ label, placeholder, value, onChange, -}: LinkFieldEditProps) { +}: LinkFieldProps) { const [inputFields, setInputFields] = useState( value.length > 0 ? value.map((val) => ({ @@ -34,6 +37,7 @@ export default function LinkFieldEdit({ error: "", isValid: true, isTyping: false, + canEdit: true, })) : [ { @@ -42,6 +46,7 @@ export default function LinkFieldEdit({ error: "", isValid: false, isTyping: false, + canEdit: true, }, ] ); @@ -50,6 +55,11 @@ export default function LinkFieldEdit({ const router = useRouter(); const { id } = useParams(); + const cleanURL = (url: string): string => { + const match = url.match(/https?:\/\/[^\s]+/); + return match ? match[0].trim() : ""; + }; + useEffect(() => { const validLinks = inputFields .filter((field) => field.isValid) @@ -57,11 +67,6 @@ export default function LinkFieldEdit({ onChange(validLinks); }, [inputFields, onChange]); - const cleanURL = (url: string): string => { - const match = url.match(/https?:\/\/[^\s]+/); - return match ? match[0].trim() : ""; - }; - const validateLink = async (fieldId: string, url: string, type: string) => { const endpoint = type === "북마크 공유 링크" ? "/pings/bookmark" : "/pings/store"; @@ -113,17 +118,16 @@ export default function LinkFieldEdit({ const handlePasteFromClipboard = async (fieldId: string) => { try { const clipboardText = await navigator.clipboard.readText(); - const cleanedValue = cleanURL(clipboardText); - if (cleanedValue) { + if (clipboardText.trim()) { + const cleanedText = cleanURL(clipboardText); setInputFields((prevFields) => prevFields.map((fieldItem) => fieldItem.id === fieldId - ? { ...fieldItem, text: cleanedValue, isValid: false } + ? { ...fieldItem, text: cleanedText, isValid: false } : fieldItem ) ); - - validateLink(fieldId, cleanedValue, label); + validateLink(fieldId, cleanedText, label); } } catch (error) { console.error("클립보드에서 텍스트를 읽는 데 실패했습니다:", error); @@ -139,10 +143,7 @@ export default function LinkFieldEdit({ : fieldItem ) ); - - if (cleanedValue) { - validateLink(fieldId, cleanedValue, label); - } + validateLink(fieldId, cleanedValue, label); }; const handleFocus = (fieldId: string) => { @@ -172,6 +173,7 @@ export default function LinkFieldEdit({ error: "", isValid: false, isTyping: false, + canEdit: true, }, ]); }; @@ -248,9 +250,7 @@ export default function LinkFieldEdit({ {inputFields.map((item, index) => (
{ + const match = url.match(/https?:\/\/[^\s]+/); + return match ? match[0].trim() : ""; + }; + const handleSubmit = async (e?: React.FormEvent) => { if (e) e.preventDefault(); @@ -40,12 +45,15 @@ export default function LinksPage() { return; } + const cleanedMapLinks = mapLinks.map(cleanURL).filter(Boolean); + const cleanedStoreLinks = storeLinks.map(cleanURL).filter(Boolean); + const requestBody = { uuid: id, name, password: pin, - bookmarkUrls: mapLinks, - storeUrls: storeLinks, + bookmarkUrls: cleanedMapLinks, + storeUrls: cleanedStoreLinks, }; try { @@ -115,7 +123,6 @@ export default function LinksPage() { onChange={setStoreLinks} /> - {/* 체크박스 */}
@@ -125,7 +132,6 @@ export default function LinksPage() {
- {/* 하단 버튼 */}
- {/* 바텀 시트 */}
); diff --git a/fe/src/app/event-maps/[id]/load-mappin/forms/tooltip/page.tsx b/fe/src/app/event-maps/[id]/load-mappin/forms/tooltip/page.tsx index b7b0d70..eb20e7a 100644 --- a/fe/src/app/event-maps/[id]/load-mappin/forms/tooltip/page.tsx +++ b/fe/src/app/event-maps/[id]/load-mappin/forms/tooltip/page.tsx @@ -66,18 +66,17 @@ export default function ToolTipPage() { className="w-full h-screen bg-white flex flex-col items-center" {...handlers} > - {/* 고정된 넓이 설정 */}
-
+

이렇게 공유 버튼이 안 보이나요?
이렇게 하면 해결 완

-
+
{slides[currentSlide].step && (
@@ -102,11 +101,11 @@ export default function ToolTipPage() { alt="Example Screenshot" width={286} height={286} - className="w-full rounded-xl border border-[#f0f0f0]" + className="w-fix rounded-xl border border-[#f0f0f0]" />
-
+
{slides.map((slide) => (
))}
-
+
diff --git "a/fe/src/app/eventcreate-page/\butils/formHelpers.ts" b/fe/src/app/eventcreate-page/utils/formHelpers.ts similarity index 100% rename from "fe/src/app/eventcreate-page/\butils/formHelpers.ts" rename to fe/src/app/eventcreate-page/utils/formHelpers.ts diff --git a/fe/src/app/page.tsx b/fe/src/app/page.tsx index 83e3e2e..1c6648d 100644 --- a/fe/src/app/page.tsx +++ b/fe/src/app/page.tsx @@ -13,7 +13,7 @@ function LoadingPage() { }; return ( -
+