-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from softeerbootcamp4th/feature/13-fcfs
[feat, fix, refactor] 선착순 안내 경품 섹션 추가, 각종 버그 수정
- Loading branch information
Showing
54 changed files
with
554 additions
and
373 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Button from "./Button.jsx"; | ||
import RefreshIcon from "./assets/refresh.svg?react"; | ||
|
||
export default function ResetButton({ onClick }) { | ||
return ( | ||
<Button | ||
onClick={onClick} | ||
styleType="ghost" | ||
backdrop="dark" | ||
className="p-1 xl:p-2" | ||
> | ||
<RefreshIcon /> | ||
</Button> | ||
); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,62 @@ | ||
import { useEffect } from "react"; | ||
import { useState, useRef, useEffect, useCallback } from "react"; | ||
import throttleRaf from "@/common/throttleRaf.js"; | ||
|
||
function useMountDragEvent(dragging, dragEnd) { | ||
function useMountDragEvent({ | ||
onDragStart: userDragStart, | ||
onDrag, | ||
onDragEnd: userDragEnd, | ||
} = {}) { | ||
const [dragState, setDragState] = useState(false); | ||
const isDragging = useRef(false); | ||
|
||
useEffect(() => { | ||
const onPointerMove = throttleRaf((e) => { | ||
if (e.pointerType === "touch") return; | ||
if (!isDragging.current) return; | ||
const { clientX, clientY } = e; | ||
dragging({ x: clientX, y: clientY }); | ||
onDrag({ x: clientX, y: clientY }); | ||
}); | ||
const onTouchMove = throttleRaf((e) => { | ||
const { clientX, clientY } = e.touches[0]; | ||
dragging({ x: clientX, y: clientY }); | ||
if (!isDragging.current) return; | ||
onDrag({ x: clientX, y: clientY }); | ||
}); | ||
const onDragEnd = (e) => { | ||
if (!isDragging.current) return; | ||
isDragging.current = false; | ||
setDragState(false); | ||
userDragEnd?.(e); | ||
}; | ||
|
||
window.addEventListener("pointermove", onPointerMove); | ||
window.addEventListener("pointerup", dragEnd); | ||
window.addEventListener("pointercancel", dragEnd); | ||
window.addEventListener("pointerup", onDragEnd); | ||
window.addEventListener("pointercancel", onDragEnd); | ||
window.addEventListener("touchmove", onTouchMove); | ||
window.addEventListener("touchend", dragEnd); | ||
window.addEventListener("touchcancel", dragEnd); | ||
window.addEventListener("touchend", onDragEnd); | ||
window.addEventListener("touchcancel", onDragEnd); | ||
return () => { | ||
window.removeEventListener("pointermove", onPointerMove); | ||
window.removeEventListener("pointerup", dragEnd); | ||
window.removeEventListener("pointercancel", dragEnd); | ||
window.removeEventListener("pointerup", onDragEnd); | ||
window.removeEventListener("pointercancel", onDragEnd); | ||
window.removeEventListener("touchmove", onTouchMove); | ||
window.removeEventListener("touchend", dragEnd); | ||
window.removeEventListener("touchcancel", dragEnd); | ||
window.removeEventListener("touchend", onDragEnd); | ||
window.removeEventListener("touchcancel", onDragEnd); | ||
}; | ||
}, [dragging, dragEnd]); | ||
}, [onDrag, userDragEnd]); | ||
|
||
const onPointerDown = useCallback( | ||
(e) => { | ||
isDragging.current = true; | ||
setDragState(true); | ||
userDragStart?.({ x: e.clientX, y: e.clientY }); | ||
}, | ||
[userDragStart], | ||
); | ||
|
||
return { | ||
onPointerDown, | ||
dragState, | ||
}; | ||
} | ||
|
||
export default useMountDragEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import EventDetail from "./EventDetail.jsx"; | ||
|
||
function EventDescriptionLayout({ detail, children }) { | ||
return ( | ||
<div className="w-full md:w-[640px] lg:w-full max-w-[1200px] flex flex-col justify-between lg:flex-row gap-16 lg:gap-10 xl:gap-16"> | ||
<EventDetail {...detail} /> | ||
<div className="flex flex-col gap-10 w-full lg:w-1/2 lg:max-w-[510px]"> | ||
<h4 className="text-body-l font-bold text-white">경품 안내</h4> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default EventDescriptionLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.