Skip to content

Commit accdb36

Browse files
committed
WIP
1 parent 5955689 commit accdb36

File tree

8 files changed

+73
-24
lines changed

8 files changed

+73
-24
lines changed

src/components/index.tsx

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Cell from './cell';
2+
import TextInput from './textInput';
3+
import TabBarIcon from './tabBarIcon';
4+
5+
export { Cell, TextInput, TabBarIcon}

src/components/textInput.tsx

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React, { useState } from 'react';
2+
import { View, StyleSheet } from "react-native";
3+
import { Colors } from '../assets';
4+
5+
export default function TextInput(props: any) {
6+
const {placeholder} = props
7+
const [hasFocus, setHasFocus] = useState(false)
8+
return (
9+
<View style={styles.container}>
10+
<TextInput
11+
placeholderTextColor={Colors.lightgrey}
12+
multiline={false}
13+
keyboardType='default'
14+
textContentType='none'
15+
autoCapitalize='none'
16+
returnKeyType='done'
17+
autoCorrect={false}
18+
clearButtonMode='never'
19+
autoFocus={false}
20+
selectionColor={Colors.mintcream}
21+
style={styles.input}
22+
placeholder={hasFocus ? undefined : placeholder}
23+
underlineColorAndroid={'transparent'}
24+
onFocus={() => {
25+
setHasFocus(true)
26+
}}
27+
/>
28+
</View>
29+
)
30+
}
31+
32+
const styles = StyleSheet.create({
33+
container: {
34+
alignSelf: 'stretch',
35+
marginHorizontal: 16
36+
},
37+
input: {
38+
width: '100%'
39+
}
40+
})

src/navigation/MainTabNavigator.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
33
import { StatsStack, BookListsStack, AccountStack } from './index';
4-
import { Colors, Images } from '../assets/';
4+
import { Colors, Images } from '../assets';
55
import TabBarIcon, { tabBarIconArguments } from '../components/tabBarIcon';
66

77

src/navigation/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import AccountStack from './AccountStack';
22
import BookListsStack from './BookListsStack';
33
import StatsStack from './StatsStack';
4-
import MainTabNavigator from './MainTabNavigator';
4+
import MainTabNavigator from './MainTabNavigator';
55

66
const ScreenNames = {
77
NEW_BOOK: "Book",

src/screens/books/bookList.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { SectionList, Text, View, StyleSheet, Alert } from "react-native";
2+
import { SectionList, Text, View, StyleSheet } from "react-native";
33
import { Colors, Images } from '../../assets';
44
import { Divider } from 'react-native-elements';
55
import Cell, { CellProps, CellDivider } from '../../components/cell';

src/screens/notes/note.tsx

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
import * as React from 'react';
2-
import { TextInput } from "react-native-gesture-handler";
3-
import { Strings } from "../../assets";
4-
import { View, Text, StyleSheet } from "react-native";
2+
import { TextInput } from '../../components';
3+
import { Strings } from '../../assets';
4+
import { View, Text, StyleSheet, KeyboardAvoidingView } from "react-native";
55

66
export default function Note (props: any) {
77
return (
8-
<View>
9-
<Text style={styles.title}>{"New Note Test String"}</Text>
10-
<TextInput
11-
defaultValue={Strings.exampleTitle}
12-
/>
13-
<Text style={styles.author}>{Strings.Author}</Text>
14-
<TextInput
15-
defaultValue={Strings.exampleAuthor}
16-
/>
17-
<Text style={styles.pages}>{Strings.NumPages}</Text>
18-
<TextInput
19-
defaultValue={Strings.exampleNumPages}
20-
/>
21-
</View>
8+
<KeyboardAvoidingView behavior='padding' keyboardVerticalOffset={20}>
9+
<View>
10+
<Text style={styles.title}>{"New Note Test String"}</Text>
11+
<TextInput
12+
placeholder={Strings.exampleTitle}
13+
/>
14+
<Text style={styles.author}>{Strings.Author}</Text>
15+
<TextInput
16+
defaultValue={Strings.exampleAuthor}
17+
/>
18+
<Text style={styles.pages}>{Strings.NumPages}</Text>
19+
<TextInput
20+
defaultValue={Strings.exampleNumPages}
21+
/>
22+
</View>
23+
</KeyboardAvoidingView>
2224
)
2325
}
2426

src/screens/notes/noteList.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
2-
import { StyleSheet, View, SectionList, TouchableHighlight, Text, Alert } from 'react-native';
2+
import { StyleSheet, View, SectionList, TouchableHighlight, Text } from 'react-native';
33
import EmptyNoteList from '../notes/emptyNoteList';
4-
import { CellDivider, CellProps } from '../../components/cell';
4+
import { CellDivider } from '../../components/cell';
55
import { Colors } from 'react-native/Libraries/NewAppScreen';
66
import { ScreenNames } from '../../navigation';
77
import { deviceWidth } from '../../utilities';

tsconfig.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
"moduleResolution": "node",
1616
"baseUrl": "./",
1717
"paths": {
18-
"@assets/*": ["src/assets/*"],
19-
"@components/*": ["src/components/*"],
18+
"@assets": ["./src/assets"],
19+
"@assets/*": ["./src/assets/*"],
20+
"@components": ["./src/components"],
21+
"@components/*": ["./src/components/*"],
2022
},
2123
"experimentalDecorators": true,
2224
"emitDecoratorMetadata": true,

0 commit comments

Comments
 (0)