Skip to content

Commit

Permalink
Add ContactSection component to page layout
Browse files Browse the repository at this point in the history
  • Loading branch information
grayashh committed Sep 9, 2024
1 parent 9d4f426 commit b1a65cf
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 1 deletion.
45 changes: 45 additions & 0 deletions src/app/components/ContactSection/Contact.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use client";

import { useState } from "react";
import FadeIn from "../FadeIn";

export default function Contact() {
const [isLoaded, setIsLoaded] = useState(false);

return (
<FadeIn className="relative flex w-full flex-col justify-center px-4 pt-10">
{isLoaded ? undefined : (
<div className="absolute inset-0 flex h-auto w-full items-center justify-center bg-gray-100">
<svg
className="h-8 w-8 animate-spin text-gray-900"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
>
<circle
className="opacity-25"
cx="12"
cy="12"
r="10"
stroke="currentColor"
strokeWidth="4"
/>
<path
className="opacity-75"
fill="currentColor"
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
/>
</svg>
</div>
)}
<iframe
src="https://tally.so/embed/w447O5?alignLeft=1&hideTitle=1&transparentBackground=1"
width="100%"
height="480"
title="AUSG로 문의하기"
className="z-10"
onLoad={() => setIsLoaded(true)}
/>
</FadeIn>
);
}
38 changes: 38 additions & 0 deletions src/app/components/ContactSection/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use client";

import { motion, Variants } from "framer-motion";
import { useInView } from "react-intersection-observer";
import SectionTitle from "../SectionTitle";
import Contact from "./Contact";

const container: Variants = {
visible: {
transition: {
staggerChildren: 0.15,
delayChildren: 0.15,
},
},
};

export default function ContactSection() {
const { ref, inView } = useInView({
threshold: 0.1,
});

return (
<motion.section
className="relative"
ref={ref}
animate={inView ? "visible" : "hidden"}
variants={container}
>
<div className="container m-auto flex flex-col items-center px-5 pb-16">
<SectionTitle
title="Contact"
description={`궁금한게 있다면 언제든지 질문 받습니다`}
/>
<Contact />
</div>
</motion.section>
);
}
2 changes: 1 addition & 1 deletion src/app/components/FAQSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function FAQSection() {
animate={inView ? "visible" : "hidden"}
variants={container}
>
<div className="container m-auto flex flex-col items-center px-5 pb-16">
<div className="container m-auto flex flex-col items-center px-5 pb-44">
<SectionTitle title="FAQ" description={`자주 묻는 질문을 모았습니다`} />
<FAQList />
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Backdrop from "./components/Backdrop";
import Background from "./components/Background";
import ContactSection from "./components/ContactSection";
import FAQSection from "./components/FAQSection";
import Footer from "./components/Footer";
import HeroSection from "./components/HeroSection";
Expand All @@ -16,6 +17,7 @@ export default function Home() {
<SponsorSection />
<MapSection />
<FAQSection />
<ContactSection />
<Background />
<Footer />
</Backdrop>
Expand Down

0 comments on commit b1a65cf

Please sign in to comment.