fix list header

This commit is contained in:
ammarahm-ed
2020-12-06 15:14:38 +05:00
parent 7550830723
commit 2e2bc7ca7d
4 changed files with 21 additions and 19 deletions

View File

@@ -21,12 +21,12 @@ export const HeaderMenu = () => {
style={{ style={{
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
zIndex:10 zIndex:10,
height: 35,
}}> }}>
<Paragraph <Paragraph
style={{ style={{
marginRight: 5, marginRight: 5,
height: 35,
textAlignVertical:'center' textAlignVertical:'center'
}}> }}>
{settings.sort.slice(0, 1).toUpperCase() + {settings.sort.slice(0, 1).toUpperCase() +
@@ -39,7 +39,6 @@ export const HeaderMenu = () => {
} }
style={{ style={{
textAlignVertical:'center', textAlignVertical:'center',
height: 30,
}} }}
size={SIZE.md} size={SIZE.md}
/> />

View File

@@ -91,7 +91,7 @@ export default class NoteItem extends React.Component {
width: '92%', width: '92%',
paddingRight: 5, paddingRight: 5,
}}> }}>
{item.notebook && item.notebook.id && ( {item.notebooks && item.notebooks.length > 0 && (
<View <View
style={{ style={{
flexDirection: 'row', flexDirection: 'row',
@@ -135,7 +135,7 @@ export default class NoteItem extends React.Component {
color={ color={
item.colors[0] ? COLORS_NOTE[item.colors[0]] : colors.accent item.colors[0] ? COLORS_NOTE[item.colors[0]] : colors.accent
}> }>
{db.notebooks.notebook(item.notebook.id).title} {db.notebooks.notebook(item.notebooks[0].id).title}
</Heading> </Heading>
</TouchableOpacity> </TouchableOpacity>
</View> </View>

View File

@@ -6,6 +6,7 @@ import {
useWindowDimensions, useWindowDimensions,
View, View,
} from 'react-native'; } from 'react-native';
import {TouchableWithoutFeedback} from 'react-native-gesture-handler';
import {useSafeAreaInsets} from 'react-native-safe-area-context'; import {useSafeAreaInsets} from 'react-native-safe-area-context';
import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview'; import {DataProvider, LayoutProvider, RecyclerListView} from 'recyclerlistview';
import {useTracked} from '../../provider'; import {useTracked} from '../../provider';
@@ -87,21 +88,27 @@ const SimpleList = ({
paddingHorizontal: 12, paddingHorizontal: 12,
height: 35, height: 35,
}}> }}>
<Paragraph <TouchableWithoutFeedback
onPress={() => { onPress={() => {
if (jumpToDialog) { if (jumpToDialog) {
eSendEvent(eOpenJumpToDialog); eSendEvent(eOpenJumpToDialog);
} }
}} }}
hitSlop={{top: 10, left: 10, right: 30, bottom: 15}}
style={{
height: '100%',
justifyContent: 'center',
}}>
<Paragraph
color={colors.accent} color={colors.accent}
style={{ style={{
height: 35,
minWidth: 60, minWidth: 60,
alignSelf: 'center', alignSelf: 'center',
textAlignVertical: 'center', textAlignVertical: 'center',
}}> }}>
{item.title} {item.title}
</Paragraph> </Paragraph>
</TouchableWithoutFeedback>
{index === 1 && sortMenuButton ? <HeaderMenu /> : null} {index === 1 && sortMenuButton ? <HeaderMenu /> : null}
</View> </View>
); );

View File

@@ -1,7 +1,7 @@
import React, {createRef} from 'react'; import React, {createRef} from 'react';
import {TouchableOpacity, View} from 'react-native'; import {TouchableOpacity, View} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { notesnook } from '../../../e2e/test.ids'; import {notesnook} from '../../../e2e/test.ids';
import {Actions} from '../../provider/Actions'; import {Actions} from '../../provider/Actions';
import {defaultState} from '../../provider/DefaultState'; import {defaultState} from '../../provider/DefaultState';
import {DDS} from '../../services/DeviceDetection'; import {DDS} from '../../services/DeviceDetection';
@@ -158,11 +158,7 @@ class SortDialog extends React.Component {
<PressableButton <PressableButton
key={item} key={item}
testID={'btn-' + item} testID={'btn-' + item}
color={ type={this.state.settings.sort === item ? 'shade' : 'gray'}
this.state.settings.sort === item
? colors.shade
: 'transparent'
}
onPress={async () => { onPress={async () => {
await SettingsService.set('sort', item); await SettingsService.set('sort', item);
await this.getSettings(); await this.getSettings();