Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 5 additions & 3 deletions src/app/(main)/teampsylog/_components/BottomComment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface BottomSheetProps {
}

const BottomComment = ({ isOpen, onClose, children }: BottomSheetProps) => {
const sheetHeight = Math.round(typeof window !== 'undefined' ? window.innerHeight * 0.7 : 500);

const {
dragCurrentY,
isDragging,
Expand All @@ -20,7 +22,7 @@ const BottomComment = ({ isOpen, onClose, children }: BottomSheetProps) => {
handleTouchEnd,
handleClose,
shouldShow,
} = useBottomSheetDrag({ isOpen, onClose });
} = useBottomSheetDrag({ isOpen, onClose, sheetHeight });

return (
<>
Expand All @@ -38,8 +40,8 @@ const BottomComment = ({ isOpen, onClose, children }: BottomSheetProps) => {
<div
className="desktop:hidden fixed inset-x-0 bottom-0 z-50 rounded-t-2xl bg-gray-200"
style={{
height: '80vh',
maxHeight: '80vh',
height: '70vh',
maxHeight: '70vh',
transform: isDragging
? `translateY(${dragCurrentY}px)`
: isOpen && !isClosing
Expand Down
11 changes: 7 additions & 4 deletions src/app/(main)/teampsylog/_components/useBottomSheetDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { useCallback, useEffect, useRef, useState } from 'react';
interface UseBottomSheetDragProps {
isOpen: boolean;
onClose: () => void;
sheetHeight: number;
}

const useBottomSheetDrag = ({ isOpen, onClose }: UseBottomSheetDragProps) => {
const useBottomSheetDrag = ({ isOpen, onClose, sheetHeight }: UseBottomSheetDragProps) => {
const closeTimerRef = useRef<NodeJS.Timeout | null>(null);
const closeThreshold = sheetHeight * 0.24;

const [dragStartY, setDragStartY] = useState(0);
const [dragCurrentY, setDragCurrentY] = useState(0);
Expand Down Expand Up @@ -46,14 +48,14 @@ const useBottomSheetDrag = ({ isOpen, onClose }: UseBottomSheetDragProps) => {

const handleMouseUp = useCallback(() => {
if (!isDragging) return;
if (dragCurrentY > 150) {
if (dragCurrentY > closeThreshold) {
handleClose();
setDragCurrentY(0);
} else {
setDragCurrentY(0);
}
setIsDragging(false);
}, [isDragging, dragCurrentY, handleClose]);
}, [isDragging, dragCurrentY, handleClose, closeThreshold]);

const handleTouchStart = (e: React.TouchEvent) => {
setDragStartY(e.touches[0].clientY);
Expand All @@ -65,13 +67,14 @@ const useBottomSheetDrag = ({ isOpen, onClose }: UseBottomSheetDragProps) => {
const currentY = e.touches[0].clientY;
const diff = currentY - dragStartY;
if (diff > 0) {
e.preventDefault();
setDragCurrentY(diff);
}
};

const handleTouchEnd = () => {
if (!isDragging) return;
if (dragCurrentY > 150) {
if (dragCurrentY > closeThreshold) {
handleClose();
setDragCurrentY(0);
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const Footer = () => {
</div>
<div className="flex items-center justify-between px-4">
<div>
<p className="body-11 text-gray-500">Teamficial@gmail.com</p>
<p className="body-11 text-gray-500">teamficial25@gmail.com</p>
<p className="body-11 text-gray-500">© 2025.Teamficial. ALL rights reserved.</p>
</div>
<div className="flex gap-2">
Expand Down Expand Up @@ -66,12 +66,12 @@ const Footer = () => {
<div className="flex w-[944px] items-center justify-between">
<div className="body-6 flex flex-col text-gray-100">
<Image src="/icons/footer-logo.svg" alt="logo" width={149} height={19} />
<p className="pb-1">Teamficial@gmail.com</p>
<p className="pb-1">teamficial25@gmail.com</p>
<p>© 2025.Teamficial. ALL rights reserved.</p>
</div>
<div className="flex flex-col justify-end gap-3">
<div className="flex justify-end gap-3">
<a href="mailto:Teamficial@gmail.com" aria-label="이메일 문의">
<a href="mailto:teamficial25@gmail.com" aria-label="이메일 문의">
<Image src="/icons/mail.svg" alt="mail" width={24} height={24} />
</a>
<a
Expand Down