Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default function LandingPage() {
{/* 텍스트 섹션 - 장식 요소 제거 */}
<motion.div className="relative">
<motion.h2
className="text-center font-hakgyo text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl"
className="text-center font-hakgyo text-4xl font-bold tracking-tight md:text-4xl lg:text-6xl"
style={{
background: "linear-gradient(to right, #71db77, #56c45d)",
WebkitBackgroundClip: "text",
Expand Down Expand Up @@ -499,7 +499,7 @@ export default function LandingPage() {
{/* 텍스트 섹션 */}
<motion.div className="relative">
<motion.h2
className="text-center font-hakgyo text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl"
className="text-center font-hakgyo text-4xl font-bold tracking-tight md:text-4xl lg:text-6xl"
style={{
color: "#ffffff",
letterSpacing: "-0.02em",
Expand Down Expand Up @@ -585,7 +585,7 @@ export default function LandingPage() {
className={`fixed ${
isLargeScreen
? "right-12 top-1/2 -translate-y-1/2 space-y-4"
: "bottom-12 left-1/2 flex -translate-x-1/2 space-x-4"
: "bottom-12 left-12 flex flex-col space-y-4"
}`}
>
{slides.slice(1).map((_, index) => (
Expand Down
3 changes: 2 additions & 1 deletion src/app/clientLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ export default function ClientLayout({ children }: { children: React.ReactNode }
// 채널톡을 표시하지 않을 경로들
const excludePaths = ["/login", "/signup", "/auth/callback"];
const showChannelTalk = !excludePaths.some((path) => pathname.startsWith(path));
const isHome = pathname === "/";

return (
<QueryClientProvider client={queryClient}>
<div className="relative">
<div className={`relative min-h-[80vh] ${!isHome ? "pt-16" : ""}`}>
{children}
<MouseTrail />
<Toaster
Expand Down
37 changes: 23 additions & 14 deletions src/app/components/input/text/LocationInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,34 @@ import { BaseInputProps } from "@/types/textInput";
import { forwardRef, useCallback, useState, useEffect } from "react";
import Script from "next/script";

// DaumPostcode 타입 정의
// Daum 우편번호 서비스에서 주소 검색 후 반환되는 데이터 타입
interface DaumPostcodeData {
address: string;
addressType: string;
bname: string;
buildingName: string;
zonecode: string;
[key: string]: string;
address: string; // 기본 주소 (도로명 주소 또는 지번 주소)
addressType: string; // 검색된 주소 타입 (R: 도로명, J: 지번)
bname: string; // 법정동/법정리 이름
buildingName: string; // 건물명
zonecode: string; // 우편번호
[key: string]: string; // 기타 가능한 추가 필드들
}

// 전역 Window 객체에 다음 우편번호 서비스 타입 선언
declare global {
interface Window {
daum: {
Postcode: new (config: { oncomplete: (data: DaumPostcodeData) => void }) => {
open: () => void;
// Postcode 클래스 정의
Postcode: new (config: {
oncomplete: (data: DaumPostcodeData) => void; // 주소 검색 완료 시 실행될 콜백 함수
}) => {
open: () => void; // 주소 검색 팝업을 여는 메서드
};
};
}
}

interface LocationInputProps extends BaseInputProps {
onAddressChange?: (fullAddress: string) => void;
readOnly?: boolean;
value?: string;
onAddressChange?: (fullAddress: string) => void; // 주소가 변경될 때 호출될 콜백 함수
readOnly?: boolean; // 입력 필드 읽기 전용 여부
value?: string; // 초기 주소 값
}

const LocationInput = forwardRef<HTMLInputElement, LocationInputProps>(
Expand All @@ -39,26 +43,31 @@ const LocationInput = forwardRef<HTMLInputElement, LocationInputProps>(
) => {
const [address, setAddress] = useState("");

// 외부에서 주소 값이 변경될 경우 내부 상태 업데이트
useEffect(() => {
if (value) {
setAddress(value);
}
}, [value]);

// 다음 우편번호 검색 팝업을 여는 함수
const handleOpenPostcode = useCallback(() => {
// SSR 환경이거나 다음 스크립트가 로드되지 않은 경우 실행하지 않음
if (typeof window === "undefined" || !window.daum) return;

// 다음 우편번호 검색 팝업 생성 및 설정
new window.daum.Postcode({
oncomplete: (data: DaumPostcodeData) => {
const newAddress = data.address;
setAddress(newAddress);
onAddressChange?.(newAddress);
setAddress(newAddress); // 내부 상태 업데이트
onAddressChange?.(newAddress); // 부모 컴포넌트에 주소 변경 알림
},
}).open();
}, [onAddressChange]);

return (
<>
{/* 다음 우편번호 서비스 스크립트 로드 */}
<Script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js" strategy="afterInteractive" />
<div className="relative w-full">
<BaseInput
Expand Down
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export default function RootLayout({ children }: { children: React.ReactNode })
</head>
<body className="scrollbar-custom relative">
<ClientLayout>
<Header />
<main>{children}</main>
<CustomCursor />
<MouseTrail />
<Header />
<main className="min-h-[80vh] has-[header]:pt-16">{children}</main>
</ClientLayout>
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_ID || ""} />
</body>
Expand Down
Loading