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
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:icon="@mipmap/ic_launcher_foreground"
android:roundIcon="@mipmap/ic_launcher_foreground"
android:allowBackup="false"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:usesCleartextTraffic="true">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_stat_keywe"/>
Expand Down
22 changes: 16 additions & 6 deletions src/pages/AccessRequestRolePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,22 @@ const AccessRequestRolePage = ({ route }) => {
{isVerified && (
<>
<Text style={styles.contentTitle}>방문 일시 선택</Text>
<NormalCheckbox labels={availableDates} onChangeHandler={handleDateCheckbox} />
<NormalButton
title="방문증 신청"
onPressHandler={handleSubmitButton}
style={styles.submitButton}
/>
{availableDates.length === 0 && (
<>
<Text style={styles.noDatesText}>선택 가능한 방문일시가 없습니다.</Text>
<NormalButton title="방문증 신청" style={styles.submitButton} isDisabled={true} />
</>
)}
{availableDates.length > 0 && (
<>
<NormalCheckbox labels={availableDates} onChangeHandler={handleDateCheckbox} />
<NormalButton
title="방문증 신청"
onPressHandler={handleSubmitButton}
style={styles.submitButton}
/>
</>
)}
</>
)}
</View>
Expand Down
9 changes: 3 additions & 6 deletions src/pages/MainPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@ import { View, Image } from 'react-native';
import { useNavigation, useRoute, useFocusEffect } from '@react-navigation/native';
import { getAccessList } from '../apis/MyAccessListApi';
import { getHospitalList } from '../apis/AccessRequestApi';
import { getMyInfo } from '../apis/MyPageApi';
import { mockAccessList } from '../mocks/mockAccessList';
import { useAuthStore } from '../stores/authStore';
import { useNormalAlertStore } from '../stores/alertStore';
import { styles } from './styles/MainPage.styles';
import QrCards from '../components/cards/QrCards';
import NormalButton from '../components/buttons/NormalButton';

// TODO: 리펙토링 할 때 같은 코드는 export해서 import해서 쓰기
// 병원 Id로 병원 이름 찾기
Expand Down Expand Up @@ -94,7 +91,7 @@ function isQrAvailable(item) {
}

const MainPage = () => {
const { setLoading } = useAuthStore();
const { setLoading, userInfo } = useAuthStore();
const showNormalAlert = useNormalAlertStore.getState().showNormalAlert;

// 임시: 상태변수로 출입 권한 제어
Expand Down Expand Up @@ -130,9 +127,9 @@ const MainPage = () => {

try {
// 병원, 유저 정보 병렬로 불러오기
const [hospitalList, myInfo] = await Promise.all([getHospitalList(), getMyInfo()]);
const hospitalList = await getHospitalList();
setHospitalNameList(hospitalList);
setUserName(myInfo.name);
setUserName(userInfo?.name || '이름 로딩 중 . . .');

const accessList = await getAccessList();
setMyAccessList(accessList);
Expand Down
7 changes: 7 additions & 0 deletions src/pages/styles/AccessRequestRolePage.styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,11 @@ export const styles = StyleSheet.create({
marginTop: '10%',
marginBottom: 50,
},
noDatesText: {
...fonts.smallText,
color: colors.darkGray,
alignSelf: 'center',
marginTop: '5%',
marginBottom: '3%',
},
});