-
- QR 코드를 카메라에 비춰주세요
+
+ {isProcessing ? '처리 중...' : 'QR 코드를 카메라에 비춰주세요!'}
)}
-
-
diff --git a/src/index.css b/src/index.css
index de05862..96cedbf 100644
--- a/src/index.css
+++ b/src/index.css
@@ -37,6 +37,10 @@
.font-size-20px {
font-size: 20px;
}
+
+ .font-size-18px {
+ font-size: 218px;
+ }
.font-size-16px {
font-size: 16px;
@@ -121,6 +125,27 @@
background-color: var(--gray-20);
}
+ /* Hover Background Color Classes */
+ .hover\\:bg-gray-90:hover {
+ background-color: var(--gray-90);
+ }
+
+ .hover\\:bg-gray-60:hover {
+ background-color: var(--gray-60);
+ }
+
+ .hover\\:bg-gray-50:hover {
+ background-color: var(--gray-50);
+ }
+
+ .hover\\:bg-gray-30:hover {
+ background-color: var(--gray-30);
+ }
+
+ .hover\\:bg-gray-20:hover {
+ background-color: var(--gray-20);
+ }
+
/* Border Color Classes */
.border-gray-30 {
border-color: var(--gray-30);
diff --git a/src/page/event.tsx b/src/page/event.tsx
index da3448e..c476749 100644
--- a/src/page/event.tsx
+++ b/src/page/event.tsx
@@ -3,14 +3,14 @@ import EventTable from "../components/EventTable";
import Header from "../components/Header";
import SearchBar from "../components/Search";
import { useAuthGuard } from '../hooks/useAuthGuard';
-import { GetActivities } from '../api/activity/get-activities';
-import type { Activity } from '../api/activity/get-activities';
+import { GetActivities, type Activity } from '../api/activity/get-activities';
const Event: React.FC = () => {
const { isLoading, isAuthenticated } = useAuthGuard();
const [activities, setActivities] = useState
([]);
useEffect(() => {
+ // 활동 목록 전체 조회
const fetchActivities = async () => {
try {
const data = await GetActivities();
@@ -20,6 +20,7 @@ const Event: React.FC = () => {
}
};
+ // 권한 확인
if (isAuthenticated) {
fetchActivities();
}
From 1b12a4a21bef135d2374a397e1cdc61eb24a7182 Mon Sep 17 00:00:00 2001
From: seyun31 <2ne1jenna@naver.com>
Date: Tue, 9 Sep 2025 04:23:22 +0900
Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=ED=99=9C=EB=8F=99=20=EC=B0=B8?=
=?UTF-8?q?=EC=97=AC=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/activity/post-memebr-activities.ts | 2 +-
src/components/QRScanner.tsx | 35 +++++++---------------
2 files changed, 12 insertions(+), 25 deletions(-)
diff --git a/src/api/activity/post-memebr-activities.ts b/src/api/activity/post-memebr-activities.ts
index cb60f8a..3b48e8d 100644
--- a/src/api/activity/post-memebr-activities.ts
+++ b/src/api/activity/post-memebr-activities.ts
@@ -12,7 +12,7 @@ export async function PostMemberActivities(activityId: number, memberId: number)
memberId
};
- const res = await fetch(`${API_BASE_URL}/admin/acitivity-participation`, {
+ const res = await fetch(`${API_BASE_URL}/admin/activity-participation`, {
method: 'POST',
credentials: 'include',
headers: {
diff --git a/src/components/QRScanner.tsx b/src/components/QRScanner.tsx
index ca4bf4d..b654cc4 100644
--- a/src/components/QRScanner.tsx
+++ b/src/components/QRScanner.tsx
@@ -16,20 +16,11 @@ const QRScannerComponent: React.FC = ({ onClose }) => {
const lastScanTime = useRef(0);
const isThrottled = useRef(false);
- const handleBackButton = useCallback(() => {
+ const handleClose = useCallback(() => {
// 뒤로가기 버튼 클릭 시 카메라를 종료하지 않고 모달만 닫기
onClose();
}, [onClose]);
- const handleClose = useCallback(() => {
- // X 버튼이나 에러 발생 시 카메라 완전 종료
- if (scanner) {
- scanner.stop();
- scanner.destroy();
- }
- onClose();
- }, [scanner, onClose]);
-
const handleQRResult = useCallback(async (uuid: string) => {
const currentTime = Date.now();
@@ -78,30 +69,26 @@ const QRScannerComponent: React.FC = ({ onClose }) => {
const success = await PostMemberActivities(parseInt(storedActivityId), qrResult.data.memberId);
if (success) {
alert(`${qrResult.data.name}님이 참석했습니다.`);
- setIsProcessing(false);
- // 성공 후 2초 후에 다시 스캔 가능하도록 설정
+ // 성공 후 다시 스캔 가능하도록 설정
setTimeout(() => {
+ setIsProcessing(false);
isThrottled.current = false;
lastProcessedQR.current = '';
lastScanTime.current = 0;
}, 1000);
} else {
- setError('활동 참여 등록에 실패했습니다.');
+ alert('활동 참여 등록에 실패했습니다. 다시 시도해주세요.');
setIsProcessing(false);
isThrottled.current = false;
}
} catch (error) {
console.error('QR 코드 처리 중 오류 발생:', error);
- alert('QR 코드 처리 중 오류가 발생했습니다.');
+ alert('QR 코드 처리 중 오류가 발생했습니다. 다시 시도해주세요.');
+ setIsProcessing(false);
isThrottled.current = false;
- if (scanner) {
- scanner.stop();
- scanner.destroy();
- }
- onClose();
}
- }, []);
+ }, [scanner, onClose]);
useEffect(() => {
if (!videoRef.current) return;
@@ -152,21 +139,21 @@ const QRScannerComponent: React.FC = ({ onClose }) => {