Skip to content

Commit

Permalink
[Feat] 초기 화면 메인 screen으로 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
SEEWON committed Dec 18, 2021
1 parent febcfb9 commit 35608d4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
2 changes: 2 additions & 0 deletions navigation/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const Tab = createBottomTabNavigator();
const Tabs = () => {
return (
<Tab.Navigator
initialRouteName='메인'
sceneContainerStyle={{
backgroundColor: 'white',
}}
Expand Down Expand Up @@ -52,6 +53,7 @@ const Tabs = () => {
name="메인"
component={Drawers}
options={{

headerShown: false,
tabBarIcon: ({ focused, color, size }) => {
return (
Expand Down
22 changes: 20 additions & 2 deletions screens/Home.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
import React, { useEffect } from 'react';
import { Text, View } from 'react-native';
import React, { useEffect, useState } from 'react';
import { Text, TextInput, View } from 'react-native';
import Search from '../components/Search';
import styled from 'styled-components/native';
import { useDispatch } from 'react-redux';
import { useSelector } from 'react-redux';

const Home = ({ navigation: { setOptions } }) => {
const [memoText, setMemoText] = useState('');

const submitMemo = () => {
alert('submitted');
};

useEffect(() => {
setOptions({
headerRight: () => <Search />,
});
});

return (
<View>
<Text>Home</Text>
<InputMemo
onChangeText={setMemoText}
value={memoText}
onSubmitEditing={submitMemo}
/>
</View>
);
};

const InputMemo = styled.TextInput`
border: 1px solid green;
`;

export default Home;

0 comments on commit 35608d4

Please sign in to comment.