Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
cd90b74
KW-341/feat: 내 출입증 목록 조회 API 연동 완료
js4939 May 13, 2025
dc5f05b
KW-341/feat: 디벨롭 브런치 내용 pull
jiwon0226 May 15, 2025
0e68b5e
KW-341/fix: 출입 권한 조회 페이지 수정
jiwon0226 May 15, 2025
29a3183
KW-341/feat: 데이터 가공 함수 적용, 발급일 추가
jiwon0226 May 16, 2025
8627fe2
KW-341/fix: QR 카드에 시작일과 만료일 추가, nomalListDeep 컴포넌트에서 itemBox 스타일의 일부 …
jiwon0226 May 16, 2025
122da5c
KW-341/feat: 출입증 개수 8개 이상일 때를 대비하여) 도트 페이지네이션 및 도트 코드 오류 수정
jiwon0226 May 16, 2025
82c354b
KW-341/fix: logo 이미지 수정
jiwon0226 May 16, 2025
5e2b018
KW-341/fix: 출입 권한 상세 조회 모달에 스크롤뷰 추가 및 환자, 보호자 표시 수정, 메인페이지 QR에 스크롤뷰 추…
jiwon0226 May 16, 2025
3ef0390
Merge branch 'develop' of https://github.com/TeamDoubleO/FE-Mobile in…
jiwon0226 May 16, 2025
fb12ae9
KW-341/fix: 머지에러 수정
jiwon0226 May 17, 2025
4093627
Merge branch 'develop' of https://github.com/TeamDoubleO/FE-Mobile in…
jiwon0226 May 17, 2025
cdc16ac
KW-341/fix: '출입 가능' 상태 일 때만 qr이동 버튼 노출 시키기
jiwon0226 May 20, 2025
949b120
KW-341/fix: css 수정
jiwon0226 May 20, 2025
c00ede4
KW-341/fix: 방문증 신청 후 뒤로가기 못하게 수정
jiwon0226 May 20, 2025
cb65b48
KW-341/feat: 목업데이터 분리, main에 userVC 임시 생성기 설정 및 필요한 함수 추가
jiwon0226 May 20, 2025
360a86f
KW-341/fix: 출입 가능한 건에 대해서만 메인에 노출되도록 수정
jiwon0226 May 20, 2025
4dc567e
KW-341/feat: 권한 상세 조회 모달의 qr 이동 버튼 클릭시, 해당 qr로 이동
jiwon0226 May 20, 2025
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
2 changes: 0 additions & 2 deletions components/cards/QrCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { View, Text, Image, ScrollView } from 'react-native';
import { useNavigation } from '@react-navigation/native';
import QRCode from 'react-native-qrcode-svg';

import NormalButton from '../../components/buttons/NormalButton';
import { styles } from './styles/QrCard.styles';
import { colors } from '../../constants/colors';
import { hospitalName } from '../../mocks/hospitalData';

// hasAccessAuthority: 출입 권한 여부, userVC : VC에 담을 사용자 정보, qrData : QR에 담을 JSON 문자열
const QrCard = ({ hasAccessAuthority, did, userName, hospitalName, startDate, expireDate }) => {
Expand Down
15 changes: 12 additions & 3 deletions components/cards/QrCards.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useRef, useState } from 'react';
import React, { useRef, useState, useEffect } from 'react';
import { FlatList, View, Dimensions, TouchableOpacity } from 'react-native';
import QrCard from './QrCard';
import styles from './styles/QrCards.styles';
Expand All @@ -9,10 +9,19 @@ const { width } = Dimensions.get('window');
const CARD_WIDTH = width;
const OVERLAP = 80; // 카드가 겹치는 정도

const QrCards = ({ userVC, hasAccessAuthority }) => {
const [pageIndex, setPageIndex] = useState(0);
const QrCards = ({ userVC, hasAccessAuthority, initialIndex = 0 }) => {
const [pageIndex, setPageIndex] = useState(initialIndex);
const flatListRef = useRef(null);

useEffect(() => {
// 초기 인덱스가 바뀌거나, userVC 길이 변화시
if (flatListRef.current && initialIndex >= 0 && initialIndex < userVC.length) {
const offset = initialIndex * (CARD_WIDTH - OVERLAP);
flatListRef.current.scrollToOffset({ offset, animated: true });
setPageIndex(initialIndex);
}
}, [initialIndex, userVC.length]);

// 권한 없거나 카드 데이터 없으면 안내 메시지 카드만
if (!hasAccessAuthority || !userVC || userVC.length === 0) {
return (
Expand Down
124 changes: 0 additions & 124 deletions mocks/MyAccessListSample.js

This file was deleted.

76 changes: 76 additions & 0 deletions mocks/mockAccessList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
export const mockAccessList = [
{
passId: 4,
memberId: 1,
hospitalId: 1,
accessAreaNames: [
'본관 5층 내과병동 501호',
'본관 5층 내과병동 502호',
'본관 5층 내과병동 503호',
],
visitCategory: 'PATIENT',
patientId: 9,
startedAt: '2025-05-20T06:35:05',
expiredAt: '2025-05-22T06:33:09',
},
{
passId: 5,
memberId: 1,
hospitalId: 1,
accessAreaNames: ['신관 3층 외과병동 301호', '신관 4층 외과병동 402호'],
visitCategory: 'PATIENT',
patientId: 9,
startedAt: '2025-05-21T08:06:27',
expiredAt: '2025-05-22T08:06:00',
},
{
passId: 6,
memberId: 1,
hospitalId: 2,
accessAreaNames: ['암센터 7층 항암치료실 701호'],
visitCategory: 'GUARDIAN',
patientId: 10,
startedAt: '2025-05-15T08:08:15',
expiredAt: '2025-05-17T08:06:54',
},
{
passId: 7,
memberId: 1,
hospitalId: 3,
accessAreaNames: ['본관 3층 내과병동 305호', '본관 4층 외과병동 410호'],
visitCategory: 'GUARDIAN',
patientId: 10,
startedAt: '2025-05-17T08:08:15',
expiredAt: '2025-05-18T08:06:54',
},
{
passId: 8,
memberId: 1,
hospitalId: 3,
accessAreaNames: ['소망관 3층 응급의학과 외상전용 수술실 320호'],
visitCategory: 'GUARDIAN',
patientId: 10,
startedAt: '2025-05-15T08:08:15',
expiredAt: '2025-06-16T08:06:54',
},
{
passId: 9,
memberId: 1,
hospitalId: 3,
accessAreaNames: ['소망관 3층 응급의학과 외상전용 수술실 320호'],
visitCategory: 'GUARDIAN',
patientId: 10,
startedAt: '2025-05-15T08:08:15',
expiredAt: '2025-06-19T08:06:54',
},
{
passId: 10,
memberId: 1,
hospitalId: 8,
accessAreaNames: ['소망관 3층 지수전용 320호'],
visitCategory: 'GUARDIAN',
patientId: 10,
startedAt: '2025-05-15T08:08:15',
expiredAt: '2025-06-19T08:06:54',
},
];
13 changes: 9 additions & 4 deletions modals/MyAccessDetailModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const MyAccessDetailModal = ({ isVisible, onClose, onConfirm, data }) => {
? '내 환자'
: '상대방';

// QR 버튼 노출 조건
const isQrAvailable = data.approval === '출입 가능';

return (
<Modal isVisible={isVisible} onBackdropPress={onClose}>
<View style={styles.modalContainer}>
Expand All @@ -31,8 +34,8 @@ const MyAccessDetailModal = ({ isVisible, onClose, onConfirm, data }) => {
<Text style={styles.modalText}>승인 여부: {data.approval}</Text>
<Text style={styles.modalText}>환자 번호: {data.patientNumber}</Text>
</View>
<Text style={styles.modalContentTitle}>{relationTitle}</Text>
<View style={styles.textContainer}>
<Text style={styles.modalContentTitle}>{relationTitle}</Text>
<Text style={styles.modalText}>{`김지수\t|\t010-0000-0000`}</Text>
<Text style={styles.modalText}>{`손민지\t|\t010-1111-1111`}</Text>
</View>
Expand All @@ -42,9 +45,11 @@ const MyAccessDetailModal = ({ isVisible, onClose, onConfirm, data }) => {
<TouchableOpacity style={[styles.button, styles.cancelButton]} onPress={onClose}>
<Text style={styles.buttonText}>닫기</Text>
</TouchableOpacity>
<TouchableOpacity style={[styles.button, styles.QRButton]} onPress={onConfirm}>
<Text style={styles.buttonText}>QR</Text>
</TouchableOpacity>
{isQrAvailable && (
<TouchableOpacity style={[styles.button, styles.QRButton]} onPress={onConfirm}>
<Text style={styles.buttonText}>QR</Text>
</TouchableOpacity>
)}
</View>
</View>
</Modal>
Expand Down
11 changes: 6 additions & 5 deletions modals/styles/MyAccessDetailModal.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ export const styles = StyleSheet.create({
fontSize: 22,
fontWeight: '600',
color: colors.black,
marginTop: '7%',
marginTop: '10%',
alignSelf: 'center',
},
modalContentTitle: {
fontSize: 17,
fontWeight: '500',
color: colors.black,
marginTop: '5%',
marginVertical: '5%',
alignSelf: 'center',
},
textContainer: {
marginTop: '3%',
marginBottom: '7%',
marginTop: '7%',
marginBottom: '5%',
gap: '3%',
},
modalText: {
fontSize: 17,
Expand All @@ -41,7 +42,7 @@ export const styles = StyleSheet.create({
flexDirection: 'row',
justifyContent: 'center',
alignSelf: 'stretch',
// marginVertical: '7%',
marginVertical: '7%',
gap: '5%',
},
button: {
Expand Down
9 changes: 8 additions & 1 deletion pages/AccessRequestRolePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ const AccessRequestRolePage = ({ route }) => {

const navigation = useNavigation();

const navigateToHome = () => {
navigation.reset({
index: 0,
routes: [{ name: 'MainPage' }],
});
};

const handlePatientButton = () => {
setIsVerified(false);
setVerifiedData(null);
Expand Down Expand Up @@ -92,7 +99,7 @@ const AccessRequestRolePage = ({ route }) => {
setShowSuccessAlert(false);

// 메인 페이지로 이동되도록 설정
navigation.navigate('MainPage');
navigateToHome();
};

return (
Expand Down
Loading