Skip to content

Commit

Permalink
Merge pull request #29 from AUTO-Overnight/28-bug-sdk-version
Browse files Browse the repository at this point in the history
chore: Upgrade sdk to 43.0.0, feat: Add render drawerContent in Login Page
  • Loading branch information
ww8007 authored May 11, 2022
2 parents ef7c406 + ba2907b commit ae3d6f2
Show file tree
Hide file tree
Showing 5 changed files with 1,446 additions and 1,663 deletions.
48 changes: 24 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cacheDirectory": ".jest/cache"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.15.6",
"@react-native-async-storage/async-storage": "~1.15.0",
"@react-native-community/masked-view": "0.1.10",
"@react-navigation/bottom-tabs": "^6.0.5",
"@react-navigation/drawer": "^6.1.4",
Expand All @@ -37,34 +37,34 @@
"@types/redux-actions": "^2.6.2",
"axios": "^0.21.1",
"dayjs": "^1.10.7",
"expo": "~42.0.1",
"expo-calendar": "~9.2.2",
"expo-font": "~9.2.1",
"expo-linear-gradient": "~9.2.0",
"expo-localization": "~10.2.0",
"expo-notifications": "~0.12.3",
"expo-screen-orientation": "~3.3.0",
"expo-status-bar": "~1.0.4",
"expo-updates": "~0.8.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz",
"react-native-appearance": "^0.3.4",
"expo": "^43.0.0",
"expo-calendar": "~10.0.3",
"expo-font": "~10.0.3",
"expo-linear-gradient": "~10.0.3",
"expo-localization": "~11.0.0",
"expo-notifications": "~0.13.3",
"expo-screen-orientation": "~4.0.3",
"expo-status-bar": "~1.1.0",
"expo-updates": "~0.10.15",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-appearance": "~0.3.3",
"react-native-calendars": "^1.1266.0",
"react-native-dotenv": "^3.2.0",
"react-native-dropdown-picker": "^5.2.3",
"react-native-gesture-handler": "^1.10.3",
"react-native-gesture-handler": "~1.10.2",
"react-native-iphone-x-helper": "^1.3.1",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-loading-spinner-overlay": "^3.0.0",
"react-native-paper": "^4.9.2",
"react-native-reanimated": "^2.2.0",
"react-native-safe-area-context": "3.2.0",
"react-native-screens": "~3.4.0",
"react-native-reanimated": "~2.2.0",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.8.0",
"react-native-status-bar-height": "^2.6.0",
"react-native-table-component": "^1.2.1",
"react-native-vector-icons": "^8.1.0",
"react-native-web": "~0.13.12",
"react-native-web": "0.17.1",
"react-redux": "^7.2.4",
"redux": "^4.1.1",
"redux-actions": "^2.6.5",
Expand All @@ -73,17 +73,17 @@
"redux-saga": "^1.1.3"
},
"devDependencies": {
"@babel/core": "^7.17.2",
"@babel/core": "^7.12.9",
"@babel/node": "^7.16.8",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/jest-native": "^4.0.4",
"@testing-library/react-native": "^9.0.0",
"@types/jest": "^27.4.0",
"@types/react": "~16.9.35",
"@types/react-dom": "^17.0.9",
"@types/react-native": "~0.63.2",
"@types/react": "~17.0.21",
"@types/react-dom": "~17.0.9",
"@types/react-native": "~0.64.12",
"@types/react-native-calendars": "^1.1264.2",
"@types/react-native-table-component": "^1.2.1",
"@types/react-native-vector-icons": "^6.4.8",
Expand All @@ -93,7 +93,7 @@
"jest": "^27.5.1",
"jest-plugin-context": "^2.9.0",
"ts-jest": "^27.1.3",
"typescript": "~4.0.0",
"typescript": "~4.3.5",
"yarn": "^1.22.17"
},
"private": true
Expand Down
2 changes: 1 addition & 1 deletion src/screens/DrawerContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const fontSize = 15;
const screen = Dimensions.get('screen');
const DrawerContent: FC<DrawerContentComponentProps> = (props) => {
const { name, id, pw, rememberID } = useSelector(({ login }: RootState) => ({
name: login.loginState.name,
name: login.name,
rememberID: login.rememberID,
id: login.id,
pw: login.pw
Expand Down
19 changes: 4 additions & 15 deletions src/screens/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
/* eslint-disable react-hooks/exhaustive-deps */
import React, { useState, useCallback, useRef, useEffect } from 'react';
import {
StyleSheet,
FlatList,
ScrollView,
Platform,
RefreshControl
} from 'react-native';
import {
useNavigation,
DrawerActions,
useTheme
} from '@react-navigation/native';
import Constants from 'expo-constants';
import { StyleSheet, FlatList, ScrollView, RefreshControl } from 'react-native';
import { useNavigation, DrawerActions } from '@react-navigation/native';

import * as Notifications from 'expo-notifications';
// prettier-ignore
import {SafeAreaView, View, NavigationHeader, MaterialCommunityIcon as Icon, TouchableView, Text, MaterialIcon} from '../theme';
import {
Buttons,
ModalCalendar,
ModalSetting,
ModalUpdate,
Spinner
ModalUpdate
} from '../components';

import type { LeftRightNavigationMethods } from '../components';
Expand Down
33 changes: 29 additions & 4 deletions src/screens/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import React, { useState } from 'react';
import { Platform, StyleSheet, Alert, ActivityIndicator } from 'react-native';
import {
Platform,
StyleSheet,
Alert,
ActivityIndicator,
Linking
} from 'react-native';
import {
SafeAreaView,
View,
Text,
TextInput,
TouchableView,
MaterialCommunityIcon as Icon,
Switch
Switch,
NavigationHeader
} from '../theme';

import { Switch as RNSwitch } from 'react-native';
import { useNavigation, useTheme } from '@react-navigation/native';
import {
useNavigation,
useTheme,
DrawerActions
} from '@react-navigation/native';
import { useAutoFocus, AutoFocusProvider } from '../contexts';
import { useDispatch, useSelector } from 'react-redux';
import { RootState } from '../store';
Expand All @@ -29,6 +39,7 @@ import {
import { useEffect } from 'react';
import { Colors } from 'react-native-paper';
import dayjs from 'dayjs';
import { TouchHeaderIconView } from '../theme/navigation/TouchHeaderIconView';
dayjs.extend(utc);
dayjs.extend(timezone);
const marginBottom = 35;
Expand Down Expand Up @@ -81,11 +92,25 @@ export default function MainNavigator() {
}
}, [loginError, name, loadingLogin]);

const open = useCallback(() => {
navigation.dispatch(DrawerActions.openDrawer());
}, []);
const isDark = useTheme().dark;
return (
<SafeAreaView
style={{ backgroundColor: isDark ? Colors.black : '#EDF3F7' }}
>
<NavigationHeader
title="로그인"
Left={() => (
<TouchHeaderIconView
underlayColor={isDark ? 'black' : '#EDF3F7'}
onPress={open}
>
<Icon name="menu" size={33} style={{ marginLeft: 10 }} />
</TouchHeaderIconView>
)}
/>
<View
style={[
styles.view,
Expand Down
Loading

0 comments on commit ae3d6f2

Please sign in to comment.